diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 96d21aa5b1cd..668062c13656 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -192,6 +192,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-resourcemover;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 8fdda9376416..1f9af398a435 100644 --- a/pom.xml +++ b/pom.xml @@ -575,6 +575,7 @@ sdk/recoveryservices sdk/relay sdk/resourcemanager + sdk/resourcemover sdk/schemaregistry sdk/search sdk/servicebus diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/CHANGELOG.md b/sdk/resourcemover/azure-resourcemanager-resourcemover/CHANGELOG.md new file mode 100644 index 000000000000..6a6e4eaa4ffe --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-01-18) + +- Azure Resource Manager ResourceMover client library for Java. This package contains Microsoft Azure SDK for ResourceMover Management SDK. A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. Package tag package-2019-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/README.md b/sdk/resourcemover/azure-resourcemanager-resourcemover/README.md new file mode 100644 index 000000000000..f20c57462b49 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/README.md @@ -0,0 +1,83 @@ +# Azure Resource Manager ResourceMover client library for Java + +Azure Resource Manager ResourceMover client library for Java. + +This package contains Microsoft Azure SDK for ResourceMover Management SDK. A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. Package tag package-2019-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## 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-resourcemover;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-resourcemover + 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(); +ResourceMoverManager manager = ResourceMoverManager + .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 + + +[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/resourcemover/azure-resourcemanager-resourcemover/pom.xml b/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml new file mode 100644 index 000000000000..18f7b15d06be --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-resourcemover + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ResourceMover Management + This package contains Microsoft Azure SDK for ResourceMover Management SDK. A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. Package tag package-2019-10-01-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.1.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/ResourceMoverManager.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/ResourceMoverManager.java new file mode 100644 index 000000000000..2ccd64235439 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/ResourceMoverManager.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover; + +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.resourcemover.fluent.ResourceMoverServiceApi; +import com.azure.resourcemanager.resourcemover.implementation.MoveCollectionsImpl; +import com.azure.resourcemanager.resourcemover.implementation.MoveResourcesImpl; +import com.azure.resourcemanager.resourcemover.implementation.OperationsDiscoveriesImpl; +import com.azure.resourcemanager.resourcemover.implementation.ResourceMoverServiceApiBuilder; +import com.azure.resourcemanager.resourcemover.implementation.UnresolvedDependenciesImpl; +import com.azure.resourcemanager.resourcemover.models.MoveCollections; +import com.azure.resourcemanager.resourcemover.models.MoveResources; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveries; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependencies; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Entry point to ResourceMoverManager. A first party Azure service orchestrating the move of Azure resources from one + * Azure region to another or between zones within a region. + */ +public final class ResourceMoverManager { + private MoveCollections moveCollections; + + private MoveResources moveResources; + + private UnresolvedDependencies unresolvedDependencies; + + private OperationsDiscoveries operationsDiscoveries; + + private final ResourceMoverServiceApi clientObject; + + private ResourceMoverManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ResourceMoverServiceApiBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ResourceMover service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ResourceMover service API instance. + */ + public static ResourceMoverManager 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 ResourceMoverManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ResourceMoverManager.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 ResourceMover service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ResourceMover service API instance. + */ + public ResourceMoverManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.resourcemover", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + 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 ResourceMoverManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of MoveCollections. */ + public MoveCollections moveCollections() { + if (this.moveCollections == null) { + this.moveCollections = new MoveCollectionsImpl(clientObject.getMoveCollections(), this); + } + return moveCollections; + } + + /** @return Resource collection API of MoveResources. */ + public MoveResources moveResources() { + if (this.moveResources == null) { + this.moveResources = new MoveResourcesImpl(clientObject.getMoveResources(), this); + } + return moveResources; + } + + /** @return Resource collection API of UnresolvedDependencies. */ + public UnresolvedDependencies unresolvedDependencies() { + if (this.unresolvedDependencies == null) { + this.unresolvedDependencies = + new UnresolvedDependenciesImpl(clientObject.getUnresolvedDependencies(), this); + } + return unresolvedDependencies; + } + + /** @return Resource collection API of OperationsDiscoveries. */ + public OperationsDiscoveries operationsDiscoveries() { + if (this.operationsDiscoveries == null) { + this.operationsDiscoveries = new OperationsDiscoveriesImpl(clientObject.getOperationsDiscoveries(), this); + } + return operationsDiscoveries; + } + + /** + * @return Wrapped service client ResourceMoverServiceApi providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ResourceMoverServiceApi serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveCollectionsClient.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveCollectionsClient.java new file mode 100644 index 000000000000..e5ebf2ca160f --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveCollectionsClient.java @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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.resourcemover.fluent.models.MoveCollectionInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.BulkRemoveRequest; +import com.azure.resourcemanager.resourcemover.models.CommitRequest; +import com.azure.resourcemanager.resourcemover.models.DiscardRequest; +import com.azure.resourcemanager.resourcemover.models.PrepareRequest; +import com.azure.resourcemanager.resourcemover.models.ResourceMoveRequest; +import com.azure.resourcemanager.resourcemover.models.UpdateMoveCollectionRequest; + +/** An instance of this class provides access to all the operations defined in MoveCollectionsClient. */ +public interface MoveCollectionsClient { + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveCollectionInner create(String resourceGroupName, String moveCollectionName); + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Define the move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String moveCollectionName, MoveCollectionInner body, Context context); + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveCollectionInner update(String resourceGroupName, String moveCollectionName); + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for updating move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String moveCollectionName, UpdateMoveCollectionRequest body, Context context); + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName); + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, Context context); + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner delete(String resourceGroupName, String moveCollectionName); + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner delete(String resourceGroupName, String moveCollectionName, Context context); + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveCollectionInner getByResourceGroup(String resourceGroupName, String moveCollectionName); + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String moveCollectionName, Context context); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginPrepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginPrepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner prepare(String resourceGroupName, String moveCollectionName, PrepareRequest body); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner prepare(String resourceGroupName, String moveCollectionName); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner prepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginInitiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginInitiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner initiateMove(String resourceGroupName, String moveCollectionName, ResourceMoveRequest body); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner initiateMove(String resourceGroupName, String moveCollectionName); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner initiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginCommit( + String resourceGroupName, String moveCollectionName, CommitRequest body); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginCommit( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner commit(String resourceGroupName, String moveCollectionName, CommitRequest body); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner commit(String resourceGroupName, String moveCollectionName); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner commit( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDiscard( + String resourceGroupName, String moveCollectionName, DiscardRequest body); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDiscard( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner discard(String resourceGroupName, String moveCollectionName, DiscardRequest body); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner discard(String resourceGroupName, String moveCollectionName); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner discard( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginResolveDependencies( + String resourceGroupName, String moveCollectionName); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginResolveDependencies( + String resourceGroupName, String moveCollectionName, Context context); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner resolveDependencies(String resourceGroupName, String moveCollectionName); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner resolveDependencies(String resourceGroupName, String moveCollectionName, Context context); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginBulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginBulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner bulkRemove(String resourceGroupName, String moveCollectionName, BulkRemoveRequest body); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner bulkRemove(String resourceGroupName, String moveCollectionName); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner bulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context); + + /** + * Get all the Move Collections in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the Move Collections in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveResourcesClient.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveResourcesClient.java new file mode 100644 index 000000000000..ce8354ba96ff --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/MoveResourcesClient.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.resourcemover.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.resourcemover.fluent.models.MoveResourceInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in MoveResourcesClient. */ +public interface MoveResourcesClient { + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String moveCollectionName); + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String moveCollectionName, String filter, Context context); + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, MoveResourceInner> beginCreate( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body); + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, MoveResourceInner> beginCreate( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context); + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveResourceInner create( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body); + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveResourceInner create(String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveResourceInner create( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner delete(String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner delete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context); + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MoveResourceInner get(String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/OperationsDiscoveriesClient.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/OperationsDiscoveriesClient.java new file mode 100644 index 000000000000..06f4b555d6f1 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/OperationsDiscoveriesClient.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.resourcemover.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner; + +/** An instance of this class provides access to all the operations defined in OperationsDiscoveriesClient. */ +public interface OperationsDiscoveriesClient { + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationsDiscoveryCollectionInner get(); + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/ResourceMoverServiceApi.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/ResourceMoverServiceApi.java new file mode 100644 index 000000000000..6266683ef69f --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/ResourceMoverServiceApi.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.resourcemover.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ResourceMoverServiceApi class. */ +public interface ResourceMoverServiceApi { + /** + * Gets The Subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the MoveCollectionsClient object to access its operations. + * + * @return the MoveCollectionsClient object. + */ + MoveCollectionsClient getMoveCollections(); + + /** + * Gets the MoveResourcesClient object to access its operations. + * + * @return the MoveResourcesClient object. + */ + MoveResourcesClient getMoveResources(); + + /** + * Gets the UnresolvedDependenciesClient object to access its operations. + * + * @return the UnresolvedDependenciesClient object. + */ + UnresolvedDependenciesClient getUnresolvedDependencies(); + + /** + * Gets the OperationsDiscoveriesClient object to access its operations. + * + * @return the OperationsDiscoveriesClient object. + */ + OperationsDiscoveriesClient getOperationsDiscoveries(); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/UnresolvedDependenciesClient.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/UnresolvedDependenciesClient.java new file mode 100644 index 000000000000..2e38bc3d93ed --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/UnresolvedDependenciesClient.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.resourcemover.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner; + +/** An instance of this class provides access to all the operations defined in UnresolvedDependenciesClient. */ +public interface UnresolvedDependenciesClient { + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UnresolvedDependencyCollectionInner get(String resourceGroupName, String moveCollectionName); + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String moveCollectionName, Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveCollectionInner.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveCollectionInner.java new file mode 100644 index 000000000000..be2a02a6a018 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveCollectionInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.models.Identity; +import com.azure.resourcemanager.resourcemover.models.MoveCollectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Define the move collection. */ +@Fluent +public final class MoveCollectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveCollectionInner.class); + + /* + * The etag of the resource. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Defines the MSI properties of the Move Collection. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * Defines the move collection properties. + */ + @JsonProperty(value = "properties") + private MoveCollectionProperties properties; + + /** + * Get the etag property: The etag of the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity property: Defines the MSI properties of the Move Collection. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Defines the MSI properties of the Move Collection. + * + * @param identity the identity value to set. + * @return the MoveCollectionInner object itself. + */ + public MoveCollectionInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: Defines the move collection properties. + * + * @return the properties value. + */ + public MoveCollectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Defines the move collection properties. + * + * @param properties the properties value to set. + * @return the MoveCollectionInner object itself. + */ + public MoveCollectionInner withProperties(MoveCollectionProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public MoveCollectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MoveCollectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveResourceInner.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveResourceInner.java new file mode 100644 index 000000000000..e4fb6c882a70 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/MoveResourceInner.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.resourcemover.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.resourcemover.models.MoveResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the move resource. */ +@Fluent +public final class MoveResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceInner.class); + + /* + * Defines the move resource properties. + */ + @JsonProperty(value = "properties") + private MoveResourceProperties properties; + + /** + * Get the properties property: Defines the move resource properties. + * + * @return the properties value. + */ + public MoveResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Defines the move resource properties. + * + * @param properties the properties value to set. + * @return the MoveResourceInner object itself. + */ + public MoveResourceInner withProperties(MoveResourceProperties 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationStatusInner.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..0a331aaeb9b5 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationStatusInner.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.resourcemover.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.models.OperationStatusError; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation status REST resource. */ +@Immutable +public final class OperationStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); + + /* + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Operation name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the operation. ARM expects the terminal status to be one of + * Succeeded/ Failed/ Canceled. All other values imply that the operation + * is still running. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * End time. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /* + * Error stating all error details for the operation. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatusError error; + + /* + * Custom data. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private Object properties; + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ + * Canceled. All other values imply that the operation is still running. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the startTime property: Start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the error property: Error stating all error details for the operation. + * + * @return the error value. + */ + public OperationStatusError error() { + return this.error; + } + + /** + * Get the properties property: Custom data. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationsDiscoveryCollectionInner.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationsDiscoveryCollectionInner.java new file mode 100644 index 000000000000..18c47e98d168 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/OperationsDiscoveryCollectionInner.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.resourcemover.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscovery; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of ClientDiscovery details. */ +@Fluent +public final class OperationsDiscoveryCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscoveryCollectionInner.class); + + /* + * Gets or sets the ClientDiscovery details. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the ClientDiscovery details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the ClientDiscovery details. + * + * @param value the value value to set. + * @return the OperationsDiscoveryCollectionInner object itself. + */ + public OperationsDiscoveryCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the OperationsDiscoveryCollectionInner object itself. + */ + public OperationsDiscoveryCollectionInner 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/UnresolvedDependencyCollectionInner.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/UnresolvedDependencyCollectionInner.java new file mode 100644 index 000000000000..9d4bf282c22d --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/UnresolvedDependencyCollectionInner.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.resourcemover.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependency; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Unresolved dependency collection. */ +@Fluent +public final class UnresolvedDependencyCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnresolvedDependencyCollectionInner.class); + + /* + * Gets or sets the list of unresolved dependencies. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the list of unresolved dependencies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of unresolved dependencies. + * + * @param value the value value to set. + * @return the UnresolvedDependencyCollectionInner object itself. + */ + public UnresolvedDependencyCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the UnresolvedDependencyCollectionInner object itself. + */ + public UnresolvedDependencyCollectionInner 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/package-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/package-info.java new file mode 100644 index 000000000000..407e88f08e3c --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for ResourceMoverServiceApi. A first party Azure service orchestrating the + * move of Azure resources from one Azure region to another or between zones within a region. + */ +package com.azure.resourcemanager.resourcemover.fluent.models; diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/package-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/package-info.java new file mode 100644 index 000000000000..e4b14aa9f03d --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for ResourceMoverServiceApi. A first party Azure service orchestrating the + * move of Azure resources from one Azure region to another or between zones within a region. + */ +package com.azure.resourcemanager.resourcemover.fluent; diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionImpl.java new file mode 100644 index 000000000000..4130f538ad40 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveCollectionInner; +import com.azure.resourcemanager.resourcemover.models.BulkRemoveRequest; +import com.azure.resourcemanager.resourcemover.models.CommitRequest; +import com.azure.resourcemanager.resourcemover.models.DiscardRequest; +import com.azure.resourcemanager.resourcemover.models.Identity; +import com.azure.resourcemanager.resourcemover.models.MoveCollection; +import com.azure.resourcemanager.resourcemover.models.MoveCollectionProperties; +import com.azure.resourcemanager.resourcemover.models.OperationStatus; +import com.azure.resourcemanager.resourcemover.models.PrepareRequest; +import com.azure.resourcemanager.resourcemover.models.ResourceMoveRequest; +import com.azure.resourcemanager.resourcemover.models.UpdateMoveCollectionRequest; +import java.util.Collections; +import java.util.Map; + +public final class MoveCollectionImpl implements MoveCollection, MoveCollection.Definition, MoveCollection.Update { + private MoveCollectionInner innerObject; + + private final ResourceMoverManager 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 Identity identity() { + return this.innerModel().identity(); + } + + public MoveCollectionProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MoveCollectionInner innerModel() { + return this.innerObject; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String moveCollectionName; + + private UpdateMoveCollectionRequest updateBody; + + public MoveCollectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MoveCollection create() { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .createWithResponse(resourceGroupName, moveCollectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MoveCollection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .createWithResponse(resourceGroupName, moveCollectionName, this.innerModel(), context) + .getValue(); + return this; + } + + MoveCollectionImpl(String name, ResourceMoverManager serviceManager) { + this.innerObject = new MoveCollectionInner(); + this.serviceManager = serviceManager; + this.moveCollectionName = name; + } + + public MoveCollectionImpl update() { + this.updateBody = new UpdateMoveCollectionRequest(); + return this; + } + + public MoveCollection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .updateWithResponse(resourceGroupName, moveCollectionName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public MoveCollection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .updateWithResponse(resourceGroupName, moveCollectionName, updateBody, context) + .getValue(); + return this; + } + + MoveCollectionImpl(MoveCollectionInner innerObject, ResourceMoverManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.moveCollectionName = Utils.getValueFromIdByName(innerObject.id(), "moveCollections"); + } + + public MoveCollection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .getByResourceGroupWithResponse(resourceGroupName, moveCollectionName, Context.NONE) + .getValue(); + return this; + } + + public MoveCollection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMoveCollections() + .getByResourceGroupWithResponse(resourceGroupName, moveCollectionName, context) + .getValue(); + return this; + } + + public OperationStatus prepare(PrepareRequest body) { + return serviceManager.moveCollections().prepare(resourceGroupName, moveCollectionName, body); + } + + public OperationStatus prepare() { + return serviceManager.moveCollections().prepare(resourceGroupName, moveCollectionName); + } + + public OperationStatus prepare(PrepareRequest body, Context context) { + return serviceManager.moveCollections().prepare(resourceGroupName, moveCollectionName, body, context); + } + + public OperationStatus initiateMove(ResourceMoveRequest body) { + return serviceManager.moveCollections().initiateMove(resourceGroupName, moveCollectionName, body); + } + + public OperationStatus initiateMove() { + return serviceManager.moveCollections().initiateMove(resourceGroupName, moveCollectionName); + } + + public OperationStatus initiateMove(ResourceMoveRequest body, Context context) { + return serviceManager.moveCollections().initiateMove(resourceGroupName, moveCollectionName, body, context); + } + + public OperationStatus commit(CommitRequest body) { + return serviceManager.moveCollections().commit(resourceGroupName, moveCollectionName, body); + } + + public OperationStatus commit() { + return serviceManager.moveCollections().commit(resourceGroupName, moveCollectionName); + } + + public OperationStatus commit(CommitRequest body, Context context) { + return serviceManager.moveCollections().commit(resourceGroupName, moveCollectionName, body, context); + } + + public OperationStatus discard(DiscardRequest body) { + return serviceManager.moveCollections().discard(resourceGroupName, moveCollectionName, body); + } + + public OperationStatus discard() { + return serviceManager.moveCollections().discard(resourceGroupName, moveCollectionName); + } + + public OperationStatus discard(DiscardRequest body, Context context) { + return serviceManager.moveCollections().discard(resourceGroupName, moveCollectionName, body, context); + } + + public OperationStatus resolveDependencies() { + return serviceManager.moveCollections().resolveDependencies(resourceGroupName, moveCollectionName); + } + + public OperationStatus resolveDependencies(Context context) { + return serviceManager.moveCollections().resolveDependencies(resourceGroupName, moveCollectionName, context); + } + + public OperationStatus bulkRemove(BulkRemoveRequest body) { + return serviceManager.moveCollections().bulkRemove(resourceGroupName, moveCollectionName, body); + } + + public OperationStatus bulkRemove() { + return serviceManager.moveCollections().bulkRemove(resourceGroupName, moveCollectionName); + } + + public OperationStatus bulkRemove(BulkRemoveRequest body, Context context) { + return serviceManager.moveCollections().bulkRemove(resourceGroupName, moveCollectionName, body, context); + } + + public MoveCollectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MoveCollectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MoveCollectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public MoveCollectionImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public MoveCollectionImpl withProperties(MoveCollectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsClientImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsClientImpl.java new file mode 100644 index 000000000000..291fbfcd7993 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsClientImpl.java @@ -0,0 +1,3410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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.resourcemover.fluent.MoveCollectionsClient; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveCollectionInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.BulkRemoveRequest; +import com.azure.resourcemanager.resourcemover.models.CommitRequest; +import com.azure.resourcemanager.resourcemover.models.DiscardRequest; +import com.azure.resourcemanager.resourcemover.models.MoveCollectionResultList; +import com.azure.resourcemanager.resourcemover.models.PrepareRequest; +import com.azure.resourcemanager.resourcemover.models.ResourceMoveRequest; +import com.azure.resourcemanager.resourcemover.models.UpdateMoveCollectionRequest; +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 MoveCollectionsClient. */ +public final class MoveCollectionsClientImpl implements MoveCollectionsClient { + private final ClientLogger logger = new ClientLogger(MoveCollectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MoveCollectionsService service; + + /** The service client containing this operation class. */ + private final ResourceMoverServiceApiImpl client; + + /** + * Initializes an instance of MoveCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MoveCollectionsClientImpl(ResourceMoverServiceApiImpl client) { + this.service = + RestProxy.create(MoveCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceMoverServiceApiMoveCollections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceMoverService") + private interface MoveCollectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MoveCollectionInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateMoveCollectionRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/prepare") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> prepare( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrepareRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/initiateMove") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> initiateMove( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceMoveRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/commit") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> commit( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CommitRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/discard") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> discard( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiscardRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/resolveDependencies") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resolveDependencies( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/bulkRemove") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> bulkRemove( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BulkRemoveRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMoveCollectionsBySubscriptionNext( + @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> listMoveCollectionsByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Define the move collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String moveCollectionName, MoveCollectionInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Define the move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String moveCollectionName, MoveCollectionInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Define the move collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String moveCollectionName, MoveCollectionInner body) { + return createWithResponseAsync(resourceGroupName, moveCollectionName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String moveCollectionName) { + final MoveCollectionInner body = null; + return createWithResponseAsync(resourceGroupName, moveCollectionName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveCollectionInner create(String resourceGroupName, String moveCollectionName) { + final MoveCollectionInner body = null; + return createAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Creates or updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Define the move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String moveCollectionName, MoveCollectionInner body, Context context) { + return createWithResponseAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for updating move collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String moveCollectionName, UpdateMoveCollectionRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for updating move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String moveCollectionName, UpdateMoveCollectionRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for updating move collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String moveCollectionName, UpdateMoveCollectionRequest body) { + return updateWithResponseAsync(resourceGroupName, moveCollectionName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String moveCollectionName) { + final UpdateMoveCollectionRequest body = null; + return updateWithResponseAsync(resourceGroupName, moveCollectionName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveCollectionInner update(String resourceGroupName, String moveCollectionName) { + final UpdateMoveCollectionRequest body = null; + return updateAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Updates a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for updating move collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String moveCollectionName, UpdateMoveCollectionRequest body, Context context) { + return updateWithResponseAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String moveCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String moveCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDeleteAsync( + String resourceGroupName, String moveCollectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, moveCollectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDeleteAsync( + String resourceGroupName, String moveCollectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, moveCollectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName) { + return beginDeleteAsync(resourceGroupName, moveCollectionName).getSyncPoller(); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, Context context) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, context).getSyncPoller(); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String moveCollectionName) { + return beginDeleteAsync(resourceGroupName, moveCollectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String moveCollectionName, Context context) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner delete(String resourceGroupName, String moveCollectionName) { + return deleteAsync(resourceGroupName, moveCollectionName).block(); + } + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner delete(String resourceGroupName, String moveCollectionName, Context context) { + return deleteAsync(resourceGroupName, moveCollectionName, context).block(); + } + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String moveCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String moveCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String moveCollectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, moveCollectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveCollectionInner getByResourceGroup(String resourceGroupName, String moveCollectionName) { + return getByResourceGroupAsync(resourceGroupName, moveCollectionName).block(); + } + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String moveCollectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, moveCollectionName, context).block(); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> prepareWithResponseAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .prepare( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> prepareWithResponseAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .prepare( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginPrepareAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body) { + Mono>> mono = prepareWithResponseAsync(resourceGroupName, moveCollectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginPrepareAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + prepareWithResponseAsync(resourceGroupName, moveCollectionName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginPrepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body) { + return beginPrepareAsync(resourceGroupName, moveCollectionName, body).getSyncPoller(); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginPrepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + return beginPrepareAsync(resourceGroupName, moveCollectionName, body, context).getSyncPoller(); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono prepareAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body) { + return beginPrepareAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono prepareAsync(String resourceGroupName, String moveCollectionName) { + final PrepareRequest body = null; + return beginPrepareAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono prepareAsync( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + return beginPrepareAsync(resourceGroupName, moveCollectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner prepare(String resourceGroupName, String moveCollectionName, PrepareRequest body) { + return prepareAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner prepare(String resourceGroupName, String moveCollectionName) { + final PrepareRequest body = null; + return prepareAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner prepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + return prepareAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initiateMoveWithResponseAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .initiateMove( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initiateMoveWithResponseAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .initiateMove( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginInitiateMoveAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + Mono>> mono = + initiateMoveWithResponseAsync(resourceGroupName, moveCollectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginInitiateMoveAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + initiateMoveWithResponseAsync(resourceGroupName, moveCollectionName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginInitiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + return beginInitiateMoveAsync(resourceGroupName, moveCollectionName, body).getSyncPoller(); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginInitiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + return beginInitiateMoveAsync(resourceGroupName, moveCollectionName, body, context).getSyncPoller(); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateMoveAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + return beginInitiateMoveAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateMoveAsync(String resourceGroupName, String moveCollectionName) { + final ResourceMoveRequest body = null; + return beginInitiateMoveAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateMoveAsync( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + return beginInitiateMoveAsync(resourceGroupName, moveCollectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner initiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + return initiateMoveAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner initiateMove(String resourceGroupName, String moveCollectionName) { + final ResourceMoveRequest body = null; + return initiateMoveAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner initiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + return initiateMoveAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> commitWithResponseAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .commit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> commitWithResponseAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .commit( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginCommitAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body) { + Mono>> mono = commitWithResponseAsync(resourceGroupName, moveCollectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginCommitAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + commitWithResponseAsync(resourceGroupName, moveCollectionName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginCommit( + String resourceGroupName, String moveCollectionName, CommitRequest body) { + return beginCommitAsync(resourceGroupName, moveCollectionName, body).getSyncPoller(); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginCommit( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + return beginCommitAsync(resourceGroupName, moveCollectionName, body, context).getSyncPoller(); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commitAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body) { + return beginCommitAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commitAsync(String resourceGroupName, String moveCollectionName) { + final CommitRequest body = null; + return beginCommitAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commitAsync( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + return beginCommitAsync(resourceGroupName, moveCollectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner commit(String resourceGroupName, String moveCollectionName, CommitRequest body) { + return commitAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner commit(String resourceGroupName, String moveCollectionName) { + final CommitRequest body = null; + return commitAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner commit( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + return commitAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> discardWithResponseAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .discard( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> discardWithResponseAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .discard( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDiscardAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body) { + Mono>> mono = discardWithResponseAsync(resourceGroupName, moveCollectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDiscardAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + discardWithResponseAsync(resourceGroupName, moveCollectionName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDiscard( + String resourceGroupName, String moveCollectionName, DiscardRequest body) { + return beginDiscardAsync(resourceGroupName, moveCollectionName, body).getSyncPoller(); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDiscard( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + return beginDiscardAsync(resourceGroupName, moveCollectionName, body, context).getSyncPoller(); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono discardAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body) { + return beginDiscardAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono discardAsync(String resourceGroupName, String moveCollectionName) { + final DiscardRequest body = null; + return beginDiscardAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono discardAsync( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + return beginDiscardAsync(resourceGroupName, moveCollectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner discard(String resourceGroupName, String moveCollectionName, DiscardRequest body) { + return discardAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner discard(String resourceGroupName, String moveCollectionName) { + final DiscardRequest body = null; + return discardAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner discard( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + return discardAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resolveDependenciesWithResponseAsync( + String resourceGroupName, String moveCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resolveDependencies( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resolveDependenciesWithResponseAsync( + String resourceGroupName, String moveCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resolveDependencies( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginResolveDependenciesAsync( + String resourceGroupName, String moveCollectionName) { + Mono>> mono = + resolveDependenciesWithResponseAsync(resourceGroupName, moveCollectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginResolveDependenciesAsync( + String resourceGroupName, String moveCollectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resolveDependenciesWithResponseAsync(resourceGroupName, moveCollectionName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginResolveDependencies( + String resourceGroupName, String moveCollectionName) { + return beginResolveDependenciesAsync(resourceGroupName, moveCollectionName).getSyncPoller(); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginResolveDependencies( + String resourceGroupName, String moveCollectionName, Context context) { + return beginResolveDependenciesAsync(resourceGroupName, moveCollectionName, context).getSyncPoller(); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resolveDependenciesAsync(String resourceGroupName, String moveCollectionName) { + return beginResolveDependenciesAsync(resourceGroupName, moveCollectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resolveDependenciesAsync( + String resourceGroupName, String moveCollectionName, Context context) { + return beginResolveDependenciesAsync(resourceGroupName, moveCollectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner resolveDependencies(String resourceGroupName, String moveCollectionName) { + return resolveDependenciesAsync(resourceGroupName, moveCollectionName).block(); + } + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner resolveDependencies( + String resourceGroupName, String moveCollectionName, Context context) { + return resolveDependenciesAsync(resourceGroupName, moveCollectionName, context).block(); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bulkRemoveWithResponseAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .bulkRemove( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bulkRemoveWithResponseAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .bulkRemove( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginBulkRemoveAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + Mono>> mono = + bulkRemoveWithResponseAsync(resourceGroupName, moveCollectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginBulkRemoveAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + bulkRemoveWithResponseAsync(resourceGroupName, moveCollectionName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginBulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + return beginBulkRemoveAsync(resourceGroupName, moveCollectionName, body).getSyncPoller(); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginBulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + return beginBulkRemoveAsync(resourceGroupName, moveCollectionName, body, context).getSyncPoller(); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkRemoveAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + return beginBulkRemoveAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkRemoveAsync(String resourceGroupName, String moveCollectionName) { + final BulkRemoveRequest body = null; + return beginBulkRemoveAsync(resourceGroupName, moveCollectionName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bulkRemoveAsync( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + return beginBulkRemoveAsync(resourceGroupName, moveCollectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner bulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + return bulkRemoveAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner bulkRemove(String resourceGroupName, String moveCollectionName) { + final BulkRemoveRequest body = null; + return bulkRemoveAsync(resourceGroupName, moveCollectionName, body).block(); + } + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner bulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + return bulkRemoveAsync(resourceGroupName, moveCollectionName, body, context).block(); + } + + /** + * Get all the Move Collections in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all the Move Collections in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the Move Collections in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listMoveCollectionsBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all the Move Collections in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), + nextLink -> listMoveCollectionsBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the Move Collections in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get all the Move Collections in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listMoveCollectionsByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listMoveCollectionsByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 defines the collection of move collections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMoveCollectionsBySubscriptionNextSinglePageAsync( + 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.listMoveCollectionsBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move collections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMoveCollectionsBySubscriptionNextSinglePageAsync( + 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 + .listMoveCollectionsBySubscriptionNext(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 defines the collection of move collections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMoveCollectionsByResourceGroupNextSinglePageAsync( + 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 + .listMoveCollectionsByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move collections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMoveCollectionsByResourceGroupNextSinglePageAsync( + 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 + .listMoveCollectionsByResourceGroupNext(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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsImpl.java new file mode 100644 index 000000000000..801ab1e1995e --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveCollectionsImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.MoveCollectionsClient; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveCollectionInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.BulkRemoveRequest; +import com.azure.resourcemanager.resourcemover.models.CommitRequest; +import com.azure.resourcemanager.resourcemover.models.DiscardRequest; +import com.azure.resourcemanager.resourcemover.models.MoveCollection; +import com.azure.resourcemanager.resourcemover.models.MoveCollections; +import com.azure.resourcemanager.resourcemover.models.OperationStatus; +import com.azure.resourcemanager.resourcemover.models.PrepareRequest; +import com.azure.resourcemanager.resourcemover.models.ResourceMoveRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MoveCollectionsImpl implements MoveCollections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveCollectionsImpl.class); + + private final MoveCollectionsClient innerClient; + + private final ResourceMoverManager serviceManager; + + public MoveCollectionsImpl(MoveCollectionsClient innerClient, ResourceMoverManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus deleteByResourceGroup(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().delete(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus delete(String resourceGroupName, String moveCollectionName, Context context) { + OperationStatusInner inner = this.serviceClient().delete(resourceGroupName, moveCollectionName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public MoveCollection getByResourceGroup(String resourceGroupName, String moveCollectionName) { + MoveCollectionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, moveCollectionName); + if (inner != null) { + return new MoveCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String moveCollectionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, moveCollectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MoveCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatus prepare(String resourceGroupName, String moveCollectionName, PrepareRequest body) { + OperationStatusInner inner = this.serviceClient().prepare(resourceGroupName, moveCollectionName, body); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus prepare(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().prepare(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus prepare( + String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context) { + OperationStatusInner inner = this.serviceClient().prepare(resourceGroupName, moveCollectionName, body, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus initiateMove(String resourceGroupName, String moveCollectionName, ResourceMoveRequest body) { + OperationStatusInner inner = this.serviceClient().initiateMove(resourceGroupName, moveCollectionName, body); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus initiateMove(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().initiateMove(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus initiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context) { + OperationStatusInner inner = + this.serviceClient().initiateMove(resourceGroupName, moveCollectionName, body, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus commit(String resourceGroupName, String moveCollectionName, CommitRequest body) { + OperationStatusInner inner = this.serviceClient().commit(resourceGroupName, moveCollectionName, body); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus commit(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().commit(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus commit( + String resourceGroupName, String moveCollectionName, CommitRequest body, Context context) { + OperationStatusInner inner = this.serviceClient().commit(resourceGroupName, moveCollectionName, body, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus discard(String resourceGroupName, String moveCollectionName, DiscardRequest body) { + OperationStatusInner inner = this.serviceClient().discard(resourceGroupName, moveCollectionName, body); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus discard(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().discard(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus discard( + String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context) { + OperationStatusInner inner = this.serviceClient().discard(resourceGroupName, moveCollectionName, body, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus resolveDependencies(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().resolveDependencies(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus resolveDependencies(String resourceGroupName, String moveCollectionName, Context context) { + OperationStatusInner inner = + this.serviceClient().resolveDependencies(resourceGroupName, moveCollectionName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus bulkRemove(String resourceGroupName, String moveCollectionName, BulkRemoveRequest body) { + OperationStatusInner inner = this.serviceClient().bulkRemove(resourceGroupName, moveCollectionName, body); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus bulkRemove(String resourceGroupName, String moveCollectionName) { + OperationStatusInner inner = this.serviceClient().bulkRemove(resourceGroupName, moveCollectionName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus bulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context) { + OperationStatusInner inner = + this.serviceClient().bulkRemove(resourceGroupName, moveCollectionName, body, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new MoveCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new MoveCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new MoveCollectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new MoveCollectionImpl(inner1, this.manager())); + } + + public MoveCollection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, moveCollectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, moveCollectionName, context); + } + + public OperationStatus deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + return this.delete(resourceGroupName, moveCollectionName, Context.NONE); + } + + public OperationStatus deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + return this.delete(resourceGroupName, moveCollectionName, context); + } + + private MoveCollectionsClient serviceClient() { + return this.innerClient; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } + + public MoveCollectionImpl define(String name) { + return new MoveCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourceImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourceImpl.java new file mode 100644 index 000000000000..90cb369d8b4e --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourceImpl.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.resourcemover.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner; +import com.azure.resourcemanager.resourcemover.models.MoveResource; +import com.azure.resourcemanager.resourcemover.models.MoveResourceProperties; + +public final class MoveResourceImpl implements MoveResource, MoveResource.Definition { + private MoveResourceInner innerObject; + + private final ResourceMoverManager serviceManager; + + MoveResourceImpl(MoveResourceInner innerObject, ResourceMoverManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MoveResourceProperties properties() { + return this.innerModel().properties(); + } + + public MoveResourceInner innerModel() { + return this.innerObject; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String moveCollectionName; + + private String moveResourceName; + + public MoveResourceImpl withExistingMoveCollection(String resourceGroupName, String moveCollectionName) { + this.resourceGroupName = resourceGroupName; + this.moveCollectionName = moveCollectionName; + return this; + } + + public MoveResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getMoveResources() + .create(resourceGroupName, moveCollectionName, moveResourceName, this.innerModel(), Context.NONE); + return this; + } + + public MoveResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMoveResources() + .create(resourceGroupName, moveCollectionName, moveResourceName, this.innerModel(), context); + return this; + } + + MoveResourceImpl(String name, ResourceMoverManager serviceManager) { + this.innerObject = new MoveResourceInner(); + this.serviceManager = serviceManager; + this.moveResourceName = name; + } + + public MoveResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMoveResources() + .getWithResponse(resourceGroupName, moveCollectionName, moveResourceName, Context.NONE) + .getValue(); + return this; + } + + public MoveResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMoveResources() + .getWithResponse(resourceGroupName, moveCollectionName, moveResourceName, context) + .getValue(); + return this; + } + + public MoveResourceImpl withProperties(MoveResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesClientImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesClientImpl.java new file mode 100644 index 000000000000..dcbc56cdd67a --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.resourcemover.fluent.MoveResourcesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.MoveResourceCollection; +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 MoveResourcesClient. */ +public final class MoveResourcesClientImpl implements MoveResourcesClient { + private final ClientLogger logger = new ClientLogger(MoveResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MoveResourcesService service; + + /** The service client containing this operation class. */ + private final ResourceMoverServiceApiImpl client; + + /** + * Initializes an instance of MoveResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MoveResourcesClientImpl(ResourceMoverServiceApiImpl client) { + this.service = + RestProxy.create(MoveResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceMoverServiceApiMoveResources to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceMoverService") + private interface MoveResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/moveResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @PathParam("moveResourceName") String moveResourceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MoveResourceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @PathParam("moveResourceName") String moveResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @PathParam("moveResourceName") String moveResourceName, + @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 the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String moveCollectionName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String moveCollectionName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName 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(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String moveCollectionName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, moveCollectionName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String moveCollectionName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, moveCollectionName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String moveCollectionName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, moveCollectionName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String moveCollectionName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, moveCollectionName, filter)); + } + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String moveCollectionName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, moveCollectionName, filter, context)); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, MoveResourceInner> beginCreateAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MoveResourceInner.class, MoveResourceInner.class, Context.NONE); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, MoveResourceInner> beginCreateAsync( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MoveResourceInner.class, MoveResourceInner.class, context); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MoveResourceInner> beginCreate( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body) { + return beginCreateAsync(resourceGroupName, moveCollectionName, moveResourceName, body).getSyncPoller(); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MoveResourceInner> beginCreate( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, moveCollectionName, moveResourceName, body, context).getSyncPoller(); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body) { + return beginCreateAsync(resourceGroupName, moveCollectionName, moveResourceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + final MoveResourceInner body = null; + return beginCreateAsync(resourceGroupName, moveCollectionName, moveResourceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, moveCollectionName, moveResourceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveResourceInner create( + String resourceGroupName, String moveCollectionName, String moveResourceName, MoveResourceInner body) { + return createAsync(resourceGroupName, moveCollectionName, moveResourceName, body).block(); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveResourceInner create(String resourceGroupName, String moveCollectionName, String moveResourceName) { + final MoveResourceInner body = null; + return createAsync(resourceGroupName, moveCollectionName, moveResourceName, body).block(); + } + + /** + * Creates or updates a Move Resource in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param body Defines the move resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the move resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveResourceInner create( + String resourceGroupName, + String moveCollectionName, + String moveResourceName, + MoveResourceInner body, + Context context) { + return createAsync(resourceGroupName, moveCollectionName, moveResourceName, body, context).block(); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDeleteAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + Context.NONE); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationStatusInner> beginDeleteAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, moveResourceName).getSyncPoller(); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationStatusInner> beginDelete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, moveResourceName, context).getSyncPoller(); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, moveResourceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + return beginDeleteAsync(resourceGroupName, moveCollectionName, moveResourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner delete(String resourceGroupName, String moveCollectionName, String moveResourceName) { + return deleteAsync(resourceGroupName, moveCollectionName, moveResourceName).block(); + } + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner delete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + return deleteAsync(resourceGroupName, moveCollectionName, moveResourceName, context).block(); + } + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + if (moveResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + moveResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String moveCollectionName, String moveResourceName) { + return getWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MoveResourceInner get(String resourceGroupName, String moveCollectionName, String moveResourceName) { + return getAsync(resourceGroupName, moveCollectionName, moveResourceName).block(); + } + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, moveCollectionName, moveResourceName, 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 defines the collection of move 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesImpl.java new file mode 100644 index 000000000000..34e37d9572af --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/MoveResourcesImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.MoveResourcesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.MoveResource; +import com.azure.resourcemanager.resourcemover.models.MoveResources; +import com.azure.resourcemanager.resourcemover.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MoveResourcesImpl implements MoveResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourcesImpl.class); + + private final MoveResourcesClient innerClient; + + private final ResourceMoverManager serviceManager; + + public MoveResourcesImpl(MoveResourcesClient innerClient, ResourceMoverManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String moveCollectionName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, moveCollectionName); + return inner.mapPage(inner1 -> new MoveResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String moveCollectionName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, moveCollectionName, filter, context); + return inner.mapPage(inner1 -> new MoveResourceImpl(inner1, this.manager())); + } + + public OperationStatus delete(String resourceGroupName, String moveCollectionName, String moveResourceName) { + OperationStatusInner inner = + this.serviceClient().delete(resourceGroupName, moveCollectionName, moveResourceName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus delete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + OperationStatusInner inner = + this.serviceClient().delete(resourceGroupName, moveCollectionName, moveResourceName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public MoveResource get(String resourceGroupName, String moveCollectionName, String moveResourceName) { + MoveResourceInner inner = this.serviceClient().get(resourceGroupName, moveCollectionName, moveResourceName); + if (inner != null) { + return new MoveResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, moveCollectionName, moveResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MoveResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MoveResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + String moveResourceName = Utils.getValueFromIdByName(id, "moveResources"); + if (moveResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'moveResources'.", id))); + } + return this.getWithResponse(resourceGroupName, moveCollectionName, moveResourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + String moveResourceName = Utils.getValueFromIdByName(id, "moveResources"); + if (moveResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'moveResources'.", id))); + } + return this.getWithResponse(resourceGroupName, moveCollectionName, moveResourceName, context); + } + + public OperationStatus deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + String moveResourceName = Utils.getValueFromIdByName(id, "moveResources"); + if (moveResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'moveResources'.", id))); + } + return this.delete(resourceGroupName, moveCollectionName, moveResourceName, Context.NONE); + } + + public OperationStatus deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String moveCollectionName = Utils.getValueFromIdByName(id, "moveCollections"); + if (moveCollectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'moveCollections'.", id))); + } + String moveResourceName = Utils.getValueFromIdByName(id, "moveResources"); + if (moveResourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'moveResources'.", id))); + } + return this.delete(resourceGroupName, moveCollectionName, moveResourceName, context); + } + + private MoveResourcesClient serviceClient() { + return this.innerClient; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } + + public MoveResourceImpl define(String name) { + return new MoveResourceImpl(name, this.manager()); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationStatusImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..2101df2e3b2f --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationStatusImpl.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.resourcemover.implementation; + +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.resourcemover.models.OperationStatus; +import com.azure.resourcemanager.resourcemover.models.OperationStatusError; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final ResourceMoverManager serviceManager; + + OperationStatusImpl(OperationStatusInner innerObject, ResourceMoverManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public String endTime() { + return this.innerModel().endTime(); + } + + public OperationStatusError error() { + return this.innerModel().error(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesClientImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesClientImpl.java new file mode 100644 index 000000000000..ef33e1d27f38 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesClientImpl.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.resourcemover.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.fluent.OperationsDiscoveriesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsDiscoveriesClient. */ +public final class OperationsDiscoveriesClientImpl implements OperationsDiscoveriesClient { + private final ClientLogger logger = new ClientLogger(OperationsDiscoveriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsDiscoveriesService service; + + /** The service client containing this operation class. */ + private final ResourceMoverServiceApiImpl client; + + /** + * Initializes an instance of OperationsDiscoveriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsDiscoveriesClientImpl(ResourceMoverServiceApiImpl client) { + this.service = + RestProxy + .create(OperationsDiscoveriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceMoverServiceApiOperationsDiscoveries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceMoverService") + private interface OperationsDiscoveriesService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Migrate/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync() { + 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.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync() { + return getWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationsDiscoveryCollectionInner get() { + return getAsync().block(); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(Context context) { + return getWithResponseAsync(context).block(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesImpl.java new file mode 100644 index 000000000000..7ded8459804e --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveriesImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.OperationsDiscoveriesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveries; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveryCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsDiscoveriesImpl implements OperationsDiscoveries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscoveriesImpl.class); + + private final OperationsDiscoveriesClient innerClient; + + private final ResourceMoverManager serviceManager; + + public OperationsDiscoveriesImpl(OperationsDiscoveriesClient innerClient, ResourceMoverManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationsDiscoveryCollection get() { + OperationsDiscoveryCollectionInner inner = this.serviceClient().get(); + if (inner != null) { + return new OperationsDiscoveryCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(Context context) { + Response inner = this.serviceClient().getWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationsDiscoveryCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsDiscoveriesClient serviceClient() { + return this.innerClient; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveryCollectionImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveryCollectionImpl.java new file mode 100644 index 000000000000..24fd029ef8f7 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/OperationsDiscoveryCollectionImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscovery; +import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveryCollection; +import java.util.Collections; +import java.util.List; + +public final class OperationsDiscoveryCollectionImpl implements OperationsDiscoveryCollection { + private OperationsDiscoveryCollectionInner innerObject; + + private final ResourceMoverManager serviceManager; + + OperationsDiscoveryCollectionImpl( + OperationsDiscoveryCollectionInner innerObject, ResourceMoverManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public OperationsDiscoveryCollectionInner innerModel() { + return this.innerObject; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiBuilder.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiBuilder.java new file mode 100644 index 000000000000..9e2782c87dcf --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiBuilder.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.resourcemover.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 ResourceMoverServiceApiImpl type. */ +@ServiceClientBuilder(serviceClients = {ResourceMoverServiceApiImpl.class}) +public final class ResourceMoverServiceApiBuilder { + /* + * The Subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder 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 ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder 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 ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder 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 ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder 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 ResourceMoverServiceApiBuilder. + */ + public ResourceMoverServiceApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ResourceMoverServiceApiImpl with the provided parameters. + * + * @return an instance of ResourceMoverServiceApiImpl. + */ + public ResourceMoverServiceApiImpl 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(); + } + ResourceMoverServiceApiImpl client = + new ResourceMoverServiceApiImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiImpl.java new file mode 100644 index 000000000000..7aedd919b463 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/ResourceMoverServiceApiImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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.resourcemover.fluent.MoveCollectionsClient; +import com.azure.resourcemanager.resourcemover.fluent.MoveResourcesClient; +import com.azure.resourcemanager.resourcemover.fluent.OperationsDiscoveriesClient; +import com.azure.resourcemanager.resourcemover.fluent.ResourceMoverServiceApi; +import com.azure.resourcemanager.resourcemover.fluent.UnresolvedDependenciesClient; +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 ResourceMoverServiceApiImpl type. */ +@ServiceClient(builder = ResourceMoverServiceApiBuilder.class) +public final class ResourceMoverServiceApiImpl implements ResourceMoverServiceApi { + private final ClientLogger logger = new ClientLogger(ResourceMoverServiceApiImpl.class); + + /** The Subscription ID. */ + private final String subscriptionId; + + /** + * Gets The Subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The MoveCollectionsClient object to access its operations. */ + private final MoveCollectionsClient moveCollections; + + /** + * Gets the MoveCollectionsClient object to access its operations. + * + * @return the MoveCollectionsClient object. + */ + public MoveCollectionsClient getMoveCollections() { + return this.moveCollections; + } + + /** The MoveResourcesClient object to access its operations. */ + private final MoveResourcesClient moveResources; + + /** + * Gets the MoveResourcesClient object to access its operations. + * + * @return the MoveResourcesClient object. + */ + public MoveResourcesClient getMoveResources() { + return this.moveResources; + } + + /** The UnresolvedDependenciesClient object to access its operations. */ + private final UnresolvedDependenciesClient unresolvedDependencies; + + /** + * Gets the UnresolvedDependenciesClient object to access its operations. + * + * @return the UnresolvedDependenciesClient object. + */ + public UnresolvedDependenciesClient getUnresolvedDependencies() { + return this.unresolvedDependencies; + } + + /** The OperationsDiscoveriesClient object to access its operations. */ + private final OperationsDiscoveriesClient operationsDiscoveries; + + /** + * Gets the OperationsDiscoveriesClient object to access its operations. + * + * @return the OperationsDiscoveriesClient object. + */ + public OperationsDiscoveriesClient getOperationsDiscoveries() { + return this.operationsDiscoveries; + } + + /** + * Initializes an instance of ResourceMoverServiceApi client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Subscription ID. + * @param endpoint server parameter. + */ + ResourceMoverServiceApiImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-10-01-preview"; + this.moveCollections = new MoveCollectionsClientImpl(this); + this.moveResources = new MoveResourcesClientImpl(this); + this.unresolvedDependencies = new UnresolvedDependenciesClientImpl(this); + this.operationsDiscoveries = new OperationsDiscoveriesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesClientImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesClientImpl.java new file mode 100644 index 000000000000..9cccd58fba58 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesClientImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.fluent.UnresolvedDependenciesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UnresolvedDependenciesClient. */ +public final class UnresolvedDependenciesClientImpl implements UnresolvedDependenciesClient { + private final ClientLogger logger = new ClientLogger(UnresolvedDependenciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UnresolvedDependenciesService service; + + /** The service client containing this operation class. */ + private final ResourceMoverServiceApiImpl client; + + /** + * Initializes an instance of UnresolvedDependenciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UnresolvedDependenciesClientImpl(ResourceMoverServiceApiImpl client) { + this.service = + RestProxy + .create(UnresolvedDependenciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceMoverServiceApiUnresolvedDependencies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceMoverService") + private interface UnresolvedDependenciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate" + + "/moveCollections/{moveCollectionName}/unresolvedDependencies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("moveCollectionName") String moveCollectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String moveCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String moveCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (moveCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter moveCollectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + moveCollectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String moveCollectionName) { + return getWithResponseAsync(resourceGroupName, moveCollectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UnresolvedDependencyCollectionInner get(String resourceGroupName, String moveCollectionName) { + return getAsync(resourceGroupName, moveCollectionName).block(); + } + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String moveCollectionName, Context context) { + return getWithResponseAsync(resourceGroupName, moveCollectionName, context).block(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesImpl.java new file mode 100644 index 000000000000..f77b7fa97c5d --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependenciesImpl.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.resourcemover.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.UnresolvedDependenciesClient; +import com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependencies; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependencyCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UnresolvedDependenciesImpl implements UnresolvedDependencies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnresolvedDependenciesImpl.class); + + private final UnresolvedDependenciesClient innerClient; + + private final ResourceMoverManager serviceManager; + + public UnresolvedDependenciesImpl(UnresolvedDependenciesClient innerClient, ResourceMoverManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public UnresolvedDependencyCollection get(String resourceGroupName, String moveCollectionName) { + UnresolvedDependencyCollectionInner inner = this.serviceClient().get(resourceGroupName, moveCollectionName); + if (inner != null) { + return new UnresolvedDependencyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String moveCollectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, moveCollectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UnresolvedDependencyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private UnresolvedDependenciesClient serviceClient() { + return this.innerClient; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependencyCollectionImpl.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependencyCollectionImpl.java new file mode 100644 index 000000000000..f315ec577ffa --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/UnresolvedDependencyCollectionImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.resourcemanager.resourcemover.ResourceMoverManager; +import com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependency; +import com.azure.resourcemanager.resourcemover.models.UnresolvedDependencyCollection; +import java.util.Collections; +import java.util.List; + +public final class UnresolvedDependencyCollectionImpl implements UnresolvedDependencyCollection { + private UnresolvedDependencyCollectionInner innerObject; + + private final ResourceMoverManager serviceManager; + + UnresolvedDependencyCollectionImpl( + UnresolvedDependencyCollectionInner innerObject, ResourceMoverManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public UnresolvedDependencyCollectionInner innerModel() { + return this.innerObject; + } + + private ResourceMoverManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/Utils.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/Utils.java new file mode 100644 index 000000000000..05b20cc2c5cc --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/Utils.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.implementation; + +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/package-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/package-info.java new file mode 100644 index 000000000000..d4e044923f9a --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for ResourceMoverServiceApi. A first party Azure service orchestrating the + * move of Azure resources from one Azure region to another or between zones within a region. + */ +package com.azure.resourcemanager.resourcemover.implementation; diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AffectedMoveResource.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AffectedMoveResource.java new file mode 100644 index 000000000000..37c945a7d0be --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AffectedMoveResource.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RP custom operation error info. */ +@Immutable +public final class AffectedMoveResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AffectedMoveResource.class); + + /* + * The affected move resource id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The affected move resource source id. + */ + @JsonProperty(value = "sourceId", access = JsonProperty.Access.WRITE_ONLY) + private String sourceId; + + /* + * The affected move resources. + */ + @JsonProperty(value = "moveResources", access = JsonProperty.Access.WRITE_ONLY) + private List moveResources; + + /** + * Get the id property: The affected move resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the sourceId property: The affected move resource source id. + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Get the moveResources property: The affected move resources. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() != null) { + moveResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AutomaticResolutionProperties.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AutomaticResolutionProperties.java new file mode 100644 index 000000000000..a7a911ae7a1e --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AutomaticResolutionProperties.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.resourcemover.models; + +import 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 the properties for automatic resolution. */ +@Fluent +public final class AutomaticResolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutomaticResolutionProperties.class); + + /* + * Gets the MoveResource ARM ID of + * the dependent resource if the resolution type is Automatic. + */ + @JsonProperty(value = "moveResourceId") + private String moveResourceId; + + /** + * Get the moveResourceId property: Gets the MoveResource ARM ID of the dependent resource if the resolution type is + * Automatic. + * + * @return the moveResourceId value. + */ + public String moveResourceId() { + return this.moveResourceId; + } + + /** + * Set the moveResourceId property: Gets the MoveResource ARM ID of the dependent resource if the resolution type is + * Automatic. + * + * @param moveResourceId the moveResourceId value to set. + * @return the AutomaticResolutionProperties object itself. + */ + public AutomaticResolutionProperties withMoveResourceId(String moveResourceId) { + this.moveResourceId = moveResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AvailabilitySetResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AvailabilitySetResourceSettings.java new file mode 100644 index 000000000000..60b8b6b5a5c2 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AvailabilitySetResourceSettings.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.resourcemover.models; + +import 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; + +/** Gets or sets the availability set resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Compute/availabilitySets") +@Fluent +public final class AvailabilitySetResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilitySetResourceSettings.class); + + /* + * Gets or sets the target fault domain. + */ + @JsonProperty(value = "faultDomain") + private Integer faultDomain; + + /* + * Gets or sets the target update domain. + */ + @JsonProperty(value = "updateDomain") + private Integer updateDomain; + + /** + * Get the faultDomain property: Gets or sets the target fault domain. + * + * @return the faultDomain value. + */ + public Integer faultDomain() { + return this.faultDomain; + } + + /** + * Set the faultDomain property: Gets or sets the target fault domain. + * + * @param faultDomain the faultDomain value to set. + * @return the AvailabilitySetResourceSettings object itself. + */ + public AvailabilitySetResourceSettings withFaultDomain(Integer faultDomain) { + this.faultDomain = faultDomain; + return this; + } + + /** + * Get the updateDomain property: Gets or sets the target update domain. + * + * @return the updateDomain value. + */ + public Integer updateDomain() { + return this.updateDomain; + } + + /** + * Set the updateDomain property: Gets or sets the target update domain. + * + * @param updateDomain the updateDomain value to set. + * @return the AvailabilitySetResourceSettings object itself. + */ + public AvailabilitySetResourceSettings withUpdateDomain(Integer updateDomain) { + this.updateDomain = updateDomain; + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailabilitySetResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AzureResourceReference.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AzureResourceReference.java new file mode 100644 index 000000000000..a21339eb9bd6 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/AzureResourceReference.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.resourcemover.models; + +import 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 reference to an Azure resource. */ +@Fluent +public class AzureResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceReference.class); + + /* + * Gets the ARM resource ID of the tracked resource being referenced. + */ + @JsonProperty(value = "sourceArmResourceId", required = true) + private String sourceArmResourceId; + + /** + * Get the sourceArmResourceId property: Gets the ARM resource ID of the tracked resource being referenced. + * + * @return the sourceArmResourceId value. + */ + public String sourceArmResourceId() { + return this.sourceArmResourceId; + } + + /** + * Set the sourceArmResourceId property: Gets the ARM resource ID of the tracked resource being referenced. + * + * @param sourceArmResourceId the sourceArmResourceId value to set. + * @return the AzureResourceReference object itself. + */ + public AzureResourceReference withSourceArmResourceId(String sourceArmResourceId) { + this.sourceArmResourceId = sourceArmResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceArmResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceArmResourceId in model AzureResourceReference")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/BulkRemoveRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/BulkRemoveRequest.java new file mode 100644 index 000000000000..ebffe991a994 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/BulkRemoveRequest.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.resourcemover.models; + +import 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; + +/** Defines the request body for bulk remove of move resources operation. */ +@Fluent +public final class BulkRemoveRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BulkRemoveRequest.class); + + /* + * Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + */ + @JsonProperty(value = "validateOnly") + private Boolean validateOnly; + + /* + * Gets or sets the list of resource Id's, by default it accepts move + * resource id's unless the input type is switched via + * moveResourceInputType property. + */ + @JsonProperty(value = "moveResources") + private List moveResources; + + /* + * Defines the move resource input type. + */ + @JsonProperty(value = "moveResourceInputType") + private MoveResourceInputType moveResourceInputType; + + /** + * Get the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @return the validateOnly value. + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @param validateOnly the validateOnly value to set. + * @return the BulkRemoveRequest object itself. + */ + public BulkRemoveRequest withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Set the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @param moveResources the moveResources value to set. + * @return the BulkRemoveRequest object itself. + */ + public BulkRemoveRequest withMoveResources(List moveResources) { + this.moveResources = moveResources; + return this; + } + + /** + * Get the moveResourceInputType property: Defines the move resource input type. + * + * @return the moveResourceInputType value. + */ + public MoveResourceInputType moveResourceInputType() { + return this.moveResourceInputType; + } + + /** + * Set the moveResourceInputType property: Defines the move resource input type. + * + * @param moveResourceInputType the moveResourceInputType value to set. + * @return the BulkRemoveRequest object itself. + */ + public BulkRemoveRequest withMoveResourceInputType(MoveResourceInputType moveResourceInputType) { + this.moveResourceInputType = moveResourceInputType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/CommitRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/CommitRequest.java new file mode 100644 index 000000000000..52d9c9b5d413 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/CommitRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the request body for commit operation. */ +@Fluent +public final class CommitRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommitRequest.class); + + /* + * Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + */ + @JsonProperty(value = "validateOnly") + private Boolean validateOnly; + + /* + * Gets or sets the list of resource Id's, by default it accepts move + * resource id's unless the input type is switched via + * moveResourceInputType property. + */ + @JsonProperty(value = "moveResources", required = true) + private List moveResources; + + /* + * Defines the move resource input type. + */ + @JsonProperty(value = "moveResourceInputType") + private MoveResourceInputType moveResourceInputType; + + /** + * Get the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @return the validateOnly value. + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @param validateOnly the validateOnly value to set. + * @return the CommitRequest object itself. + */ + public CommitRequest withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Set the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @param moveResources the moveResources value to set. + * @return the CommitRequest object itself. + */ + public CommitRequest withMoveResources(List moveResources) { + this.moveResources = moveResources; + return this; + } + + /** + * Get the moveResourceInputType property: Defines the move resource input type. + * + * @return the moveResourceInputType value. + */ + public MoveResourceInputType moveResourceInputType() { + return this.moveResourceInputType; + } + + /** + * Set the moveResourceInputType property: Defines the move resource input type. + * + * @param moveResourceInputType the moveResourceInputType value to set. + * @return the CommitRequest object itself. + */ + public CommitRequest withMoveResourceInputType(MoveResourceInputType moveResourceInputType) { + this.moveResourceInputType = moveResourceInputType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property moveResources in model CommitRequest")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DependencyType.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DependencyType.java new file mode 100644 index 000000000000..3906e2eb49eb --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DependencyType.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DependencyType. */ +public final class DependencyType extends ExpandableStringEnum { + /** Static value RequiredForPrepare for DependencyType. */ + public static final DependencyType REQUIRED_FOR_PREPARE = fromString("RequiredForPrepare"); + + /** Static value RequiredForMove for DependencyType. */ + public static final DependencyType REQUIRED_FOR_MOVE = fromString("RequiredForMove"); + + /** + * Creates or finds a DependencyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DependencyType. + */ + @JsonCreator + public static DependencyType fromString(String name) { + return fromString(name, DependencyType.class); + } + + /** @return known DependencyType values. */ + public static Collection values() { + return values(DependencyType.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DiscardRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DiscardRequest.java new file mode 100644 index 000000000000..70fc033156cb --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/DiscardRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the request body for discard operation. */ +@Fluent +public final class DiscardRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiscardRequest.class); + + /* + * Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + */ + @JsonProperty(value = "validateOnly") + private Boolean validateOnly; + + /* + * Gets or sets the list of resource Id's, by default it accepts move + * resource id's unless the input type is switched via + * moveResourceInputType property. + */ + @JsonProperty(value = "moveResources", required = true) + private List moveResources; + + /* + * Defines the move resource input type. + */ + @JsonProperty(value = "moveResourceInputType") + private MoveResourceInputType moveResourceInputType; + + /** + * Get the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @return the validateOnly value. + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @param validateOnly the validateOnly value to set. + * @return the DiscardRequest object itself. + */ + public DiscardRequest withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Set the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @param moveResources the moveResources value to set. + * @return the DiscardRequest object itself. + */ + public DiscardRequest withMoveResources(List moveResources) { + this.moveResources = moveResources; + return this; + } + + /** + * Get the moveResourceInputType property: Defines the move resource input type. + * + * @return the moveResourceInputType value. + */ + public MoveResourceInputType moveResourceInputType() { + return this.moveResourceInputType; + } + + /** + * Set the moveResourceInputType property: Defines the move resource input type. + * + * @param moveResourceInputType the moveResourceInputType value to set. + * @return the DiscardRequest object itself. + */ + public DiscardRequest withMoveResourceInputType(MoveResourceInputType moveResourceInputType) { + this.moveResourceInputType = moveResourceInputType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property moveResources in model DiscardRequest")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Display.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Display.java new file mode 100644 index 000000000000..1a8afccbdd2c --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Display.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this particular operation / action. These value will be used by + * several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) + * audit history / records for management operations. + */ +@Fluent +public final class Display { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); + + /* + * Gets or sets the provider. + * The localized friendly form of the resource provider name – it is + * expected to also + * include the publisher/company responsible. + * It should use Title Casing and begin with "Microsoft" for 1st party + * services. + * e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Gets or sets the resource. + * The localized friendly form of the resource related to this + * action/operation – it + * should match the public documentation for the resource provider. + * It should use Title Casing. + * This value should be unique for a particular URL type (e.g. nested types + * should *not* + * reuse their parent’s display.resource field) + * e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual + * Machine VM Sizes" + * or "Scheduler Jobs". + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Gets or sets the operation. + * The localized friendly name for the operation, as it should be shown to + * the user. + * It should be concise (to fit in drop downs) but clear (i.e. + * self-documenting). + * It should use Title Casing. + * Prescriptive guidance: Read Create or Update Delete 'ActionName'. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Gets or sets the description. + * The localized friendly description for the operation, as it should be + * shown to the + * user. + * It should be thorough, yet concise – it will be used in tool tips and + * detailed views. + * Prescriptive guidance for namespace: + * Read any 'display.provider' resource + * Create or Update any 'display.provider' resource + * Delete any 'display.provider' resource + * Perform any other action on any 'display.provider' resource + * Prescriptive guidance for namespace: + * Read any 'display.resource' Create or Update any 'display.resource' + * Delete any + * 'display.resource' 'ActionName' any 'display.resources'. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Gets or sets the provider. The localized friendly form of the resource provider name – + * it is expected to also include the publisher/company responsible. It should use Title Casing and begin with + * "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Gets or sets the provider. The localized friendly form of the resource provider name – + * it is expected to also include the publisher/company responsible. It should use Title Casing and begin with + * "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + * + * @param provider the provider value to set. + * @return the Display object itself. + */ + public Display withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Gets or sets the resource. The localized friendly form of the resource related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent’s display.resource field) e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Gets or sets the resource. The localized friendly form of the resource related to this + * action/operation – it should match the public documentation for the resource provider. It should use Title + * Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their + * parent’s display.resource field) e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM + * Sizes" or "Scheduler Jobs". + * + * @param resource the resource value to set. + * @return the Display object itself. + */ + public Display withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Gets or sets the operation. The localized friendly name for the operation, as it + * should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It + * should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Gets or sets the operation. The localized friendly name for the operation, as it + * should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It + * should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. + * + * @param operation the operation value to set. + * @return the Display object itself. + */ + public Display withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Gets or sets the description. The localized friendly description for the operation, + * as it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed + * views. Prescriptive guidance for namespace: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespace: Read any 'display.resource' Create or Update any + * 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets the description. The localized friendly description for the operation, + * as it should be shown to the user. It should be thorough, yet concise – it will be used in tool tips and detailed + * views. Prescriptive guidance for namespace: Read any 'display.provider' resource Create or Update any + * 'display.provider' resource Delete any 'display.provider' resource Perform any other action on any + * 'display.provider' resource Prescriptive guidance for namespace: Read any 'display.resource' Create or Update any + * 'display.resource' Delete any 'display.resource' 'ActionName' any 'display.resources'. + * + * @param description the description value to set. + * @return the Display object itself. + */ + public Display 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Identity.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Identity.java new file mode 100644 index 000000000000..7a5a22ca062b --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Identity.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.resourcemover.models; + +import 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 the MSI properties of the Move Collection. */ +@Fluent +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); + + /* + * The type of identity used for the resource mover service. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * Gets or sets the principal id. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * Gets or sets the tenant id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get the type property: The type of identity used for the resource mover service. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the resource mover service. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: Gets or sets the principal id. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Gets or sets the principal id. + * + * @param principalId the principalId value to set. + * @return the Identity object itself. + */ + public Identity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: Gets or sets the tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Gets or sets the tenant id. + * + * @param tenantId the tenantId value to set. + * @return the Identity object itself. + */ + public Identity withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobName.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobName.java new file mode 100644 index 000000000000..22cb1d429e30 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobName.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobName. */ +public final class JobName extends ExpandableStringEnum { + /** Static value InitialSync for JobName. */ + public static final JobName INITIAL_SYNC = fromString("InitialSync"); + + /** + * Creates or finds a JobName from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobName. + */ + @JsonCreator + public static JobName fromString(String name) { + return fromString(name, JobName.class); + } + + /** @return known JobName values. */ + public static Collection values() { + return values(JobName.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobStatus.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobStatus.java new file mode 100644 index 000000000000..5a794f854388 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/JobStatus.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.resourcemover.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; + +/** Defines the job status. */ +@Immutable +public final class JobStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobStatus.class); + + /* + * Defines the job name. + */ + @JsonProperty(value = "jobName", access = JsonProperty.Access.WRITE_ONLY) + private JobName jobName; + + /* + * Gets or sets the monitoring job percentage. + */ + @JsonProperty(value = "jobProgress", access = JsonProperty.Access.WRITE_ONLY) + private String jobProgress; + + /** + * Get the jobName property: Defines the job name. + * + * @return the jobName value. + */ + public JobName jobName() { + return this.jobName; + } + + /** + * Get the jobProgress property: Gets or sets the monitoring job percentage. + * + * @return the jobProgress value. + */ + public String jobProgress() { + return this.jobProgress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBBackendAddressPoolResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBBackendAddressPoolResourceSettings.java new file mode 100644 index 000000000000..7eaf013c3c66 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBBackendAddressPoolResourceSettings.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.resourcemover.models; + +import 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 load balancer backend address pool properties. */ +@Fluent +public final class LBBackendAddressPoolResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LBBackendAddressPoolResourceSettings.class); + + /* + * Gets or sets the backend address pool name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Gets or sets the backend address pool name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the backend address pool name. + * + * @param name the name value to set. + * @return the LBBackendAddressPoolResourceSettings object itself. + */ + public LBBackendAddressPoolResourceSettings 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBFrontendIpConfigurationResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBFrontendIpConfigurationResourceSettings.java new file mode 100644 index 000000000000..93c7f93a0879 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LBFrontendIpConfigurationResourceSettings.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.resourcemover.models; + +import 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 load balancer frontend IP configuration properties. */ +@Fluent +public final class LBFrontendIpConfigurationResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LBFrontendIpConfigurationResourceSettings.class); + + /* + * Gets or sets the frontend IP configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the IP address of the Load Balancer.This is only specified + * if a specific + * private IP address shall be allocated from the subnet specified in + * subnetRef. + */ + @JsonProperty(value = "privateIpAddress") + private String privateIpAddress; + + /* + * Gets or sets PrivateIP allocation method (Static/Dynamic). + */ + @JsonProperty(value = "privateIpAllocationMethod") + private String privateIpAllocationMethod; + + /* + * Defines reference to a proxy resource. + */ + @JsonProperty(value = "subnet") + private ProxyResourceReference subnet; + + /* + * Gets or sets the csv list of zones. + */ + @JsonProperty(value = "zones") + private String zones; + + /** + * Get the name property: Gets or sets the frontend IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the frontend IP configuration name. + * + * @param name the name value to set. + * @return the LBFrontendIpConfigurationResourceSettings object itself. + */ + public LBFrontendIpConfigurationResourceSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get the privateIpAddress property: Gets or sets the IP address of the Load Balancer.This is only specified if a + * specific private IP address shall be allocated from the subnet specified in subnetRef. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Gets or sets the IP address of the Load Balancer.This is only specified if a + * specific private IP address shall be allocated from the subnet specified in subnetRef. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LBFrontendIpConfigurationResourceSettings object itself. + */ + public LBFrontendIpConfigurationResourceSettings withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: Gets or sets PrivateIP allocation method (Static/Dynamic). + * + * @return the privateIpAllocationMethod value. + */ + public String privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: Gets or sets PrivateIP allocation method (Static/Dynamic). + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the LBFrontendIpConfigurationResourceSettings object itself. + */ + public LBFrontendIpConfigurationResourceSettings withPrivateIpAllocationMethod(String privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: Defines reference to a proxy resource. + * + * @return the subnet value. + */ + public ProxyResourceReference subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Defines reference to a proxy resource. + * + * @param subnet the subnet value to set. + * @return the LBFrontendIpConfigurationResourceSettings object itself. + */ + public LBFrontendIpConfigurationResourceSettings withSubnet(ProxyResourceReference subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the zones property: Gets or sets the csv list of zones. + * + * @return the zones value. + */ + public String zones() { + return this.zones; + } + + /** + * Set the zones property: Gets or sets the csv list of zones. + * + * @param zones the zones value to set. + * @return the LBFrontendIpConfigurationResourceSettings object itself. + */ + public LBFrontendIpConfigurationResourceSettings withZones(String zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerBackendAddressPoolReference.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerBackendAddressPoolReference.java new file mode 100644 index 000000000000..415319088c69 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerBackendAddressPoolReference.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines reference to load balancer backend address pools. */ +@Immutable +public final class LoadBalancerBackendAddressPoolReference extends ProxyResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolReference.class); + + /** {@inheritDoc} */ + @Override + public LoadBalancerBackendAddressPoolReference withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancerBackendAddressPoolReference withSourceArmResourceId(String sourceArmResourceId) { + super.withSourceArmResourceId(sourceArmResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerNatRuleReference.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerNatRuleReference.java new file mode 100644 index 000000000000..41abe1082d79 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerNatRuleReference.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines reference to load balancer NAT rules. */ +@Immutable +public final class LoadBalancerNatRuleReference extends ProxyResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerNatRuleReference.class); + + /** {@inheritDoc} */ + @Override + public LoadBalancerNatRuleReference withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancerNatRuleReference withSourceArmResourceId(String sourceArmResourceId) { + super.withSourceArmResourceId(sourceArmResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerResourceSettings.java new file mode 100644 index 000000000000..9458edda2054 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/LoadBalancerResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines the load balancer resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Network/loadBalancers") +@Fluent +public final class LoadBalancerResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerResourceSettings.class); + + /* + * Gets or sets load balancer sku (Basic/Standard). + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Gets or sets the frontend IP configurations of the load balancer. + */ + @JsonProperty(value = "frontendIPConfigurations") + private List frontendIpConfigurations; + + /* + * Gets or sets the backend address pools of the load balancer. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /* + * Gets or sets the csv list of zones common for all frontend IP + * configurations. Note this is given + * precedence only if frontend IP configurations settings are not present. + */ + @JsonProperty(value = "zones") + private String zones; + + /** + * Get the sku property: Gets or sets load balancer sku (Basic/Standard). + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: Gets or sets load balancer sku (Basic/Standard). + * + * @param sku the sku value to set. + * @return the LoadBalancerResourceSettings object itself. + */ + public LoadBalancerResourceSettings withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the frontendIpConfigurations property: Gets or sets the frontend IP configurations of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: Gets or sets the frontend IP configurations of the load balancer. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerResourceSettings object itself. + */ + public LoadBalancerResourceSettings withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Get the backendAddressPools property: Gets or sets the backend address pools of the load balancer. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: Gets or sets the backend address pools of the load balancer. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the LoadBalancerResourceSettings object itself. + */ + public LoadBalancerResourceSettings withBackendAddressPools( + List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Get the zones property: Gets or sets the csv list of zones common for all frontend IP configurations. Note this + * is given precedence only if frontend IP configurations settings are not present. + * + * @return the zones value. + */ + public String zones() { + return this.zones; + } + + /** + * Set the zones property: Gets or sets the csv list of zones common for all frontend IP configurations. Note this + * is given precedence only if frontend IP configurations settings are not present. + * + * @param zones the zones value to set. + * @return the LoadBalancerResourceSettings object itself. + */ + public LoadBalancerResourceSettings withZones(String zones) { + this.zones = zones; + return this; + } + + /** {@inheritDoc} */ + @Override + public LoadBalancerResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (frontendIpConfigurations() != null) { + frontendIpConfigurations().forEach(e -> e.validate()); + } + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ManualResolutionProperties.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ManualResolutionProperties.java new file mode 100644 index 000000000000..e766e8531ab0 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ManualResolutionProperties.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.resourcemover.models; + +import 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 the properties for manual resolution. */ +@Fluent +public final class ManualResolutionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManualResolutionProperties.class); + + /* + * Gets or sets the target resource ARM ID of the dependent resource if the + * resource type is Manual. + */ + @JsonProperty(value = "targetId") + private String targetId; + + /** + * Get the targetId property: Gets or sets the target resource ARM ID of the dependent resource if the resource type + * is Manual. + * + * @return the targetId value. + */ + public String targetId() { + return this.targetId; + } + + /** + * Set the targetId property: Gets or sets the target resource ARM ID of the dependent resource if the resource type + * is Manual. + * + * @param targetId the targetId value to set. + * @return the ManualResolutionProperties object itself. + */ + public ManualResolutionProperties withTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollection.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollection.java new file mode 100644 index 000000000000..40407ffe4603 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollection.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveCollectionInner; +import java.util.Map; + +/** An immutable client-side representation of MoveCollection. */ +public interface MoveCollection { + /** + * 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: The etag of the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the identity property: Defines the MSI properties of the Move Collection. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the properties property: Defines the move collection properties. + * + * @return the properties value. + */ + MoveCollectionProperties properties(); + + /** + * 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.resourcemover.fluent.models.MoveCollectionInner object. + * + * @return the inner object. + */ + MoveCollectionInner innerModel(); + + /** The entirety of the MoveCollection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The MoveCollection definition stages. */ + interface DefinitionStages { + /** The first stage of the MoveCollection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the MoveCollection 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 MoveCollection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The Resource Group Name. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the MoveCollection 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.WithIdentity, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MoveCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MoveCollection create(Context context); + } + /** The stage of the MoveCollection 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 MoveCollection definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Defines the MSI properties of the Move Collection.. + * + * @param identity Defines the MSI properties of the Move Collection. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the MoveCollection definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Defines the move collection properties.. + * + * @param properties Defines the move collection properties. + * @return the next definition stage. + */ + WithCreate withProperties(MoveCollectionProperties properties); + } + } + /** + * Begins update for the MoveCollection resource. + * + * @return the stage of resource update. + */ + MoveCollection.Update update(); + + /** The template for MoveCollection update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MoveCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MoveCollection apply(Context context); + } + /** The MoveCollection update stages. */ + interface UpdateStages { + /** The stage of the MoveCollection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the MoveCollection update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Defines the MSI properties of the Move Collection.. + * + * @param identity Defines the MSI properties of the Move Collection. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MoveCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MoveCollection refresh(Context context); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus prepare(PrepareRequest body); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus prepare(); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + OperationStatus prepare(PrepareRequest body, Context context); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus initiateMove(ResourceMoveRequest body); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus initiateMove(); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + OperationStatus initiateMove(ResourceMoveRequest body, Context context); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus commit(CommitRequest body); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus commit(); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param body Defines the request body for commit 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 operation status REST resource. + */ + OperationStatus commit(CommitRequest body, Context context); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus discard(DiscardRequest body); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus discard(); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param body Defines the request body for discard 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 operation status REST resource. + */ + OperationStatus discard(DiscardRequest body, Context context); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus resolveDependencies(); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus resolveDependencies(Context context); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus bulkRemove(BulkRemoveRequest body); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus bulkRemove(); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + OperationStatus bulkRemove(BulkRemoveRequest body, Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionProperties.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionProperties.java new file mode 100644 index 000000000000..3783e1df0995 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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 the move collection properties. */ +@Fluent +public final class MoveCollectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveCollectionProperties.class); + + /* + * Gets or sets the source region. + */ + @JsonProperty(value = "sourceRegion", required = true) + private String sourceRegion; + + /* + * Gets or sets the target region. + */ + @JsonProperty(value = "targetRegion", required = true) + private String targetRegion; + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Defines the move collection errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private MoveResourceError errors; + + /** + * Get the sourceRegion property: Gets or sets the source region. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: Gets or sets the source region. + * + * @param sourceRegion the sourceRegion value to set. + * @return the MoveCollectionProperties object itself. + */ + public MoveCollectionProperties withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the targetRegion property: Gets or sets the target region. + * + * @return the targetRegion value. + */ + public String targetRegion() { + return this.targetRegion; + } + + /** + * Set the targetRegion property: Gets or sets the target region. + * + * @param targetRegion the targetRegion value to set. + * @return the MoveCollectionProperties object itself. + */ + public MoveCollectionProperties withTargetRegion(String targetRegion) { + this.targetRegion = targetRegion; + return this; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the move collection errors. + * + * @return the errors value. + */ + public MoveResourceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceRegion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceRegion in model MoveCollectionProperties")); + } + if (targetRegion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetRegion in model MoveCollectionProperties")); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionPropertiesErrors.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionPropertiesErrors.java new file mode 100644 index 000000000000..2b5a5fbda029 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionPropertiesErrors.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines the move collection errors. */ +@Immutable +public final class MoveCollectionPropertiesErrors extends MoveResourceError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveCollectionPropertiesErrors.class); + + /** {@inheritDoc} */ + @Override + public MoveCollectionPropertiesErrors withProperties(MoveResourceErrorBody properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionResultList.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionResultList.java new file mode 100644 index 000000000000..97e7599f3d59 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollectionResultList.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.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveCollectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of move collections. */ +@Fluent +public final class MoveCollectionResultList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveCollectionResultList.class); + + /* + * Gets the list of move collections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets the list of move collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of move collections. + * + * @param value the value value to set. + * @return the MoveCollectionResultList object itself. + */ + public MoveCollectionResultList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the MoveCollectionResultList object itself. + */ + public MoveCollectionResultList 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollections.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollections.java new file mode 100644 index 000000000000..55e28a418407 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveCollections.java @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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 MoveCollections. */ +public interface MoveCollections { + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus deleteByResourceGroup(String resourceGroupName, String moveCollectionName); + + /** + * Deletes a move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus delete(String resourceGroupName, String moveCollectionName, Context context); + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + MoveCollection getByResourceGroup(String resourceGroupName, String moveCollectionName); + + /** + * Gets the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String moveCollectionName, Context context); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus prepare(String resourceGroupName, String moveCollectionName, PrepareRequest body); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus prepare(String resourceGroupName, String moveCollectionName); + + /** + * Initiates prepare for the set of resources included in the request body. The prepare operation is on the + * moveResources that are in the moveState 'PreparePending' or 'PrepareFailed', on a successful completion the + * moveResource moveState do a transition to MovePending. To aid the user to prerequisite the operation the client + * can call operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for initiate prepare 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 operation status REST resource. + */ + OperationStatus prepare(String resourceGroupName, String moveCollectionName, PrepareRequest body, Context context); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus initiateMove(String resourceGroupName, String moveCollectionName, ResourceMoveRequest body); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus initiateMove(String resourceGroupName, String moveCollectionName); + + /** + * Moves the set of resources included in the request body. The move operation is triggered after the moveResources + * are in the moveState 'MovePending' or 'MoveFailed', on a successful completion the moveResource moveState do a + * transition to CommitPending. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for resource move 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 operation status REST resource. + */ + OperationStatus initiateMove( + String resourceGroupName, String moveCollectionName, ResourceMoveRequest body, Context context); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus commit(String resourceGroupName, String moveCollectionName, CommitRequest body); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus commit(String resourceGroupName, String moveCollectionName); + + /** + * Commits the set of resources included in the request body. The commit operation is triggered on the moveResources + * in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a + * transition to Committed. To aid the user to prerequisite the operation the client can call operation with + * validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for commit 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 operation status REST resource. + */ + OperationStatus commit(String resourceGroupName, String moveCollectionName, CommitRequest body, Context context); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus discard(String resourceGroupName, String moveCollectionName, DiscardRequest body); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus discard(String resourceGroupName, String moveCollectionName); + + /** + * Discards the set of resources included in the request body. The discard operation is triggered on the + * moveResources in the moveState 'CommitPending' or 'DiscardFailed', on a successful completion the moveResource + * moveState do a transition to MovePending. To aid the user to prerequisite the operation the client can call + * operation with validateOnly property set to true. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param body Defines the request body for discard 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 operation status REST resource. + */ + OperationStatus discard(String resourceGroupName, String moveCollectionName, DiscardRequest body, Context context); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus resolveDependencies(String resourceGroupName, String moveCollectionName); + + /** + * Computes, resolves and validate the dependencies of the moveResources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus resolveDependencies(String resourceGroupName, String moveCollectionName, Context context); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus bulkRemove(String resourceGroupName, String moveCollectionName, BulkRemoveRequest body); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus bulkRemove(String resourceGroupName, String moveCollectionName); + + /** + * Removes the set of move resources included in the request body from move collection. The orchestration is done by + * service. To aid the user to prerequisite the operation the client can call operation with validateOnly property + * set to true. + * + * @param resourceGroupName The resourceGroupName parameter. + * @param moveCollectionName The moveCollectionName parameter. + * @param body Defines the request body for bulk remove of move resources 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 operation status REST resource. + */ + OperationStatus bulkRemove( + String resourceGroupName, String moveCollectionName, BulkRemoveRequest body, Context context); + + /** + * Get all the Move Collections in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + PagedIterable list(); + + /** + * Get all the Move Collections in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the subscription. + */ + PagedIterable list(Context context); + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the Move Collections in the resource group. + * + * @param resourceGroupName The Resource Group Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Move Collections in the resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the move collection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the move collection. + */ + MoveCollection getById(String id); + + /** + * Gets the move collection. + * + * @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 move collection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a move collection. + * + * @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 operation status REST resource. + */ + OperationStatus deleteById(String id); + + /** + * Deletes a move collection. + * + * @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 operation status REST resource. + */ + OperationStatus deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MoveCollection resource. + * + * @param name resource name. + * @return the first stage of the new MoveCollection definition. + */ + MoveCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveErrorInfo.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveErrorInfo.java new file mode 100644 index 000000000000..342485cda39f --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveErrorInfo.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The move custom error info. */ +@Immutable +public final class MoveErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveErrorInfo.class); + + /* + * The affected move resources. + */ + @JsonProperty(value = "moveResources", access = JsonProperty.Access.WRITE_ONLY) + private List moveResources; + + /** + * Get the moveResources property: The affected move resources. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() != null) { + moveResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResource.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResource.java new file mode 100644 index 000000000000..af8e32d36783 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResource.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.resourcemover.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner; + +/** An immutable client-side representation of MoveResource. */ +public interface MoveResource { + /** + * 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 properties property: Defines the move resource properties. + * + * @return the properties value. + */ + MoveResourceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner object. + * + * @return the inner object. + */ + MoveResourceInner innerModel(); + + /** The entirety of the MoveResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The MoveResource definition stages. */ + interface DefinitionStages { + /** The first stage of the MoveResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MoveResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, moveCollectionName. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @return the next definition stage. + */ + WithCreate withExistingMoveCollection(String resourceGroupName, String moveCollectionName); + } + /** + * The stage of the MoveResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MoveResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MoveResource create(Context context); + } + /** The stage of the MoveResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Defines the move resource properties.. + * + * @param properties Defines the move resource properties. + * @return the next definition stage. + */ + WithCreate withProperties(MoveResourceProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MoveResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MoveResource refresh(Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceCollection.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceCollection.java new file mode 100644 index 000000000000..8ae3c23fa6ae --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceCollection.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.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourcemover.fluent.models.MoveResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of move resources. */ +@Fluent +public final class MoveResourceCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceCollection.class); + + /* + * Gets the list of move resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Gets or sets the list of summary items and the field on which summary is + * done. + */ + @JsonProperty(value = "summaryCollection") + private SummaryCollection summaryCollection; + + /* + * Gets the total count. + */ + @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalCount; + + /** + * Get the value property: Gets the list of move resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of move resources. + * + * @param value the value value to set. + * @return the MoveResourceCollection object itself. + */ + public MoveResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the MoveResourceCollection object itself. + */ + public MoveResourceCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the summaryCollection property: Gets or sets the list of summary items and the field on which summary is + * done. + * + * @return the summaryCollection value. + */ + public SummaryCollection summaryCollection() { + return this.summaryCollection; + } + + /** + * Set the summaryCollection property: Gets or sets the list of summary items and the field on which summary is + * done. + * + * @param summaryCollection the summaryCollection value to set. + * @return the MoveResourceCollection object itself. + */ + public MoveResourceCollection withSummaryCollection(SummaryCollection summaryCollection) { + this.summaryCollection = summaryCollection; + return this; + } + + /** + * Get the totalCount property: Gets the total count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + if (summaryCollection() != null) { + summaryCollection().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependency.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependency.java new file mode 100644 index 000000000000..8847b88b4c5f --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependency.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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 the dependency of the move resource. */ +@Fluent +public final class MoveResourceDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceDependency.class); + + /* + * Gets the source ARM ID of the dependent resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Gets the dependency resolution status. + */ + @JsonProperty(value = "resolutionStatus") + private String resolutionStatus; + + /* + * Defines the resolution type. + */ + @JsonProperty(value = "resolutionType") + private ResolutionType resolutionType; + + /* + * Defines the dependency type. + */ + @JsonProperty(value = "dependencyType") + private DependencyType dependencyType; + + /* + * Defines the properties for manual resolution. + */ + @JsonProperty(value = "manualResolution") + private ManualResolutionProperties manualResolution; + + /* + * Defines the properties for automatic resolution. + */ + @JsonProperty(value = "automaticResolution") + private AutomaticResolutionProperties automaticResolution; + + /* + * Gets or sets a value indicating whether the dependency is optional. + */ + @JsonProperty(value = "isOptional") + private String isOptional; + + /** + * Get the id property: Gets the source ARM ID of the dependent resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets the source ARM ID of the dependent resource. + * + * @param id the id value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resolutionStatus property: Gets the dependency resolution status. + * + * @return the resolutionStatus value. + */ + public String resolutionStatus() { + return this.resolutionStatus; + } + + /** + * Set the resolutionStatus property: Gets the dependency resolution status. + * + * @param resolutionStatus the resolutionStatus value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withResolutionStatus(String resolutionStatus) { + this.resolutionStatus = resolutionStatus; + return this; + } + + /** + * Get the resolutionType property: Defines the resolution type. + * + * @return the resolutionType value. + */ + public ResolutionType resolutionType() { + return this.resolutionType; + } + + /** + * Set the resolutionType property: Defines the resolution type. + * + * @param resolutionType the resolutionType value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withResolutionType(ResolutionType resolutionType) { + this.resolutionType = resolutionType; + return this; + } + + /** + * Get the dependencyType property: Defines the dependency type. + * + * @return the dependencyType value. + */ + public DependencyType dependencyType() { + return this.dependencyType; + } + + /** + * Set the dependencyType property: Defines the dependency type. + * + * @param dependencyType the dependencyType value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withDependencyType(DependencyType dependencyType) { + this.dependencyType = dependencyType; + return this; + } + + /** + * Get the manualResolution property: Defines the properties for manual resolution. + * + * @return the manualResolution value. + */ + public ManualResolutionProperties manualResolution() { + return this.manualResolution; + } + + /** + * Set the manualResolution property: Defines the properties for manual resolution. + * + * @param manualResolution the manualResolution value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withManualResolution(ManualResolutionProperties manualResolution) { + this.manualResolution = manualResolution; + return this; + } + + /** + * Get the automaticResolution property: Defines the properties for automatic resolution. + * + * @return the automaticResolution value. + */ + public AutomaticResolutionProperties automaticResolution() { + return this.automaticResolution; + } + + /** + * Set the automaticResolution property: Defines the properties for automatic resolution. + * + * @param automaticResolution the automaticResolution value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withAutomaticResolution(AutomaticResolutionProperties automaticResolution) { + this.automaticResolution = automaticResolution; + return this; + } + + /** + * Get the isOptional property: Gets or sets a value indicating whether the dependency is optional. + * + * @return the isOptional value. + */ + public String isOptional() { + return this.isOptional; + } + + /** + * Set the isOptional property: Gets or sets a value indicating whether the dependency is optional. + * + * @param isOptional the isOptional value to set. + * @return the MoveResourceDependency object itself. + */ + public MoveResourceDependency withIsOptional(String isOptional) { + this.isOptional = isOptional; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (manualResolution() != null) { + manualResolution().validate(); + } + if (automaticResolution() != null) { + automaticResolution().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependencyOverride.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependencyOverride.java new file mode 100644 index 000000000000..ee4791c4592d --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceDependencyOverride.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.resourcemover.models; + +import 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 the dependency override of the move resource. */ +@Fluent +public final class MoveResourceDependencyOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceDependencyOverride.class); + + /* + * Gets or sets the ARM ID of the dependent resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Gets or sets the resource ARM id of either the MoveResource or the + * resource ARM ID of + * the dependent resource. + */ + @JsonProperty(value = "targetId") + private String targetId; + + /** + * Get the id property: Gets or sets the ARM ID of the dependent resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets or sets the ARM ID of the dependent resource. + * + * @param id the id value to set. + * @return the MoveResourceDependencyOverride object itself. + */ + public MoveResourceDependencyOverride withId(String id) { + this.id = id; + return this; + } + + /** + * Get the targetId property: Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of + * the dependent resource. + * + * @return the targetId value. + */ + public String targetId() { + return this.targetId; + } + + /** + * Set the targetId property: Gets or sets the resource ARM id of either the MoveResource or the resource ARM ID of + * the dependent resource. + * + * @param targetId the targetId value to set. + * @return the MoveResourceDependencyOverride object itself. + */ + public MoveResourceDependencyOverride withTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceError.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceError.java new file mode 100644 index 000000000000..106f59de8635 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceError.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.resourcemover.models; + +import 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 error response from the azure resource mover service. */ +@Fluent +public class MoveResourceError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceError.class); + + /* + * The move resource error body. + */ + @JsonProperty(value = "properties") + private MoveResourceErrorBody properties; + + /** + * Get the properties property: The move resource error body. + * + * @return the properties value. + */ + public MoveResourceErrorBody properties() { + return this.properties; + } + + /** + * Set the properties property: The move resource error body. + * + * @param properties the properties value to set. + * @return the MoveResourceError object itself. + */ + public MoveResourceError withProperties(MoveResourceErrorBody 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceErrorBody.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceErrorBody.java new file mode 100644 index 000000000000..298259f72342 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceErrorBody.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.resourcemover.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; + +/** An error response from the Azure Migrate service. */ +@Immutable +public final class MoveResourceErrorBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceErrorBody.class); + + /* + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The target of the particular error. For example, the name of the + * property in error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * A list of additional details about the error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get the code property: An identifier for the error. Codes are invariant and are intended to be consumed + * programmatically. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: A message describing the error, intended to be suitable for display in a user + * interface. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: The target of the particular error. For example, the name of the property in error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: A list of additional details about the error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceFilterProperties.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceFilterProperties.java new file mode 100644 index 000000000000..c8b82acfd236 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceFilterProperties.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.resourcemover.models; + +import 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 MoveResourceFilterProperties model. */ +@Fluent +public final class MoveResourceFilterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceFilterProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the MoveResourceFilterProperties object itself. + */ + public MoveResourceFilterProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceInputType.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceInputType.java new file mode 100644 index 000000000000..ef16cdd4f2ee --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceInputType.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MoveResourceInputType. */ +public final class MoveResourceInputType extends ExpandableStringEnum { + /** Static value MoveResourceId for MoveResourceInputType. */ + public static final MoveResourceInputType MOVE_RESOURCE_ID = fromString("MoveResourceId"); + + /** Static value MoveResourceSourceId for MoveResourceInputType. */ + public static final MoveResourceInputType MOVE_RESOURCE_SOURCE_ID = fromString("MoveResourceSourceId"); + + /** + * Creates or finds a MoveResourceInputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MoveResourceInputType. + */ + @JsonCreator + public static MoveResourceInputType fromString(String name) { + return fromString(name, MoveResourceInputType.class); + } + + /** @return known MoveResourceInputType values. */ + public static Collection values() { + return values(MoveResourceInputType.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceProperties.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceProperties.java new file mode 100644 index 000000000000..80c1557a4cc6 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceProperties.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.resourcemover.models; + +import 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; + +/** Defines the move resource properties. */ +@Fluent +public final class MoveResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceProperties.class); + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Gets or sets the Source ARM Id of the resource. + */ + @JsonProperty(value = "sourceId", required = true) + private String sourceId; + + /* + * Gets or sets the Target ARM Id of the resource. + */ + @JsonProperty(value = "targetId", access = JsonProperty.Access.WRITE_ONLY) + private String targetId; + + /* + * Gets or sets the existing target ARM Id of the resource. + */ + @JsonProperty(value = "existingTargetId") + private String existingTargetId; + + /* + * Gets or sets the resource settings. + */ + @JsonProperty(value = "resourceSettings") + private ResourceSettings resourceSettings; + + /* + * Gets or sets the source resource settings. + */ + @JsonProperty(value = "sourceResourceSettings", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSettings sourceResourceSettings; + + /* + * Defines the move resource status. + */ + @JsonProperty(value = "moveStatus", access = JsonProperty.Access.WRITE_ONLY) + private MoveResourceStatus moveStatus; + + /* + * Gets or sets the move resource dependencies. + */ + @JsonProperty(value = "dependsOn", access = JsonProperty.Access.WRITE_ONLY) + private List dependsOn; + + /* + * Gets or sets the move resource dependencies overrides. + */ + @JsonProperty(value = "dependsOnOverrides") + private List dependsOnOverrides; + + /* + * Gets a value indicating whether the resolve action is required over the + * move collection. + */ + @JsonProperty(value = "isResolveRequired", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isResolveRequired; + + /* + * Defines the move resource errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private MoveResourceError errors; + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sourceId property: Gets or sets the Source ARM Id of the resource. + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: Gets or sets the Source ARM Id of the resource. + * + * @param sourceId the sourceId value to set. + * @return the MoveResourceProperties object itself. + */ + public MoveResourceProperties withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get the targetId property: Gets or sets the Target ARM Id of the resource. + * + * @return the targetId value. + */ + public String targetId() { + return this.targetId; + } + + /** + * Get the existingTargetId property: Gets or sets the existing target ARM Id of the resource. + * + * @return the existingTargetId value. + */ + public String existingTargetId() { + return this.existingTargetId; + } + + /** + * Set the existingTargetId property: Gets or sets the existing target ARM Id of the resource. + * + * @param existingTargetId the existingTargetId value to set. + * @return the MoveResourceProperties object itself. + */ + public MoveResourceProperties withExistingTargetId(String existingTargetId) { + this.existingTargetId = existingTargetId; + return this; + } + + /** + * Get the resourceSettings property: Gets or sets the resource settings. + * + * @return the resourceSettings value. + */ + public ResourceSettings resourceSettings() { + return this.resourceSettings; + } + + /** + * Set the resourceSettings property: Gets or sets the resource settings. + * + * @param resourceSettings the resourceSettings value to set. + * @return the MoveResourceProperties object itself. + */ + public MoveResourceProperties withResourceSettings(ResourceSettings resourceSettings) { + this.resourceSettings = resourceSettings; + return this; + } + + /** + * Get the sourceResourceSettings property: Gets or sets the source resource settings. + * + * @return the sourceResourceSettings value. + */ + public ResourceSettings sourceResourceSettings() { + return this.sourceResourceSettings; + } + + /** + * Get the moveStatus property: Defines the move resource status. + * + * @return the moveStatus value. + */ + public MoveResourceStatus moveStatus() { + return this.moveStatus; + } + + /** + * Get the dependsOn property: Gets or sets the move resource dependencies. + * + * @return the dependsOn value. + */ + public List dependsOn() { + return this.dependsOn; + } + + /** + * Get the dependsOnOverrides property: Gets or sets the move resource dependencies overrides. + * + * @return the dependsOnOverrides value. + */ + public List dependsOnOverrides() { + return this.dependsOnOverrides; + } + + /** + * Set the dependsOnOverrides property: Gets or sets the move resource dependencies overrides. + * + * @param dependsOnOverrides the dependsOnOverrides value to set. + * @return the MoveResourceProperties object itself. + */ + public MoveResourceProperties withDependsOnOverrides(List dependsOnOverrides) { + this.dependsOnOverrides = dependsOnOverrides; + return this; + } + + /** + * Get the isResolveRequired property: Gets a value indicating whether the resolve action is required over the move + * collection. + * + * @return the isResolveRequired value. + */ + public Boolean isResolveRequired() { + return this.isResolveRequired; + } + + /** + * Get the errors property: Defines the move resource errors. + * + * @return the errors value. + */ + public MoveResourceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceId in model MoveResourceProperties")); + } + if (resourceSettings() != null) { + resourceSettings().validate(); + } + if (sourceResourceSettings() != null) { + sourceResourceSettings().validate(); + } + if (moveStatus() != null) { + moveStatus().validate(); + } + if (dependsOn() != null) { + dependsOn().forEach(e -> e.validate()); + } + if (dependsOnOverrides() != null) { + dependsOnOverrides().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesErrors.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesErrors.java new file mode 100644 index 000000000000..3835c0e0e6da --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesErrors.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines the move resource errors. */ +@Immutable +public final class MoveResourcePropertiesErrors extends MoveResourceError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourcePropertiesErrors.class); + + /** {@inheritDoc} */ + @Override + public MoveResourcePropertiesErrors withProperties(MoveResourceErrorBody properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesMoveStatus.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesMoveStatus.java new file mode 100644 index 000000000000..6568f0a43005 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourcePropertiesMoveStatus.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines the move resource status. */ +@Immutable +public final class MoveResourcePropertiesMoveStatus extends MoveResourceStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourcePropertiesMoveStatus.class); + + /** {@inheritDoc} */ + @Override + public MoveResourcePropertiesMoveStatus withJobStatus(JobStatus jobStatus) { + super.withJobStatus(jobStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public MoveResourcePropertiesMoveStatus withErrors(MoveResourceError errors) { + super.withErrors(errors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceStatus.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceStatus.java new file mode 100644 index 000000000000..d91b7caeed03 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResourceStatus.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.resourcemover.models; + +import 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 the move resource status. */ +@Fluent +public class MoveResourceStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveResourceStatus.class); + + /* + * Defines the MoveResource states. + */ + @JsonProperty(value = "moveState", access = JsonProperty.Access.WRITE_ONLY) + private MoveState moveState; + + /* + * Defines the job status. + */ + @JsonProperty(value = "jobStatus") + private JobStatus jobStatus; + + /* + * An error response from the azure resource mover service. + */ + @JsonProperty(value = "errors") + private MoveResourceError errors; + + /* + * Gets the Target ARM Id of the resource. + */ + @JsonProperty(value = "targetId", access = JsonProperty.Access.WRITE_ONLY) + private String targetId; + + /** + * Get the moveState property: Defines the MoveResource states. + * + * @return the moveState value. + */ + public MoveState moveState() { + return this.moveState; + } + + /** + * Get the jobStatus property: Defines the job status. + * + * @return the jobStatus value. + */ + public JobStatus jobStatus() { + return this.jobStatus; + } + + /** + * Set the jobStatus property: Defines the job status. + * + * @param jobStatus the jobStatus value to set. + * @return the MoveResourceStatus object itself. + */ + public MoveResourceStatus withJobStatus(JobStatus jobStatus) { + this.jobStatus = jobStatus; + return this; + } + + /** + * Get the errors property: An error response from the azure resource mover service. + * + * @return the errors value. + */ + public MoveResourceError errors() { + return this.errors; + } + + /** + * Set the errors property: An error response from the azure resource mover service. + * + * @param errors the errors value to set. + * @return the MoveResourceStatus object itself. + */ + public MoveResourceStatus withErrors(MoveResourceError errors) { + this.errors = errors; + return this; + } + + /** + * Get the targetId property: Gets the Target ARM Id of the resource. + * + * @return the targetId value. + */ + public String targetId() { + return this.targetId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobStatus() != null) { + jobStatus().validate(); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResources.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResources.java new file mode 100644 index 000000000000..2e202a1709dd --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveResources.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.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 MoveResources. */ +public interface MoveResources { + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + PagedIterable list(String resourceGroupName, String moveCollectionName); + + /** + * Lists the Move Resources in the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param filter The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState + * eq 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of move resources. + */ + PagedIterable list( + String resourceGroupName, String moveCollectionName, String filter, Context context); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus delete(String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Deletes a Move Resource from the move collection. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status REST resource. + */ + OperationStatus delete( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context); + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + MoveResource get(String resourceGroupName, String moveCollectionName, String moveResourceName); + + /** + * Gets the Move Resource. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param moveResourceName The Move Resource Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + Response getWithResponse( + String resourceGroupName, String moveCollectionName, String moveResourceName, Context context); + + /** + * Gets the Move Resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Move Resource. + */ + MoveResource getById(String id); + + /** + * Gets the Move Resource. + * + * @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 Move Resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Move Resource from the move collection. + * + * @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 operation status REST resource. + */ + OperationStatus deleteById(String id); + + /** + * Deletes a Move Resource from the move collection. + * + * @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 operation status REST resource. + */ + OperationStatus deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MoveResource resource. + * + * @param name resource name. + * @return the first stage of the new MoveResource definition. + */ + MoveResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveState.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveState.java new file mode 100644 index 000000000000..3a3b3a324eb9 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/MoveState.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MoveState. */ +public final class MoveState extends ExpandableStringEnum { + /** Static value AssignmentPending for MoveState. */ + public static final MoveState ASSIGNMENT_PENDING = fromString("AssignmentPending"); + + /** Static value PreparePending for MoveState. */ + public static final MoveState PREPARE_PENDING = fromString("PreparePending"); + + /** Static value PrepareInProgress for MoveState. */ + public static final MoveState PREPARE_IN_PROGRESS = fromString("PrepareInProgress"); + + /** Static value PrepareFailed for MoveState. */ + public static final MoveState PREPARE_FAILED = fromString("PrepareFailed"); + + /** Static value MovePending for MoveState. */ + public static final MoveState MOVE_PENDING = fromString("MovePending"); + + /** Static value MoveInProgress for MoveState. */ + public static final MoveState MOVE_IN_PROGRESS = fromString("MoveInProgress"); + + /** Static value MoveFailed for MoveState. */ + public static final MoveState MOVE_FAILED = fromString("MoveFailed"); + + /** Static value DiscardInProgress for MoveState. */ + public static final MoveState DISCARD_IN_PROGRESS = fromString("DiscardInProgress"); + + /** Static value DiscardFailed for MoveState. */ + public static final MoveState DISCARD_FAILED = fromString("DiscardFailed"); + + /** Static value CommitPending for MoveState. */ + public static final MoveState COMMIT_PENDING = fromString("CommitPending"); + + /** Static value CommitInProgress for MoveState. */ + public static final MoveState COMMIT_IN_PROGRESS = fromString("CommitInProgress"); + + /** Static value CommitFailed for MoveState. */ + public static final MoveState COMMIT_FAILED = fromString("CommitFailed"); + + /** Static value Committed for MoveState. */ + public static final MoveState COMMITTED = fromString("Committed"); + + /** Static value DeleteSourcePending for MoveState. */ + public static final MoveState DELETE_SOURCE_PENDING = fromString("DeleteSourcePending"); + + /** Static value ResourceMoveCompleted for MoveState. */ + public static final MoveState RESOURCE_MOVE_COMPLETED = fromString("ResourceMoveCompleted"); + + /** + * Creates or finds a MoveState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MoveState. + */ + @JsonCreator + public static MoveState fromString(String name) { + return fromString(name, MoveState.class); + } + + /** @return known MoveState values. */ + public static Collection values() { + return values(MoveState.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkInterfaceResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkInterfaceResourceSettings.java new file mode 100644 index 000000000000..71a3d3bbfbb2 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkInterfaceResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines the network interface resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Network/networkInterfaces") +@Fluent +public final class NetworkInterfaceResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceResourceSettings.class); + + /* + * Gets or sets the IP configurations of the NIC. + */ + @JsonProperty(value = "ipConfigurations") + private List ipConfigurations; + + /* + * Gets or sets a value indicating whether accelerated networking is + * enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /** + * Get the ipConfigurations property: Gets or sets the IP configurations of the NIC. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: Gets or sets the IP configurations of the NIC. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the NetworkInterfaceResourceSettings object itself. + */ + public NetworkInterfaceResourceSettings withIpConfigurations( + List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Gets or sets a value indicating whether accelerated networking is + * enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Gets or sets a value indicating whether accelerated networking is + * enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfaceResourceSettings object itself. + */ + public NetworkInterfaceResourceSettings withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkSecurityGroupResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkSecurityGroupResourceSettings.java new file mode 100644 index 000000000000..60eaa798cd78 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NetworkSecurityGroupResourceSettings.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the NSG resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Network/networkSecurityGroups") +@Fluent +public final class NetworkSecurityGroupResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupResourceSettings.class); + + /* + * Gets or sets Security rules of network security group. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get the securityRules property: Gets or sets Security rules of network security group. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: Gets or sets Security rules of network security group. + * + * @param securityRules the securityRules value to set. + * @return the NetworkSecurityGroupResourceSettings object itself. + */ + public NetworkSecurityGroupResourceSettings withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkSecurityGroupResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NicIpConfigurationResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NicIpConfigurationResourceSettings.java new file mode 100644 index 000000000000..329754ad2233 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NicIpConfigurationResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines NIC IP configuration properties. */ +@Fluent +public final class NicIpConfigurationResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NicIpConfigurationResourceSettings.class); + + /* + * Gets or sets the IP configuration name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the private IP address of the network interface IP + * Configuration. + */ + @JsonProperty(value = "privateIpAddress") + private String privateIpAddress; + + /* + * Gets or sets the private IP address allocation method. + */ + @JsonProperty(value = "privateIpAllocationMethod") + private String privateIpAllocationMethod; + + /* + * Defines reference to a proxy resource. + */ + @JsonProperty(value = "subnet") + private ProxyResourceReference subnet; + + /* + * Gets or sets a value indicating whether this IP configuration is the + * primary. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Gets or sets the references of the load balancer backend address pools. + */ + @JsonProperty(value = "loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /** + * Get the name property: Gets or sets the IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the IP configuration name. + * + * @param name the name value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get the privateIpAddress property: Gets or sets the private IP address of the network interface IP Configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Gets or sets the private IP address of the network interface IP Configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: Gets or sets the private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public String privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: Gets or sets the private IP address allocation method. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withPrivateIpAllocationMethod(String privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnet property: Defines reference to a proxy resource. + * + * @return the subnet value. + */ + public ProxyResourceReference subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Defines reference to a proxy resource. + * + * @param subnet the subnet value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withSubnet(ProxyResourceReference subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Gets or sets a value indicating whether this IP configuration is the primary. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Gets or sets a value indicating whether this IP configuration is the primary. + * + * @param primary the primary value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Gets or sets the references of the load balancer backend + * address pools. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: Gets or sets the references of the load balancer backend + * address pools. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the NicIpConfigurationResourceSettings object itself. + */ + public NicIpConfigurationResourceSettings withLoadBalancerBackendAddressPools( + List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (loadBalancerBackendAddressPools() != null) { + loadBalancerBackendAddressPools().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NsgSecurityRule.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NsgSecurityRule.java new file mode 100644 index 000000000000..44eefcfe249d --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/NsgSecurityRule.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Security Rule data model for Network Security Groups. */ +@Fluent +public final class NsgSecurityRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NsgSecurityRule.class); + + /* + * Gets or sets the Security rule name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets whether network traffic is allowed or denied. + * Possible values are “Allow” and “Deny”. + */ + @JsonProperty(value = "access") + private String access; + + /* + * Gets or sets a description for this rule. Restricted to 140 chars. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Gets or sets destination address prefix. CIDR or source IP range. + * A “*” can also be used to match all source IPs. Default tags such + * as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be + * used. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * Gets or sets Destination Port or Range. Integer or range between + * 0 and 65535. A “*” can also be used to match all ports. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /* + * Gets or sets the direction of the rule.InBound or Outbound. The + * direction specifies if rule will be evaluated on incoming or outgoing + * traffic. + */ + @JsonProperty(value = "direction") + private String direction; + + /* + * Gets or sets the priority of the rule. The value can be between + * 100 and 4096. The priority number must be unique for each rule in the + * collection. + * The lower the priority number, the higher the priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or + * All(*). + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * Gets or sets source address prefix. CIDR or source IP range. A + * “*” can also be used to match all source IPs. Default tags such as + * ‘VirtualNetwork’, + * ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an + * ingress + * rule, specifies where network traffic originates from. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * Gets or sets Source Port or Range. Integer or range between 0 and + * 65535. A “*” can also be used to match all ports. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /** + * Get the name property: Gets or sets the Security rule name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the Security rule name. + * + * @param name the name value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the access property: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” + * and “Deny”. + * + * @return the access value. + */ + public String access() { + return this.access; + } + + /** + * Set the access property: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” + * and “Deny”. + * + * @param access the access value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withAccess(String access) { + this.access = access; + return this; + } + + /** + * Get the description property: Gets or sets a description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets a description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the destinationAddressPrefix property: Gets or sets destination address prefix. CIDR or source IP range. A + * “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and + * ‘Internet’ can also be used. + * + * @return the destinationAddressPrefix value. + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destinationAddressPrefix property: Gets or sets destination address prefix. CIDR or source IP range. A + * “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and + * ‘Internet’ can also be used. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the destinationPortRange property: Gets or sets Destination Port or Range. Integer or range between 0 and + * 65535. A “*” can also be used to match all ports. + * + * @return the destinationPortRange value. + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: Gets or sets Destination Port or Range. Integer or range between 0 and + * 65535. A “*” can also be used to match all ports. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the direction property: Gets or sets the direction of the rule.InBound or Outbound. The direction specifies + * if rule will be evaluated on incoming or outgoing traffic. + * + * @return the direction value. + */ + public String direction() { + return this.direction; + } + + /** + * Set the direction property: Gets or sets the direction of the rule.InBound or Outbound. The direction specifies + * if rule will be evaluated on incoming or outgoing traffic. + * + * @param direction the direction value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withDirection(String direction) { + this.direction = direction; + return this; + } + + /** + * Get the priority property: Gets or sets the priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher the + * priority of the rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Gets or sets the priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher the + * priority of the rule. + * + * @param priority the priority value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the protocol property: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). + * + * @param protocol the protocol value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddressPrefix property: Gets or sets source address prefix. CIDR or source IP range. A “*” can also + * be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can + * also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: Gets or sets source address prefix. CIDR or source IP range. A “*” can also + * be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can + * also be used. If this is an ingress rule, specifies where network traffic originates from. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the sourcePortRange property: Gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” + * can also be used to match all ports. + * + * @return the sourcePortRange value. + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the sourcePortRange property: Gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” + * can also be used to match all ports. + * + * @param sourcePortRange the sourcePortRange value to set. + * @return the NsgSecurityRule object itself. + */ + public NsgSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationErrorAdditionalInfo.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationErrorAdditionalInfo.java new file mode 100644 index 000000000000..feec35ad11d2 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationErrorAdditionalInfo.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The operation error info. */ +@Immutable +public final class OperationErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationErrorAdditionalInfo.class); + + /* + * The error type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The operation error info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private MoveErrorInfo info; + + /** + * Get the type property: The error type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The operation error info. + * + * @return the info value. + */ + public MoveErrorInfo info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (info() != null) { + info().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatus.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatus.java new file mode 100644 index 000000000000..94a791ce1aa6 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatus.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the id property: Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Status of the operation. ARM expects the terminal status to be one of Succeeded/ + * Failed/ Canceled. All other values imply that the operation is still running. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTime property: Start time. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the endTime property: End time. + * + * @return the endTime value. + */ + String endTime(); + + /** + * Gets the error property: Error stating all error details for the operation. + * + * @return the error value. + */ + OperationStatusError error(); + + /** + * Gets the properties property: Custom data. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.resourcemover.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatusError.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatusError.java new file mode 100644 index 000000000000..a85742fdfca7 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationStatusError.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.resourcemover.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; + +/** Class for operation status errors. */ +@Immutable +public final class OperationStatusError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusError.class); + + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the additionalInfo property: The additional info. + * + * @return the additionalInfo value. + */ + public List additionalInfo() { + return this.additionalInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (additionalInfo() != null) { + additionalInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveries.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveries.java new file mode 100644 index 000000000000..1b6a95cc6d0e --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveries.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationsDiscoveries. */ +public interface OperationsDiscoveries { + /** + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + OperationsDiscoveryCollection get(); + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of ClientDiscovery details. + */ + Response getWithResponse(Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscovery.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscovery.java new file mode 100644 index 000000000000..d720710b73c2 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscovery.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operations discovery class. */ +@Fluent +public final class OperationsDiscovery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDiscovery.class); + + /* + * Gets or sets Name of the API. + * The name of the operation being performed on this particular object. It + * should + * match the action name that appears in RBAC / the event service. + * Examples of operations include: + * * Microsoft.Compute/virtualMachine/capture/action + * * Microsoft.Compute/virtualMachine/restart/action + * * Microsoft.Compute/virtualMachine/write + * * Microsoft.Compute/virtualMachine/read + * * Microsoft.Compute/virtualMachine/delete + * Each action should include, in order: + * (1) Resource Provider Namespace + * (2) Type hierarchy for which the action applies (e.g. server/databases + * for a SQL + * Azure database) + * (3) Read, Write, Action or Delete indicating which type applies. If it + * is a PUT/PATCH + * on a collection or named value, Write should be used. + * If it is a GET, Read should be used. If it is a DELETE, Delete should be + * used. If it + * is a POST, Action should be used. + * As a note: all resource providers would need to include the "{Resource + * Provider + * Namespace}/register/action" operation in their response. + * This API is used to register for their service, and should include + * details about the + * operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Contains the localized display information for this particular operation + * / action. These + * value will be used by several clients for + * (1) custom role definitions for RBAC; + * (2) complex query filters for the event service; and + * (3) audit history / records for management operations. + */ + @JsonProperty(value = "display") + private Display display; + + /* + * Gets or sets Origin. + * The intended executor of the operation; governs the display of the + * operation in the + * RBAC UX and the audit logs UX. + * Default value is "user,system". + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Any object + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Gets or sets Name of the API. The name of the operation being performed on this particular + * object. It should match the action name that appears in RBAC / the event service. Examples of operations include: + * * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets Name of the API. The name of the operation being performed on this particular + * object. It should match the action name that appears in RBAC / the event service. Examples of operations include: + * * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * + * Microsoft.Compute/virtualMachine/write * Microsoft.Compute/virtualMachine/read * + * Microsoft.Compute/virtualMachine/delete Each action should include, in order: (1) Resource Provider Namespace (2) + * Type hierarchy for which the action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, + * Action or Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, Write should + * be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be used. If it is a POST, Action + * should be used. As a note: all resource providers would need to include the "{Resource Provider + * Namespace}/register/action" operation in their response. This API is used to register for their service, and + * should include details about the operation (e.g. a localized name for the resource provider + any special + * considerations like PII release). + * + * @param name the name value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Contains the localized display information for this particular operation / action. + * These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters + * for the event service; and (3) audit history / records for management operations. + * + * @return the display value. + */ + public Display display() { + return this.display; + } + + /** + * Set the display property: Contains the localized display information for this particular operation / action. + * These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters + * for the event service; and (3) audit history / records for management operations. + * + * @param display the display value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withDisplay(Display display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Gets or sets Origin. The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Gets or sets Origin. The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is "user,system". + * + * @param origin the origin value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Any object. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Any object. + * + * @param properties the properties value to set. + * @return the OperationsDiscovery object itself. + */ + public OperationsDiscovery withProperties(Object properties) { + this.properties = properties; + 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/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveryCollection.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveryCollection.java new file mode 100644 index 000000000000..5ef44c998aeb --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/OperationsDiscoveryCollection.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.resourcemover.models; + +import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner; +import java.util.List; + +/** An immutable client-side representation of OperationsDiscoveryCollection. */ +public interface OperationsDiscoveryCollection { + /** + * Gets the value property: Gets or sets the ClientDiscovery details. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner object. + * + * @return the inner object. + */ + OperationsDiscoveryCollectionInner innerModel(); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PrepareRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PrepareRequest.java new file mode 100644 index 000000000000..7bcc840e5a32 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PrepareRequest.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the request body for initiate prepare operation. */ +@Fluent +public final class PrepareRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrepareRequest.class); + + /* + * Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + */ + @JsonProperty(value = "validateOnly") + private Boolean validateOnly; + + /* + * Gets or sets the list of resource Id's, by default it accepts move + * resource id's unless the input type is switched via + * moveResourceInputType property. + */ + @JsonProperty(value = "moveResources", required = true) + private List moveResources; + + /* + * Defines the move resource input type. + */ + @JsonProperty(value = "moveResourceInputType") + private MoveResourceInputType moveResourceInputType; + + /** + * Get the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @return the validateOnly value. + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @param validateOnly the validateOnly value to set. + * @return the PrepareRequest object itself. + */ + public PrepareRequest withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Set the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @param moveResources the moveResources value to set. + * @return the PrepareRequest object itself. + */ + public PrepareRequest withMoveResources(List moveResources) { + this.moveResources = moveResources; + return this; + } + + /** + * Get the moveResourceInputType property: Defines the move resource input type. + * + * @return the moveResourceInputType value. + */ + public MoveResourceInputType moveResourceInputType() { + return this.moveResourceInputType; + } + + /** + * Set the moveResourceInputType property: Defines the move resource input type. + * + * @param moveResourceInputType the moveResourceInputType value to set. + * @return the PrepareRequest object itself. + */ + public PrepareRequest withMoveResourceInputType(MoveResourceInputType moveResourceInputType) { + this.moveResourceInputType = moveResourceInputType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property moveResources in model PrepareRequest")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProvisioningState.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProvisioningState.java new file mode 100644 index 000000000000..ef435c228f34 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProvisioningState.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProxyResourceReference.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProxyResourceReference.java new file mode 100644 index 000000000000..dc69c5eb41bf --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ProxyResourceReference.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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 reference to a proxy resource. */ +@Fluent +public class ProxyResourceReference extends AzureResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProxyResourceReference.class); + + /* + * Gets the name of the proxy resource on the target side. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Gets the name of the proxy resource on the target side. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the name of the proxy resource on the target side. + * + * @param name the name value to set. + * @return the ProxyResourceReference object itself. + */ + public ProxyResourceReference withName(String name) { + this.name = name; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProxyResourceReference withSourceArmResourceId(String sourceArmResourceId) { + super.withSourceArmResourceId(sourceArmResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PublicIpAddressResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PublicIpAddressResourceSettings.java new file mode 100644 index 000000000000..7629f32fec0c --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/PublicIpAddressResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines the public IP address resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Network/publicIPAddresses") +@Fluent +public final class PublicIpAddressResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressResourceSettings.class); + + /* + * Gets or sets the domain name label. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /* + * Gets or sets the fully qualified domain name. + */ + @JsonProperty(value = "fQDN") + private String fQdn; + + /* + * Gets or sets public IP allocation method. + */ + @JsonProperty(value = "publicIpAllocationMethod") + private String publicIpAllocationMethod; + + /* + * Gets or sets public IP sku. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Gets or sets public IP zones. + */ + @JsonProperty(value = "zones") + private String zones; + + /** + * Get the domainNameLabel property: Gets or sets the domain name label. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: Gets or sets the domain name label. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the PublicIpAddressResourceSettings object itself. + */ + public PublicIpAddressResourceSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get the fQdn property: Gets or sets the fully qualified domain name. + * + * @return the fQdn value. + */ + public String fQdn() { + return this.fQdn; + } + + /** + * Set the fQdn property: Gets or sets the fully qualified domain name. + * + * @param fQdn the fQdn value to set. + * @return the PublicIpAddressResourceSettings object itself. + */ + public PublicIpAddressResourceSettings withFQdn(String fQdn) { + this.fQdn = fQdn; + return this; + } + + /** + * Get the publicIpAllocationMethod property: Gets or sets public IP allocation method. + * + * @return the publicIpAllocationMethod value. + */ + public String publicIpAllocationMethod() { + return this.publicIpAllocationMethod; + } + + /** + * Set the publicIpAllocationMethod property: Gets or sets public IP allocation method. + * + * @param publicIpAllocationMethod the publicIpAllocationMethod value to set. + * @return the PublicIpAddressResourceSettings object itself. + */ + public PublicIpAddressResourceSettings withPublicIpAllocationMethod(String publicIpAllocationMethod) { + this.publicIpAllocationMethod = publicIpAllocationMethod; + return this; + } + + /** + * Get the sku property: Gets or sets public IP sku. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: Gets or sets public IP sku. + * + * @param sku the sku value to set. + * @return the PublicIpAddressResourceSettings object itself. + */ + public PublicIpAddressResourceSettings withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: Gets or sets public IP zones. + * + * @return the zones value. + */ + public String zones() { + return this.zones; + } + + /** + * Set the zones property: Gets or sets public IP zones. + * + * @param zones the zones value to set. + * @return the PublicIpAddressResourceSettings object itself. + */ + public PublicIpAddressResourceSettings withZones(String zones) { + this.zones = zones; + return this; + } + + /** {@inheritDoc} */ + @Override + public PublicIpAddressResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResolutionType.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResolutionType.java new file mode 100644 index 000000000000..87c0cedcf4fe --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResolutionType.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResolutionType. */ +public final class ResolutionType extends ExpandableStringEnum { + /** Static value Manual for ResolutionType. */ + public static final ResolutionType MANUAL = fromString("Manual"); + + /** Static value Automatic for ResolutionType. */ + public static final ResolutionType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a ResolutionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResolutionType. + */ + @JsonCreator + public static ResolutionType fromString(String name) { + return fromString(name, ResolutionType.class); + } + + /** @return known ResolutionType values. */ + public static Collection values() { + return values(ResolutionType.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceGroupResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceGroupResourceSettings.java new file mode 100644 index 000000000000..ff320686adc6 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceGroupResourceSettings.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.resourcemover.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; + +/** Defines the resource group resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("resourceGroups") +@Immutable +public final class ResourceGroupResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceGroupResourceSettings.class); + + /** {@inheritDoc} */ + @Override + public ResourceGroupResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceIdentityType.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceIdentityType.java new file mode 100644 index 000000000000..ff5efd2d140c --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceIdentityType.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceIdentityType. */ +public final class ResourceIdentityType extends ExpandableStringEnum { + /** Static value None for ResourceIdentityType. */ + public static final ResourceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ResourceIdentityType. */ + public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ResourceIdentityType. */ + public static final ResourceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates or finds a ResourceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceIdentityType. + */ + @JsonCreator + public static ResourceIdentityType fromString(String name) { + return fromString(name, ResourceIdentityType.class); + } + + /** @return known ResourceIdentityType values. */ + public static Collection values() { + return values(ResourceIdentityType.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceMoveRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceMoveRequest.java new file mode 100644 index 000000000000..fb244202f569 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceMoveRequest.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the request body for resource move operation. */ +@Fluent +public final class ResourceMoveRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMoveRequest.class); + + /* + * Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + */ + @JsonProperty(value = "validateOnly") + private Boolean validateOnly; + + /* + * Gets or sets the list of resource Id's, by default it accepts move + * resource id's unless the input type is switched via + * moveResourceInputType property. + */ + @JsonProperty(value = "moveResources", required = true) + private List moveResources; + + /* + * Defines the move resource input type. + */ + @JsonProperty(value = "moveResourceInputType") + private MoveResourceInputType moveResourceInputType; + + /** + * Get the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @return the validateOnly value. + */ + public Boolean validateOnly() { + return this.validateOnly; + } + + /** + * Set the validateOnly property: Gets or sets a value indicating whether the operation needs to only run + * pre-requisite. + * + * @param validateOnly the validateOnly value to set. + * @return the ResourceMoveRequest object itself. + */ + public ResourceMoveRequest withValidateOnly(Boolean validateOnly) { + this.validateOnly = validateOnly; + return this; + } + + /** + * Get the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @return the moveResources value. + */ + public List moveResources() { + return this.moveResources; + } + + /** + * Set the moveResources property: Gets or sets the list of resource Id's, by default it accepts move resource id's + * unless the input type is switched via moveResourceInputType property. + * + * @param moveResources the moveResources value to set. + * @return the ResourceMoveRequest object itself. + */ + public ResourceMoveRequest withMoveResources(List moveResources) { + this.moveResources = moveResources; + return this; + } + + /** + * Get the moveResourceInputType property: Defines the move resource input type. + * + * @return the moveResourceInputType value. + */ + public MoveResourceInputType moveResourceInputType() { + return this.moveResourceInputType; + } + + /** + * Set the moveResourceInputType property: Defines the move resource input type. + * + * @param moveResourceInputType the moveResourceInputType value to set. + * @return the ResourceMoveRequest object itself. + */ + public ResourceMoveRequest withMoveResourceInputType(MoveResourceInputType moveResourceInputType) { + this.moveResourceInputType = moveResourceInputType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moveResources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property moveResources in model ResourceMoveRequest")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceSettings.java new file mode 100644 index 000000000000..49db73f52082 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ResourceSettings.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.resourcemover.models; + +import 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; + +/** Gets or sets the resource settings. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resourceType", + defaultImpl = ResourceSettings.class) +@JsonTypeName("ResourceSettings") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = VirtualMachineResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/availabilitySets", value = AvailabilitySetResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Network/virtualNetworks", value = VirtualNetworkResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Network/networkInterfaces", value = NetworkInterfaceResourceSettings.class), + @JsonSubTypes.Type( + name = "Microsoft.Network/networkSecurityGroups", + value = NetworkSecurityGroupResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Network/loadBalancers", value = LoadBalancerResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers", value = SqlServerResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers/elasticPools", value = SqlElasticPoolResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers/databases", value = SqlDatabaseResourceSettings.class), + @JsonSubTypes.Type(name = "resourceGroups", value = ResourceGroupResourceSettings.class), + @JsonSubTypes.Type(name = "Microsoft.Network/publicIPAddresses", value = PublicIpAddressResourceSettings.class) +}) +@Fluent +public class ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSettings.class); + + /* + * Gets or sets the target Resource name. + */ + @JsonProperty(value = "targetResourceName", required = true) + private String targetResourceName; + + /** + * Get the targetResourceName property: Gets or sets the target Resource name. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.targetResourceName; + } + + /** + * Set the targetResourceName property: Gets or sets the target Resource name. + * + * @param targetResourceName the targetResourceName value to set. + * @return the ResourceSettings object itself. + */ + public ResourceSettings withTargetResourceName(String targetResourceName) { + this.targetResourceName = targetResourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceName in model ResourceSettings")); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlDatabaseResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlDatabaseResourceSettings.java new file mode 100644 index 000000000000..1bbd6c6bed89 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlDatabaseResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines the Sql Database resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Sql/servers/databases") +@Fluent +public final class SqlDatabaseResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlDatabaseResourceSettings.class); + + /* + * Defines the zone redundant resource setting. + */ + @JsonProperty(value = "zoneRedundant") + private ZoneRedundant zoneRedundant; + + /** + * Get the zoneRedundant property: Defines the zone redundant resource setting. + * + * @return the zoneRedundant value. + */ + public ZoneRedundant zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Defines the zone redundant resource setting. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SqlDatabaseResourceSettings object itself. + */ + public SqlDatabaseResourceSettings withZoneRedundant(ZoneRedundant zoneRedundant) { + this.zoneRedundant = zoneRedundant; + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlDatabaseResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlElasticPoolResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlElasticPoolResourceSettings.java new file mode 100644 index 000000000000..aaa58cd95b74 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlElasticPoolResourceSettings.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.resourcemover.models; + +import 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; + +/** Defines the Sql ElasticPool resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Sql/servers/elasticPools") +@Fluent +public final class SqlElasticPoolResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlElasticPoolResourceSettings.class); + + /* + * Defines the zone redundant resource setting. + */ + @JsonProperty(value = "zoneRedundant") + private ZoneRedundant zoneRedundant; + + /** + * Get the zoneRedundant property: Defines the zone redundant resource setting. + * + * @return the zoneRedundant value. + */ + public ZoneRedundant zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Defines the zone redundant resource setting. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the SqlElasticPoolResourceSettings object itself. + */ + public SqlElasticPoolResourceSettings withZoneRedundant(ZoneRedundant zoneRedundant) { + this.zoneRedundant = zoneRedundant; + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlElasticPoolResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlServerResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlServerResourceSettings.java new file mode 100644 index 000000000000..72b81fbb18fd --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SqlServerResourceSettings.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.resourcemover.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; + +/** Defines the SQL Server resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Sql/servers") +@Immutable +public final class SqlServerResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerResourceSettings.class); + + /** {@inheritDoc} */ + @Override + public SqlServerResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetReference.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetReference.java new file mode 100644 index 000000000000..354ed29e7ccd --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetReference.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.resourcemover.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Defines reference to subnet. */ +@Immutable +public final class SubnetReference extends ProxyResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetReference.class); + + /** {@inheritDoc} */ + @Override + public SubnetReference withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SubnetReference withSourceArmResourceId(String sourceArmResourceId) { + super.withSourceArmResourceId(sourceArmResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetResourceSettings.java new file mode 100644 index 000000000000..e897c7b69c82 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SubnetResourceSettings.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.resourcemover.models; + +import 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 the virtual network subnets resource settings. */ +@Fluent +public final class SubnetResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetResourceSettings.class); + + /* + * Gets or sets the Subnet name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets address prefix for the subnet. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /** + * Get the name property: Gets or sets the Subnet name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the Subnet name. + * + * @param name the name value to set. + * @return the SubnetResourceSettings object itself. + */ + public SubnetResourceSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get the addressPrefix property: Gets or sets address prefix for the subnet. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Gets or sets address prefix for the subnet. + * + * @param addressPrefix the addressPrefix value to set. + * @return the SubnetResourceSettings object itself. + */ + public SubnetResourceSettings withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Summary.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Summary.java new file mode 100644 index 000000000000..aa091b2d614b --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/Summary.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.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summary item. */ +@Fluent +public final class Summary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Summary.class); + + /* + * Gets the count. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * Gets the item. + */ + @JsonProperty(value = "item") + private String item; + + /** + * Get the count property: Gets the count. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Gets the count. + * + * @param count the count value to set. + * @return the Summary object itself. + */ + public Summary withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the item property: Gets the item. + * + * @return the item value. + */ + public String item() { + return this.item; + } + + /** + * Set the item property: Gets the item. + * + * @param item the item value to set. + * @return the Summary object itself. + */ + public Summary withItem(String item) { + this.item = item; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SummaryCollection.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SummaryCollection.java new file mode 100644 index 000000000000..c753fdb4a492 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/SummaryCollection.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.resourcemover.models; + +import 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; + +/** Summary Collection. */ +@Fluent +public final class SummaryCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SummaryCollection.class); + + /* + * Gets or sets the field name on which summary is done. + */ + @JsonProperty(value = "fieldName") + private String fieldName; + + /* + * Gets or sets the list of summary items. + */ + @JsonProperty(value = "summary") + private List summary; + + /** + * Get the fieldName property: Gets or sets the field name on which summary is done. + * + * @return the fieldName value. + */ + public String fieldName() { + return this.fieldName; + } + + /** + * Set the fieldName property: Gets or sets the field name on which summary is done. + * + * @param fieldName the fieldName value to set. + * @return the SummaryCollection object itself. + */ + public SummaryCollection withFieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + /** + * Get the summary property: Gets or sets the list of summary items. + * + * @return the summary value. + */ + public List summary() { + return this.summary; + } + + /** + * Set the summary property: Gets or sets the list of summary items. + * + * @param summary the summary value to set. + * @return the SummaryCollection object itself. + */ + public SummaryCollection withSummary(List summary) { + this.summary = summary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summary() != null) { + summary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/TargetAvailabilityZone.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/TargetAvailabilityZone.java new file mode 100644 index 000000000000..65b696fa1312 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/TargetAvailabilityZone.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TargetAvailabilityZone. */ +public final class TargetAvailabilityZone extends ExpandableStringEnum { + /** Static value 1 for TargetAvailabilityZone. */ + public static final TargetAvailabilityZone ONE = fromString("1"); + + /** Static value 2 for TargetAvailabilityZone. */ + public static final TargetAvailabilityZone TWO = fromString("2"); + + /** Static value 3 for TargetAvailabilityZone. */ + public static final TargetAvailabilityZone THREE = fromString("3"); + + /** Static value NA for TargetAvailabilityZone. */ + public static final TargetAvailabilityZone NA = fromString("NA"); + + /** + * Creates or finds a TargetAvailabilityZone from its string representation. + * + * @param name a name to look for. + * @return the corresponding TargetAvailabilityZone. + */ + @JsonCreator + public static TargetAvailabilityZone fromString(String name) { + return fromString(name, TargetAvailabilityZone.class); + } + + /** @return known TargetAvailabilityZone values. */ + public static Collection values() { + return values(TargetAvailabilityZone.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencies.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencies.java new file mode 100644 index 000000000000..d3c209599e31 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencies.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.resourcemover.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of UnresolvedDependencies. */ +public interface UnresolvedDependencies { + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + UnresolvedDependencyCollection get(String resourceGroupName, String moveCollectionName); + + /** + * Gets a list of unresolved dependencies. + * + * @param resourceGroupName The Resource Group Name. + * @param moveCollectionName The Move Collection Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of unresolved dependencies. + */ + Response getWithResponse( + String resourceGroupName, String moveCollectionName, Context context); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependency.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependency.java new file mode 100644 index 000000000000..85f5bfc05c46 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependency.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.resourcemover.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Unresolved dependency. */ +@Fluent +public final class UnresolvedDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnresolvedDependency.class); + + /* + * Gets or sets the count. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * Gets or sets the arm id of the dependency. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the count property: Gets or sets the count. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Gets or sets the count. + * + * @param count the count value to set. + * @return the UnresolvedDependency object itself. + */ + public UnresolvedDependency withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the id property: Gets or sets the arm id of the dependency. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets or sets the arm id of the dependency. + * + * @param id the id value to set. + * @return the UnresolvedDependency object itself. + */ + public UnresolvedDependency withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencyCollection.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencyCollection.java new file mode 100644 index 000000000000..9d93b0f4d012 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UnresolvedDependencyCollection.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.resourcemover.models; + +import com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner; +import java.util.List; + +/** An immutable client-side representation of UnresolvedDependencyCollection. */ +public interface UnresolvedDependencyCollection { + /** + * Gets the value property: Gets or sets the list of unresolved dependencies. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Gets or sets the value of next link. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.resourcemover.fluent.models.UnresolvedDependencyCollectionInner object. + * + * @return the inner object. + */ + UnresolvedDependencyCollectionInner innerModel(); +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UpdateMoveCollectionRequest.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UpdateMoveCollectionRequest.java new file mode 100644 index 000000000000..8fbd74e38120 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/UpdateMoveCollectionRequest.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.resourcemover.models; + +import 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; + +/** Defines the request body for updating move collection. */ +@Fluent +public final class UpdateMoveCollectionRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateMoveCollectionRequest.class); + + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Defines the MSI properties of the Move Collection. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateMoveCollectionRequest object itself. + */ + public UpdateMoveCollectionRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Defines the MSI properties of the Move Collection. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Defines the MSI properties of the Move Collection. + * + * @param identity the identity value to set. + * @return the UpdateMoveCollectionRequest object itself. + */ + public UpdateMoveCollectionRequest withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualMachineResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualMachineResourceSettings.java new file mode 100644 index 000000000000..937850e27cd6 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualMachineResourceSettings.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.resourcemover.models; + +import 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; + +/** Gets or sets the virtual machine resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +@Fluent +public final class VirtualMachineResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineResourceSettings.class); + + /* + * Gets or sets the target availability zone. + */ + @JsonProperty(value = "targetAvailabilityZone") + private TargetAvailabilityZone targetAvailabilityZone; + + /* + * Gets or sets the target virtual machine size. + */ + @JsonProperty(value = "targetVmSize") + private String targetVmSize; + + /* + * Gets or sets the target availability set id for virtual machines not in + * an availability set at source. + */ + @JsonProperty(value = "targetAvailabilitySetId") + private String targetAvailabilitySetId; + + /** + * Get the targetAvailabilityZone property: Gets or sets the target availability zone. + * + * @return the targetAvailabilityZone value. + */ + public TargetAvailabilityZone targetAvailabilityZone() { + return this.targetAvailabilityZone; + } + + /** + * Set the targetAvailabilityZone property: Gets or sets the target availability zone. + * + * @param targetAvailabilityZone the targetAvailabilityZone value to set. + * @return the VirtualMachineResourceSettings object itself. + */ + public VirtualMachineResourceSettings withTargetAvailabilityZone(TargetAvailabilityZone targetAvailabilityZone) { + this.targetAvailabilityZone = targetAvailabilityZone; + return this; + } + + /** + * Get the targetVmSize property: Gets or sets the target virtual machine size. + * + * @return the targetVmSize value. + */ + public String targetVmSize() { + return this.targetVmSize; + } + + /** + * Set the targetVmSize property: Gets or sets the target virtual machine size. + * + * @param targetVmSize the targetVmSize value to set. + * @return the VirtualMachineResourceSettings object itself. + */ + public VirtualMachineResourceSettings withTargetVmSize(String targetVmSize) { + this.targetVmSize = targetVmSize; + return this; + } + + /** + * Get the targetAvailabilitySetId property: Gets or sets the target availability set id for virtual machines not in + * an availability set at source. + * + * @return the targetAvailabilitySetId value. + */ + public String targetAvailabilitySetId() { + return this.targetAvailabilitySetId; + } + + /** + * Set the targetAvailabilitySetId property: Gets or sets the target availability set id for virtual machines not in + * an availability set at source. + * + * @param targetAvailabilitySetId the targetAvailabilitySetId value to set. + * @return the VirtualMachineResourceSettings object itself. + */ + public VirtualMachineResourceSettings withTargetAvailabilitySetId(String targetAvailabilitySetId) { + this.targetAvailabilitySetId = targetAvailabilitySetId; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualNetworkResourceSettings.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualNetworkResourceSettings.java new file mode 100644 index 000000000000..5d1ff9d9bf87 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/VirtualNetworkResourceSettings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourcemover.models; + +import 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; + +/** Defines the virtual network resource settings. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType") +@JsonTypeName("Microsoft.Network/virtualNetworks") +@Fluent +public final class VirtualNetworkResourceSettings extends ResourceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkResourceSettings.class); + + /* + * Gets or sets a value indicating whether gets or sets whether the + * DDOS protection should be switched on. + */ + @JsonProperty(value = "enableDdosProtection") + private Boolean enableDdosProtection; + + /* + * Gets or sets the address prefixes for the virtual network. + */ + @JsonProperty(value = "addressSpace") + private List addressSpace; + + /* + * Gets or sets DHCPOptions that contains an array of DNS servers available + * to VMs + * deployed in the virtual network. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /* + * Gets or sets List of subnets in a VirtualNetwork. + */ + @JsonProperty(value = "subnets") + private List subnets; + + /** + * Get the enableDdosProtection property: Gets or sets a value indicating whether gets or sets whether the DDOS + * protection should be switched on. + * + * @return the enableDdosProtection value. + */ + public Boolean enableDdosProtection() { + return this.enableDdosProtection; + } + + /** + * Set the enableDdosProtection property: Gets or sets a value indicating whether gets or sets whether the DDOS + * protection should be switched on. + * + * @param enableDdosProtection the enableDdosProtection value to set. + * @return the VirtualNetworkResourceSettings object itself. + */ + public VirtualNetworkResourceSettings withEnableDdosProtection(Boolean enableDdosProtection) { + this.enableDdosProtection = enableDdosProtection; + return this; + } + + /** + * Get the addressSpace property: Gets or sets the address prefixes for the virtual network. + * + * @return the addressSpace value. + */ + public List addressSpace() { + return this.addressSpace; + } + + /** + * Set the addressSpace property: Gets or sets the address prefixes for the virtual network. + * + * @param addressSpace the addressSpace value to set. + * @return the VirtualNetworkResourceSettings object itself. + */ + public VirtualNetworkResourceSettings withAddressSpace(List addressSpace) { + this.addressSpace = addressSpace; + return this; + } + + /** + * Get the dnsServers property: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs + * deployed in the virtual network. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualNetworkResourceSettings object itself. + */ + public VirtualNetworkResourceSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the subnets property: Gets or sets List of subnets in a VirtualNetwork. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: Gets or sets List of subnets in a VirtualNetwork. + * + * @param subnets the subnets value to set. + * @return the VirtualNetworkResourceSettings object itself. + */ + public VirtualNetworkResourceSettings withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkResourceSettings withTargetResourceName(String targetResourceName) { + super.withTargetResourceName(targetResourceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ZoneRedundant.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ZoneRedundant.java new file mode 100644 index 000000000000..47bc8bbcf557 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/ZoneRedundant.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.resourcemover.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ZoneRedundant. */ +public final class ZoneRedundant extends ExpandableStringEnum { + /** Static value Enable for ZoneRedundant. */ + public static final ZoneRedundant ENABLE = fromString("Enable"); + + /** Static value Disable for ZoneRedundant. */ + public static final ZoneRedundant DISABLE = fromString("Disable"); + + /** + * Creates or finds a ZoneRedundant from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundant. + */ + @JsonCreator + public static ZoneRedundant fromString(String name) { + return fromString(name, ZoneRedundant.class); + } + + /** @return known ZoneRedundant values. */ + public static Collection values() { + return values(ZoneRedundant.class); + } +} diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/package-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/package-info.java new file mode 100644 index 000000000000..948b31546c57 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for ResourceMoverServiceApi. A first party Azure service orchestrating the move of + * Azure resources from one Azure region to another or between zones within a region. + */ +package com.azure.resourcemanager.resourcemover.models; diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/package-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/package-info.java new file mode 100644 index 000000000000..02b682fd4e06 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/com/azure/resourcemanager/resourcemover/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for ResourceMoverServiceApi. A first party Azure service orchestrating the move of + * Azure resources from one Azure region to another or between zones within a region. + */ +package com.azure.resourcemanager.resourcemover; diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/module-info.java b/sdk/resourcemover/azure-resourcemanager-resourcemover/src/main/java/module-info.java new file mode 100644 index 000000000000..f91f6ac35540 --- /dev/null +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/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.resourcemover { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.resourcemover; + exports com.azure.resourcemanager.resourcemover.fluent; + exports com.azure.resourcemanager.resourcemover.fluent.models; + exports com.azure.resourcemanager.resourcemover.models; + + opens com.azure.resourcemanager.resourcemover.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.resourcemover.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/resourcemover/ci.yml b/sdk/resourcemover/ci.yml new file mode 100644 index 000000000000..75b8dc40bd9a --- /dev/null +++ b/sdk/resourcemover/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: resourcemover + Artifacts: + - name: azure-resourcemanager-resourcemover + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerresourcemover diff --git a/sdk/resourcemover/pom.xml b/sdk/resourcemover/pom.xml new file mode 100644 index 000000000000..d11c2f87f086 --- /dev/null +++ b/sdk/resourcemover/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-resourcemover-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-resourcemover + + + +