diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a0227c2b9ee22..f157f97d008b1 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -200,6 +200,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 3d84dd84ceb34..fae600ef1f081 100644 --- a/pom.xml +++ b/pom.xml @@ -585,6 +585,7 @@ sdk/postgresql sdk/quantum sdk/recoveryservices + sdk/recoveryservicesbackup sdk/relay sdk/resourcemanager sdk/schemaregistry diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md new file mode 100644 index 0000000000000..6dcbc38a040ad --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-06) + +- Azure Resource Manager RecoveryServicesBackup client library for Java. This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md new file mode 100644 index 0000000000000..14921d0bb8e66 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager RecoveryServicesBackup client library for Java + +Azure Resource Manager RecoveryServicesBackup client library for Java. + +This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-recoveryservicesbackup + 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(); +RecoveryServicesBackupManager manager = RecoveryServicesBackupManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml new file mode 100644 index 0000000000000..9ad0615ce35ad --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/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-recoveryservicesbackup + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for RecoveryServicesBackup Management + This package contains Microsoft Azure SDK for RecoveryServicesBackup Management SDK. Open API 2.0 Specs for Azure RecoveryServices Backup service. Package tag package-2021-01. 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java new file mode 100644 index 0000000000000..232009bf64d24 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java @@ -0,0 +1,851 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup; + +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.recoveryservicesbackup.fluent.RecoveryServicesBackupClient; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.AadPropertiesOperationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupCrrJobDetailsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupCrrJobsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsCrrsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossRegionRestoresImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrrOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrrOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsOperationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerRefreshOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionIntentsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsCrrsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryServicesBackupClientBuilder; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsCrrs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; +import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestores; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; +import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobCancellations; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationsOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerRefreshOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainers; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntents; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicies; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsCrrs; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsRecommendedForMoves; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; +import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; +import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to RecoveryServicesBackupManager. Open API 2.0 Specs for Azure RecoveryServices Backup service. */ +public final class RecoveryServicesBackupManager { + private BackupResourceVaultConfigs backupResourceVaultConfigs; + + private BackupResourceEncryptionConfigs backupResourceEncryptionConfigs; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateEndpoints privateEndpoints; + + private ResourceProviders resourceProviders; + + private BmsPrepareDataMoveOperationResults bmsPrepareDataMoveOperationResults; + + private ProtectedItems protectedItems; + + private ProtectedItemOperationResults protectedItemOperationResults; + + private RecoveryPoints recoveryPoints; + + private Restores restores; + + private BackupPolicies backupPolicies; + + private ProtectionPolicies protectionPolicies; + + private ProtectionPolicyOperationResults protectionPolicyOperationResults; + + private BackupJobs backupJobs; + + private JobDetails jobDetails; + + private JobCancellations jobCancellations; + + private JobOperationResults jobOperationResults; + + private ExportJobsOperationResults exportJobsOperationResults; + + private Jobs jobs; + + private BackupProtectedItems backupProtectedItems; + + private Operations operations; + + private BackupEngines backupEngines; + + private ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults; + + private ProtectableContainers protectableContainers; + + private ProtectionContainers protectionContainers; + + private BackupWorkloadItems backupWorkloadItems; + + private ProtectionContainerOperationResults protectionContainerOperationResults; + + private Backups backups; + + private ProtectedItemOperationStatuses protectedItemOperationStatuses; + + private ItemLevelRecoveryConnections itemLevelRecoveryConnections; + + private BackupOperationResults backupOperationResults; + + private BackupOperationStatuses backupOperationStatuses; + + private ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses; + + private BackupProtectableItems backupProtectableItems; + + private BackupProtectionContainers backupProtectionContainers; + + private SecurityPINs securityPINs; + + private RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves; + + private AadPropertiesOperations aadPropertiesOperations; + + private CrossRegionRestores crossRegionRestores; + + private BackupCrrJobDetails backupCrrJobDetails; + + private BackupCrrJobs backupCrrJobs; + + private CrrOperationResults crrOperationResults; + + private CrrOperationStatus crrOperationStatus; + + private BackupResourceStorageConfigs backupResourceStorageConfigs; + + private RecoveryPointsCrrs recoveryPointsCrrs; + + private BackupProtectedItemsCrrs backupProtectedItemsCrrs; + + private ProtectionIntents protectionIntents; + + private BackupStatus backupStatus; + + private FeatureSupports featureSupports; + + private BackupProtectionIntents backupProtectionIntents; + + private BackupUsageSummaries backupUsageSummaries; + + private OperationsOperations operationsOperations; + + private final RecoveryServicesBackupClient clientObject; + + private RecoveryServicesBackupManager( + HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new RecoveryServicesBackupClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of RecoveryServicesBackup service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the RecoveryServicesBackup service API instance. + */ + public static RecoveryServicesBackupManager 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 RecoveryServicesBackupManager with optional + * configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RecoveryServicesBackupManager.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 RecoveryServicesBackup service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the RecoveryServicesBackup service API instance. + */ + public RecoveryServicesBackupManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.recoveryservicesbackup") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RecoveryServicesBackupManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of BackupResourceVaultConfigs. */ + public BackupResourceVaultConfigs backupResourceVaultConfigs() { + if (this.backupResourceVaultConfigs == null) { + this.backupResourceVaultConfigs = + new BackupResourceVaultConfigsImpl(clientObject.getBackupResourceVaultConfigs(), this); + } + return backupResourceVaultConfigs; + } + + /** @return Resource collection API of BackupResourceEncryptionConfigs. */ + public BackupResourceEncryptionConfigs backupResourceEncryptionConfigs() { + if (this.backupResourceEncryptionConfigs == null) { + this.backupResourceEncryptionConfigs = + new BackupResourceEncryptionConfigsImpl(clientObject.getBackupResourceEncryptionConfigs(), this); + } + return backupResourceEncryptionConfigs; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateEndpoints. */ + public PrivateEndpoints privateEndpoints() { + if (this.privateEndpoints == null) { + this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this); + } + return privateEndpoints; + } + + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** @return Resource collection API of BmsPrepareDataMoveOperationResults. */ + public BmsPrepareDataMoveOperationResults bmsPrepareDataMoveOperationResults() { + if (this.bmsPrepareDataMoveOperationResults == null) { + this.bmsPrepareDataMoveOperationResults = + new BmsPrepareDataMoveOperationResultsImpl(clientObject.getBmsPrepareDataMoveOperationResults(), this); + } + return bmsPrepareDataMoveOperationResults; + } + + /** @return Resource collection API of ProtectedItems. */ + public ProtectedItems protectedItems() { + if (this.protectedItems == null) { + this.protectedItems = new ProtectedItemsImpl(clientObject.getProtectedItems(), this); + } + return protectedItems; + } + + /** @return Resource collection API of ProtectedItemOperationResults. */ + public ProtectedItemOperationResults protectedItemOperationResults() { + if (this.protectedItemOperationResults == null) { + this.protectedItemOperationResults = + new ProtectedItemOperationResultsImpl(clientObject.getProtectedItemOperationResults(), this); + } + return protectedItemOperationResults; + } + + /** @return Resource collection API of RecoveryPoints. */ + public RecoveryPoints recoveryPoints() { + if (this.recoveryPoints == null) { + this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); + } + return recoveryPoints; + } + + /** @return Resource collection API of Restores. */ + public Restores restores() { + if (this.restores == null) { + this.restores = new RestoresImpl(clientObject.getRestores(), this); + } + return restores; + } + + /** @return Resource collection API of BackupPolicies. */ + public BackupPolicies backupPolicies() { + if (this.backupPolicies == null) { + this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this); + } + return backupPolicies; + } + + /** @return Resource collection API of ProtectionPolicies. */ + public ProtectionPolicies protectionPolicies() { + if (this.protectionPolicies == null) { + this.protectionPolicies = new ProtectionPoliciesImpl(clientObject.getProtectionPolicies(), this); + } + return protectionPolicies; + } + + /** @return Resource collection API of ProtectionPolicyOperationResults. */ + public ProtectionPolicyOperationResults protectionPolicyOperationResults() { + if (this.protectionPolicyOperationResults == null) { + this.protectionPolicyOperationResults = + new ProtectionPolicyOperationResultsImpl(clientObject.getProtectionPolicyOperationResults(), this); + } + return protectionPolicyOperationResults; + } + + /** @return Resource collection API of BackupJobs. */ + public BackupJobs backupJobs() { + if (this.backupJobs == null) { + this.backupJobs = new BackupJobsImpl(clientObject.getBackupJobs(), this); + } + return backupJobs; + } + + /** @return Resource collection API of JobDetails. */ + public JobDetails jobDetails() { + if (this.jobDetails == null) { + this.jobDetails = new JobDetailsImpl(clientObject.getJobDetails(), this); + } + return jobDetails; + } + + /** @return Resource collection API of JobCancellations. */ + public JobCancellations jobCancellations() { + if (this.jobCancellations == null) { + this.jobCancellations = new JobCancellationsImpl(clientObject.getJobCancellations(), this); + } + return jobCancellations; + } + + /** @return Resource collection API of JobOperationResults. */ + public JobOperationResults jobOperationResults() { + if (this.jobOperationResults == null) { + this.jobOperationResults = new JobOperationResultsImpl(clientObject.getJobOperationResults(), this); + } + return jobOperationResults; + } + + /** @return Resource collection API of ExportJobsOperationResults. */ + public ExportJobsOperationResults exportJobsOperationResults() { + if (this.exportJobsOperationResults == null) { + this.exportJobsOperationResults = + new ExportJobsOperationResultsImpl(clientObject.getExportJobsOperationResults(), this); + } + return exportJobsOperationResults; + } + + /** @return Resource collection API of Jobs. */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); + } + return jobs; + } + + /** @return Resource collection API of BackupProtectedItems. */ + public BackupProtectedItems backupProtectedItems() { + if (this.backupProtectedItems == null) { + this.backupProtectedItems = new BackupProtectedItemsImpl(clientObject.getBackupProtectedItems(), this); + } + return backupProtectedItems; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of BackupEngines. */ + public BackupEngines backupEngines() { + if (this.backupEngines == null) { + this.backupEngines = new BackupEnginesImpl(clientObject.getBackupEngines(), this); + } + return backupEngines; + } + + /** @return Resource collection API of ProtectionContainerRefreshOperationResults. */ + public ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults() { + if (this.protectionContainerRefreshOperationResults == null) { + this.protectionContainerRefreshOperationResults = + new ProtectionContainerRefreshOperationResultsImpl( + clientObject.getProtectionContainerRefreshOperationResults(), this); + } + return protectionContainerRefreshOperationResults; + } + + /** @return Resource collection API of ProtectableContainers. */ + public ProtectableContainers protectableContainers() { + if (this.protectableContainers == null) { + this.protectableContainers = new ProtectableContainersImpl(clientObject.getProtectableContainers(), this); + } + return protectableContainers; + } + + /** @return Resource collection API of ProtectionContainers. */ + public ProtectionContainers protectionContainers() { + if (this.protectionContainers == null) { + this.protectionContainers = new ProtectionContainersImpl(clientObject.getProtectionContainers(), this); + } + return protectionContainers; + } + + /** @return Resource collection API of BackupWorkloadItems. */ + public BackupWorkloadItems backupWorkloadItems() { + if (this.backupWorkloadItems == null) { + this.backupWorkloadItems = new BackupWorkloadItemsImpl(clientObject.getBackupWorkloadItems(), this); + } + return backupWorkloadItems; + } + + /** @return Resource collection API of ProtectionContainerOperationResults. */ + public ProtectionContainerOperationResults protectionContainerOperationResults() { + if (this.protectionContainerOperationResults == null) { + this.protectionContainerOperationResults = + new ProtectionContainerOperationResultsImpl( + clientObject.getProtectionContainerOperationResults(), this); + } + return protectionContainerOperationResults; + } + + /** @return Resource collection API of Backups. */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(clientObject.getBackups(), this); + } + return backups; + } + + /** @return Resource collection API of ProtectedItemOperationStatuses. */ + public ProtectedItemOperationStatuses protectedItemOperationStatuses() { + if (this.protectedItemOperationStatuses == null) { + this.protectedItemOperationStatuses = + new ProtectedItemOperationStatusesImpl(clientObject.getProtectedItemOperationStatuses(), this); + } + return protectedItemOperationStatuses; + } + + /** @return Resource collection API of ItemLevelRecoveryConnections. */ + public ItemLevelRecoveryConnections itemLevelRecoveryConnections() { + if (this.itemLevelRecoveryConnections == null) { + this.itemLevelRecoveryConnections = + new ItemLevelRecoveryConnectionsImpl(clientObject.getItemLevelRecoveryConnections(), this); + } + return itemLevelRecoveryConnections; + } + + /** @return Resource collection API of BackupOperationResults. */ + public BackupOperationResults backupOperationResults() { + if (this.backupOperationResults == null) { + this.backupOperationResults = + new BackupOperationResultsImpl(clientObject.getBackupOperationResults(), this); + } + return backupOperationResults; + } + + /** @return Resource collection API of BackupOperationStatuses. */ + public BackupOperationStatuses backupOperationStatuses() { + if (this.backupOperationStatuses == null) { + this.backupOperationStatuses = + new BackupOperationStatusesImpl(clientObject.getBackupOperationStatuses(), this); + } + return backupOperationStatuses; + } + + /** @return Resource collection API of ProtectionPolicyOperationStatuses. */ + public ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses() { + if (this.protectionPolicyOperationStatuses == null) { + this.protectionPolicyOperationStatuses = + new ProtectionPolicyOperationStatusesImpl(clientObject.getProtectionPolicyOperationStatuses(), this); + } + return protectionPolicyOperationStatuses; + } + + /** @return Resource collection API of BackupProtectableItems. */ + public BackupProtectableItems backupProtectableItems() { + if (this.backupProtectableItems == null) { + this.backupProtectableItems = + new BackupProtectableItemsImpl(clientObject.getBackupProtectableItems(), this); + } + return backupProtectableItems; + } + + /** @return Resource collection API of BackupProtectionContainers. */ + public BackupProtectionContainers backupProtectionContainers() { + if (this.backupProtectionContainers == null) { + this.backupProtectionContainers = + new BackupProtectionContainersImpl(clientObject.getBackupProtectionContainers(), this); + } + return backupProtectionContainers; + } + + /** @return Resource collection API of SecurityPINs. */ + public SecurityPINs securityPINs() { + if (this.securityPINs == null) { + this.securityPINs = new SecurityPINsImpl(clientObject.getSecurityPINs(), this); + } + return securityPINs; + } + + /** @return Resource collection API of RecoveryPointsRecommendedForMoves. */ + public RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves() { + if (this.recoveryPointsRecommendedForMoves == null) { + this.recoveryPointsRecommendedForMoves = + new RecoveryPointsRecommendedForMovesImpl(clientObject.getRecoveryPointsRecommendedForMoves(), this); + } + return recoveryPointsRecommendedForMoves; + } + + /** @return Resource collection API of AadPropertiesOperations. */ + public AadPropertiesOperations aadPropertiesOperations() { + if (this.aadPropertiesOperations == null) { + this.aadPropertiesOperations = + new AadPropertiesOperationsImpl(clientObject.getAadPropertiesOperations(), this); + } + return aadPropertiesOperations; + } + + /** @return Resource collection API of CrossRegionRestores. */ + public CrossRegionRestores crossRegionRestores() { + if (this.crossRegionRestores == null) { + this.crossRegionRestores = new CrossRegionRestoresImpl(clientObject.getCrossRegionRestores(), this); + } + return crossRegionRestores; + } + + /** @return Resource collection API of BackupCrrJobDetails. */ + public BackupCrrJobDetails backupCrrJobDetails() { + if (this.backupCrrJobDetails == null) { + this.backupCrrJobDetails = new BackupCrrJobDetailsImpl(clientObject.getBackupCrrJobDetails(), this); + } + return backupCrrJobDetails; + } + + /** @return Resource collection API of BackupCrrJobs. */ + public BackupCrrJobs backupCrrJobs() { + if (this.backupCrrJobs == null) { + this.backupCrrJobs = new BackupCrrJobsImpl(clientObject.getBackupCrrJobs(), this); + } + return backupCrrJobs; + } + + /** @return Resource collection API of CrrOperationResults. */ + public CrrOperationResults crrOperationResults() { + if (this.crrOperationResults == null) { + this.crrOperationResults = new CrrOperationResultsImpl(clientObject.getCrrOperationResults(), this); + } + return crrOperationResults; + } + + /** @return Resource collection API of CrrOperationStatus. */ + public CrrOperationStatus crrOperationStatus() { + if (this.crrOperationStatus == null) { + this.crrOperationStatus = new CrrOperationStatusImpl(clientObject.getCrrOperationStatus(), this); + } + return crrOperationStatus; + } + + /** @return Resource collection API of BackupResourceStorageConfigs. */ + public BackupResourceStorageConfigs backupResourceStorageConfigs() { + if (this.backupResourceStorageConfigs == null) { + this.backupResourceStorageConfigs = + new BackupResourceStorageConfigsImpl(clientObject.getBackupResourceStorageConfigs(), this); + } + return backupResourceStorageConfigs; + } + + /** @return Resource collection API of RecoveryPointsCrrs. */ + public RecoveryPointsCrrs recoveryPointsCrrs() { + if (this.recoveryPointsCrrs == null) { + this.recoveryPointsCrrs = new RecoveryPointsCrrsImpl(clientObject.getRecoveryPointsCrrs(), this); + } + return recoveryPointsCrrs; + } + + /** @return Resource collection API of BackupProtectedItemsCrrs. */ + public BackupProtectedItemsCrrs backupProtectedItemsCrrs() { + if (this.backupProtectedItemsCrrs == null) { + this.backupProtectedItemsCrrs = + new BackupProtectedItemsCrrsImpl(clientObject.getBackupProtectedItemsCrrs(), this); + } + return backupProtectedItemsCrrs; + } + + /** @return Resource collection API of ProtectionIntents. */ + public ProtectionIntents protectionIntents() { + if (this.protectionIntents == null) { + this.protectionIntents = new ProtectionIntentsImpl(clientObject.getProtectionIntents(), this); + } + return protectionIntents; + } + + /** @return Resource collection API of BackupStatus. */ + public BackupStatus backupStatus() { + if (this.backupStatus == null) { + this.backupStatus = new BackupStatusImpl(clientObject.getBackupStatus(), this); + } + return backupStatus; + } + + /** @return Resource collection API of FeatureSupports. */ + public FeatureSupports featureSupports() { + if (this.featureSupports == null) { + this.featureSupports = new FeatureSupportsImpl(clientObject.getFeatureSupports(), this); + } + return featureSupports; + } + + /** @return Resource collection API of BackupProtectionIntents. */ + public BackupProtectionIntents backupProtectionIntents() { + if (this.backupProtectionIntents == null) { + this.backupProtectionIntents = + new BackupProtectionIntentsImpl(clientObject.getBackupProtectionIntents(), this); + } + return backupProtectionIntents; + } + + /** @return Resource collection API of BackupUsageSummaries. */ + public BackupUsageSummaries backupUsageSummaries() { + if (this.backupUsageSummaries == null) { + this.backupUsageSummaries = new BackupUsageSummariesImpl(clientObject.getBackupUsageSummaries(), this); + } + return backupUsageSummaries; + } + + /** @return Resource collection API of OperationsOperations. */ + public OperationsOperations operationsOperations() { + if (this.operationsOperations == null) { + this.operationsOperations = new OperationsOperationsImpl(clientObject.getOperationsOperations(), this); + } + return operationsOperations; + } + + /** + * @return Wrapped service client RecoveryServicesBackupClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public RecoveryServicesBackupClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.java new file mode 100644 index 0000000000000..5a5f7431a9eaa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/AadPropertiesOperationsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; + +/** An instance of this class provides access to all the operations defined in AadPropertiesOperationsClient. */ +public interface AadPropertiesOperationsClient { + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AadPropertiesResourceInner get(String azureRegion); + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.java new file mode 100644 index 0000000000000..c5c5b84baf21c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobDetailsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; + +/** An instance of this class provides access to all the operations defined in BackupCrrJobDetailsClient. */ +public interface BackupCrrJobDetailsClient { + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobResourceInner get(String azureRegion, CrrJobRequest parameters); + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.java new file mode 100644 index 0000000000000..2f119b05a218b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupCrrJobsClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; + +/** An instance of this class provides access to all the operations defined in BackupCrrJobsClient. */ +public interface BackupCrrJobsClient { + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String azureRegion, CrrJobRequest parameters); + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java new file mode 100644 index 0000000000000..ece131b53fe10 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupEnginesClient. */ +public interface BackupEnginesClient { + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName); + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String backupEngineName, + String filter, + String skipToken, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java new file mode 100644 index 0000000000000..c3236f4ef44d9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupJobsClient. */ +public interface BackupJobsClient { + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java new file mode 100644 index 0000000000000..efa15dd900c51 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** An instance of this class provides access to all the operations defined in BackupOperationResultsClient. */ +public interface BackupOperationResultsClient { + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String vaultName, String resourceGroupName, String operationId); + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java new file mode 100644 index 0000000000000..e02edfa9f241f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in BackupOperationStatusesClient. */ +public interface BackupOperationStatusesClient { + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java new file mode 100644 index 0000000000000..7c4b5689d4d94 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ +public interface BackupPoliciesClient { + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java new file mode 100644 index 0000000000000..ba0d9d66ee339 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupProtectableItemsClient. */ +public interface BackupProtectableItemsClient { + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java new file mode 100644 index 0000000000000..b00a0d24f856b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupProtectedItemsClient. */ +public interface BackupProtectedItemsClient { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java new file mode 100644 index 0000000000000..c6a27d9105b0b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsCrrsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupProtectedItemsCrrsClient. */ +public interface BackupProtectedItemsCrrsClient { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java new file mode 100644 index 0000000000000..bb350177a2951 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupProtectionContainersClient. */ +public interface BackupProtectionContainersClient { + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java new file mode 100644 index 0000000000000..d4551f9d2418e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupProtectionIntentsClient. */ +public interface BackupProtectionIntentsClient { + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java new file mode 100644 index 0000000000000..f3a81d0a093f3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. */ +public interface BackupResourceEncryptionConfigsClient { + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceEncryptionConfigResourceInner get(String vaultName, String resourceGroupName); + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, Context context); + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters); + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceEncryptionConfigResourceInner parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.java new file mode 100644 index 0000000000000..bade3bb243375 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsClient. */ +public interface BackupResourceStorageConfigsClient { + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceConfigResourceInner get(String vaultName, String resourceGroupName); + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, Context context); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceConfigResourceInner update( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java new file mode 100644 index 0000000000000..c0764d3b3788a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupResourceVaultConfigsClient. */ +public interface BackupResourceVaultConfigsClient { + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceVaultConfigResourceInner get(String vaultName, String resourceGroupName); + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, Context context); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceVaultConfigResourceInner update( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, Context context); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceVaultConfigResourceInner put( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java new file mode 100644 index 0000000000000..5949293c1695e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; + +/** An instance of this class provides access to all the operations defined in BackupStatusClient. */ +public interface BackupStatusClient { + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupStatusResponseInner get(String azureRegion, BackupStatusRequest parameters); + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String azureRegion, BackupStatusRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java new file mode 100644 index 0000000000000..ef9b4b1040002 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; + +/** An instance of this class provides access to all the operations defined in BackupUsageSummariesClient. */ +public interface BackupUsageSummariesClient { + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java new file mode 100644 index 0000000000000..78a40f032db3b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; + +/** An instance of this class provides access to all the operations defined in BackupWorkloadItemsClient. */ +public interface BackupWorkloadItemsClient { + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java new file mode 100644 index 0000000000000..d77df5429027f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.models.BackupRequestResource; + +/** An instance of this class provides access to all the operations defined in BackupsClient. */ +public interface BackupsClient { + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters); + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response triggerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java new file mode 100644 index 0000000000000..56a4281def008 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; + +/** + * An instance of this class provides access to all the operations defined in BmsPrepareDataMoveOperationResultsClient. + */ +public interface BmsPrepareDataMoveOperationResultsClient { + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultStorageConfigOperationResultResponseInner get(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java new file mode 100644 index 0000000000000..205895fb11ea4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossRegionRestoresClient.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestoreRequest; + +/** An instance of this class provides access to all the operations defined in CrossRegionRestoresClient. */ +public interface CrossRegionRestoresClient { + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTrigger(String azureRegion, CrossRegionRestoreRequest parameters); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTrigger( + String azureRegion, CrossRegionRestoreRequest parameters, Context context); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String azureRegion, CrossRegionRestoreRequest parameters); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java new file mode 100644 index 0000000000000..7a7e412099f7c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationResultsClient.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** An instance of this class provides access to all the operations defined in CrrOperationResultsClient. */ +public interface CrrOperationResultsClient { + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String azureRegion, String operationId); + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.java new file mode 100644 index 0000000000000..4ebd835ffe0f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrrOperationStatusClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in CrrOperationStatusClient. */ +public interface CrrOperationStatusClient { + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String azureRegion, String operationId); + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String azureRegion, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java new file mode 100644 index 0000000000000..bbeea6859e666 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; + +/** An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. */ +public interface ExportJobsOperationResultsClient { + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultInfoBaseResourceInner get(String vaultName, String resourceGroupName, String operationId); + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java new file mode 100644 index 0000000000000..d61578d11ae23 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; + +/** An instance of this class provides access to all the operations defined in FeatureSupportsClient. */ +public interface FeatureSupportsClient { + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureVMResourceFeatureSupportResponseInner validate(String azureRegion, FeatureSupportRequest parameters); + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String azureRegion, FeatureSupportRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java new file mode 100644 index 0000000000000..c07e2975602fd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.IlrRequestResource; + +/** An instance of this class provides access to all the operations defined in ItemLevelRecoveryConnectionsClient. */ +public interface ItemLevelRecoveryConnectionsClient { + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void provision( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters); + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response provisionWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters, + Context context); + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revoke( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId); + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revokeWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java new file mode 100644 index 0000000000000..fcce8ba4d74b0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.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.recoveryservicesbackup.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; + +/** An instance of this class provides access to all the operations defined in JobCancellationsClient. */ +public interface JobCancellationsClient { + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String vaultName, String resourceGroupName, String jobName); + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java new file mode 100644 index 0000000000000..eafbd31563caa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.JobResourceInner; + +/** An instance of this class provides access to all the operations defined in JobDetailsClient. */ +public interface JobDetailsClient { + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobResourceInner get(String vaultName, String resourceGroupName, String jobName); + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java new file mode 100644 index 0000000000000..9a260eb3d74a4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** An instance of this class provides access to all the operations defined in JobOperationResultsClient. */ +public interface JobOperationResultsClient { + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String vaultName, String resourceGroupName, String jobName, String operationId); + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java new file mode 100644 index 0000000000000..08bb167037d0d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.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.recoveryservicesbackup.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; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public interface JobsClient { + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void export(String vaultName, String resourceGroupName); + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportWithResponse(String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java new file mode 100644 index 0000000000000..81d4d9b71a78f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationsResponseInner validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters); + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.java new file mode 100644 index 0000000000000..69497872e4fa0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsOperationsClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; + +/** An instance of this class provides access to all the operations defined in OperationsOperationsClient. */ +public interface OperationsOperationsClient { + /** + * Returns the list of available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns the list of available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..3aeaf4c01a7f5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner get( + String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters); + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context); + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner put( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters); + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionResourceInner put( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java new file mode 100644 index 0000000000000..5ea4b56039669 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointsClient. */ +public interface PrivateEndpointsClient { + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation 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 operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner getOperationStatus( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId); + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation 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 operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOperationStatusWithResponse( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java new file mode 100644 index 0000000000000..56c872748deb8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; + +/** An instance of this class provides access to all the operations defined in ProtectableContainersClient. */ +public interface ProtectableContainersClient { + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName 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 list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName); + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java new file mode 100644 index 0000000000000..0a3d66dac4df2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationResultsClient. */ +public interface ProtectedItemOperationResultsClient { + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemResourceInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId); + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java new file mode 100644 index 0000000000000..43f8579559d96 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusesClient. */ +public interface ProtectedItemOperationStatusesClient { + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId); + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java new file mode 100644 index 0000000000000..f3791d7c3e99d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** An instance of this class provides access to all the operations defined in ProtectedItemsClient. */ +public interface ProtectedItemsClient { + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemResourceInner createOrUpdate( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters); + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters, + Context context); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java new file mode 100644 index 0000000000000..d99b36fc10da8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ProtectionContainerOperationResultsClient. + */ +public interface ProtectionContainerOperationResultsClient { + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId); + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java new file mode 100644 index 0000000000000..6df731ab73bff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectionContainerRefreshOperationResultsClient. + */ +public interface ProtectionContainerRefreshOperationResultsClient { + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String vaultName, String resourceGroupName, String fabricName, String operationId); + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java new file mode 100644 index 0000000000000..8098d46a28159 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; + +/** An instance of this class provides access to all the operations defined in ProtectionContainersClient. */ +public interface ProtectionContainersClient { + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context); + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionContainerResourceInner register( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters); + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for 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 base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response registerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters, + Context context); + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response unregisterWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context); + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response inquireWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + Context context); + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void refresh(String vaultName, String resourceGroupName, String fabricName); + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response refreshWithResponse( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java new file mode 100644 index 0000000000000..fe9a828426732 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; + +/** An instance of this class provides access to all the operations defined in ProtectionIntentsClient. */ +public interface ProtectionIntentsClient { + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PreValidateEnableBackupResponseInner validate(String azureRegion, PreValidateEnableBackupRequest parameters); + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String azureRegion, PreValidateEnableBackupRequest parameters, Context context); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionIntentResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context); + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionIntentResourceInner createOrUpdate( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters); + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters, + Context context); + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName); + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java new file mode 100644 index 0000000000000..c3b32d225f8f2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; + +/** An instance of this class provides access to all the operations defined in ProtectionPoliciesClient. */ +public interface ProtectionPoliciesClient { + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName); + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, Context context); + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionPolicyResourceInner createOrUpdate( + String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters); + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String policyName, + ProtectionPolicyResourceInner parameters, + Context context); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, String policyName); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String policyName, Context context); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vaultName, String resourceGroupName, String policyName); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String vaultName, String resourceGroupName, String policyName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java new file mode 100644 index 0000000000000..a9bf770534ebc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationResultsClient. + */ +public interface ProtectionPolicyOperationResultsClient { + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectionPolicyResourceInner get( + String vaultName, String resourceGroupName, String policyName, String operationId); + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java new file mode 100644 index 0000000000000..12df7f98e31ee --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationStatusesClient. + */ +public interface ProtectionPolicyOperationStatusesClient { + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String vaultName, String resourceGroupName, String policyName, String operationId); + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java new file mode 100644 index 0000000000000..37306762572bc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public interface RecoveryPointsClient { + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPointResourceInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId); + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CrrAccessTokenResourceInner getAccessToken( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAccessTokenWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.java new file mode 100644 index 0000000000000..aec79d56dfecb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsCrrsClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsCrrsClient. */ +public interface RecoveryPointsCrrsClient { + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java new file mode 100644 index 0000000000000..102993ff1a865 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsRecommendedForMovesClient. + */ +public interface RecoveryPointsRecommendedForMovesClient { + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters); + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java new file mode 100644 index 0000000000000..3c47df3873806 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupClient.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for RecoveryServicesBackupClient class. */ +public interface RecoveryServicesBackupClient { + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * 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 BackupResourceVaultConfigsClient object to access its operations. + * + * @return the BackupResourceVaultConfigsClient object. + */ + BackupResourceVaultConfigsClient getBackupResourceVaultConfigs(); + + /** + * Gets the BackupResourceEncryptionConfigsClient object to access its operations. + * + * @return the BackupResourceEncryptionConfigsClient object. + */ + BackupResourceEncryptionConfigsClient getBackupResourceEncryptionConfigs(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateEndpointsClient object to access its operations. + * + * @return the PrivateEndpointsClient object. + */ + PrivateEndpointsClient getPrivateEndpoints(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the BmsPrepareDataMoveOperationResultsClient object to access its operations. + * + * @return the BmsPrepareDataMoveOperationResultsClient object. + */ + BmsPrepareDataMoveOperationResultsClient getBmsPrepareDataMoveOperationResults(); + + /** + * Gets the ProtectedItemsClient object to access its operations. + * + * @return the ProtectedItemsClient object. + */ + ProtectedItemsClient getProtectedItems(); + + /** + * Gets the ProtectedItemOperationResultsClient object to access its operations. + * + * @return the ProtectedItemOperationResultsClient object. + */ + ProtectedItemOperationResultsClient getProtectedItemOperationResults(); + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + RecoveryPointsClient getRecoveryPoints(); + + /** + * Gets the RestoresClient object to access its operations. + * + * @return the RestoresClient object. + */ + RestoresClient getRestores(); + + /** + * Gets the BackupPoliciesClient object to access its operations. + * + * @return the BackupPoliciesClient object. + */ + BackupPoliciesClient getBackupPolicies(); + + /** + * Gets the ProtectionPoliciesClient object to access its operations. + * + * @return the ProtectionPoliciesClient object. + */ + ProtectionPoliciesClient getProtectionPolicies(); + + /** + * Gets the ProtectionPolicyOperationResultsClient object to access its operations. + * + * @return the ProtectionPolicyOperationResultsClient object. + */ + ProtectionPolicyOperationResultsClient getProtectionPolicyOperationResults(); + + /** + * Gets the BackupJobsClient object to access its operations. + * + * @return the BackupJobsClient object. + */ + BackupJobsClient getBackupJobs(); + + /** + * Gets the JobDetailsClient object to access its operations. + * + * @return the JobDetailsClient object. + */ + JobDetailsClient getJobDetails(); + + /** + * Gets the JobCancellationsClient object to access its operations. + * + * @return the JobCancellationsClient object. + */ + JobCancellationsClient getJobCancellations(); + + /** + * Gets the JobOperationResultsClient object to access its operations. + * + * @return the JobOperationResultsClient object. + */ + JobOperationResultsClient getJobOperationResults(); + + /** + * Gets the ExportJobsOperationResultsClient object to access its operations. + * + * @return the ExportJobsOperationResultsClient object. + */ + ExportJobsOperationResultsClient getExportJobsOperationResults(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the BackupProtectedItemsClient object to access its operations. + * + * @return the BackupProtectedItemsClient object. + */ + BackupProtectedItemsClient getBackupProtectedItems(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the BackupEnginesClient object to access its operations. + * + * @return the BackupEnginesClient object. + */ + BackupEnginesClient getBackupEngines(); + + /** + * Gets the ProtectionContainerRefreshOperationResultsClient object to access its operations. + * + * @return the ProtectionContainerRefreshOperationResultsClient object. + */ + ProtectionContainerRefreshOperationResultsClient getProtectionContainerRefreshOperationResults(); + + /** + * Gets the ProtectableContainersClient object to access its operations. + * + * @return the ProtectableContainersClient object. + */ + ProtectableContainersClient getProtectableContainers(); + + /** + * Gets the ProtectionContainersClient object to access its operations. + * + * @return the ProtectionContainersClient object. + */ + ProtectionContainersClient getProtectionContainers(); + + /** + * Gets the BackupWorkloadItemsClient object to access its operations. + * + * @return the BackupWorkloadItemsClient object. + */ + BackupWorkloadItemsClient getBackupWorkloadItems(); + + /** + * Gets the ProtectionContainerOperationResultsClient object to access its operations. + * + * @return the ProtectionContainerOperationResultsClient object. + */ + ProtectionContainerOperationResultsClient getProtectionContainerOperationResults(); + + /** + * Gets the BackupsClient object to access its operations. + * + * @return the BackupsClient object. + */ + BackupsClient getBackups(); + + /** + * Gets the ProtectedItemOperationStatusesClient object to access its operations. + * + * @return the ProtectedItemOperationStatusesClient object. + */ + ProtectedItemOperationStatusesClient getProtectedItemOperationStatuses(); + + /** + * Gets the ItemLevelRecoveryConnectionsClient object to access its operations. + * + * @return the ItemLevelRecoveryConnectionsClient object. + */ + ItemLevelRecoveryConnectionsClient getItemLevelRecoveryConnections(); + + /** + * Gets the BackupOperationResultsClient object to access its operations. + * + * @return the BackupOperationResultsClient object. + */ + BackupOperationResultsClient getBackupOperationResults(); + + /** + * Gets the BackupOperationStatusesClient object to access its operations. + * + * @return the BackupOperationStatusesClient object. + */ + BackupOperationStatusesClient getBackupOperationStatuses(); + + /** + * Gets the ProtectionPolicyOperationStatusesClient object to access its operations. + * + * @return the ProtectionPolicyOperationStatusesClient object. + */ + ProtectionPolicyOperationStatusesClient getProtectionPolicyOperationStatuses(); + + /** + * Gets the BackupProtectableItemsClient object to access its operations. + * + * @return the BackupProtectableItemsClient object. + */ + BackupProtectableItemsClient getBackupProtectableItems(); + + /** + * Gets the BackupProtectionContainersClient object to access its operations. + * + * @return the BackupProtectionContainersClient object. + */ + BackupProtectionContainersClient getBackupProtectionContainers(); + + /** + * Gets the SecurityPINsClient object to access its operations. + * + * @return the SecurityPINsClient object. + */ + SecurityPINsClient getSecurityPINs(); + + /** + * Gets the RecoveryPointsRecommendedForMovesClient object to access its operations. + * + * @return the RecoveryPointsRecommendedForMovesClient object. + */ + RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMoves(); + + /** + * Gets the AadPropertiesOperationsClient object to access its operations. + * + * @return the AadPropertiesOperationsClient object. + */ + AadPropertiesOperationsClient getAadPropertiesOperations(); + + /** + * Gets the CrossRegionRestoresClient object to access its operations. + * + * @return the CrossRegionRestoresClient object. + */ + CrossRegionRestoresClient getCrossRegionRestores(); + + /** + * Gets the BackupCrrJobDetailsClient object to access its operations. + * + * @return the BackupCrrJobDetailsClient object. + */ + BackupCrrJobDetailsClient getBackupCrrJobDetails(); + + /** + * Gets the BackupCrrJobsClient object to access its operations. + * + * @return the BackupCrrJobsClient object. + */ + BackupCrrJobsClient getBackupCrrJobs(); + + /** + * Gets the CrrOperationResultsClient object to access its operations. + * + * @return the CrrOperationResultsClient object. + */ + CrrOperationResultsClient getCrrOperationResults(); + + /** + * Gets the CrrOperationStatusClient object to access its operations. + * + * @return the CrrOperationStatusClient object. + */ + CrrOperationStatusClient getCrrOperationStatus(); + + /** + * Gets the BackupResourceStorageConfigsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsClient object. + */ + BackupResourceStorageConfigsClient getBackupResourceStorageConfigs(); + + /** + * Gets the RecoveryPointsCrrsClient object to access its operations. + * + * @return the RecoveryPointsCrrsClient object. + */ + RecoveryPointsCrrsClient getRecoveryPointsCrrs(); + + /** + * Gets the BackupProtectedItemsCrrsClient object to access its operations. + * + * @return the BackupProtectedItemsCrrsClient object. + */ + BackupProtectedItemsCrrsClient getBackupProtectedItemsCrrs(); + + /** + * Gets the ProtectionIntentsClient object to access its operations. + * + * @return the ProtectionIntentsClient object. + */ + ProtectionIntentsClient getProtectionIntents(); + + /** + * Gets the BackupStatusClient object to access its operations. + * + * @return the BackupStatusClient object. + */ + BackupStatusClient getBackupStatus(); + + /** + * Gets the FeatureSupportsClient object to access its operations. + * + * @return the FeatureSupportsClient object. + */ + FeatureSupportsClient getFeatureSupports(); + + /** + * Gets the BackupProtectionIntentsClient object to access its operations. + * + * @return the BackupProtectionIntentsClient object. + */ + BackupProtectionIntentsClient getBackupProtectionIntents(); + + /** + * Gets the BackupUsageSummariesClient object to access its operations. + * + * @return the BackupUsageSummariesClient object. + */ + BackupUsageSummariesClient getBackupUsageSummaries(); + + /** + * Gets the OperationsOperationsClient object to access its operations. + * + * @return the OperationsOperationsClient object. + */ + OperationsOperationsClient getOperationsOperations(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..3b758f9f69e2f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOperationStatusWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void bmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void bmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginMoveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginMoveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java new file mode 100644 index 0000000000000..de7f8b5894512 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.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.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; + +/** An instance of this class provides access to all the operations defined in RestoresClient. */ +public interface RestoresClient { + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTrigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters); + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTrigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context); + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters); + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java new file mode 100644 index 0000000000000..6365bdedc379e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.models.TokenInformationInner; + +/** An instance of this class provides access to all the operations defined in SecurityPINsClient. */ +public interface SecurityPINsClient { + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInformationInner get(String vaultName, String resourceGroupName); + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String vaultName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java new file mode 100644 index 0000000000000..bc98b5015b8a0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AadPropertiesResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.AadProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The AadPropertiesResource model. */ +@Fluent +public final class AadPropertiesResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadPropertiesResourceInner.class); + + /* + * AADPropertiesResource properties + */ + @JsonProperty(value = "properties") + private AadProperties properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: AADPropertiesResource properties. + * + * @return the properties value. + */ + public AadProperties properties() { + return this.properties; + } + + /** + * Set the properties property: AADPropertiesResource properties. + * + * @param properties the properties value to set. + * @return the AadPropertiesResourceInner object itself. + */ + public AadPropertiesResourceInner withProperties(AadProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the AadPropertiesResourceInner object itself. + */ + public AadPropertiesResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public AadPropertiesResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AadPropertiesResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java new file mode 100644 index 0000000000000..269f01dfa15cd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.SupportStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for feature support requests for Azure IaasVm. */ +@Fluent +public final class AzureVMResourceFeatureSupportResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMResourceFeatureSupportResponseInner.class); + + /* + * Support status of feature + */ + @JsonProperty(value = "supportStatus") + private SupportStatus supportStatus; + + /** + * Get the supportStatus property: Support status of feature. + * + * @return the supportStatus value. + */ + public SupportStatus supportStatus() { + return this.supportStatus; + } + + /** + * Set the supportStatus property: Support status of feature. + * + * @param supportStatus the supportStatus value to set. + * @return the AzureVMResourceFeatureSupportResponseInner object itself. + */ + public AzureVMResourceFeatureSupportResponseInner withSupportStatus(SupportStatus supportStatus) { + this.supportStatus = supportStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java new file mode 100644 index 0000000000000..5aa3a3284b550 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.BackupEngineBase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The base backup engine class. All workload specific backup engines derive from this class. */ +@Fluent +public final class BackupEngineBaseResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupEngineBaseResourceInner.class); + + /* + * BackupEngineBaseResource properties + */ + @JsonProperty(value = "properties") + private BackupEngineBase properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: BackupEngineBaseResource properties. + * + * @return the properties value. + */ + public BackupEngineBase properties() { + return this.properties; + } + + /** + * Set the properties property: BackupEngineBaseResource properties. + * + * @param properties the properties value to set. + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withProperties(BackupEngineBase properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupEngineBaseResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupEngineBaseResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java new file mode 100644 index 0000000000000..f04ef49104d2b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.NameInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.UsagesUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Backup management usages of a vault. */ +@Fluent +public final class BackupManagementUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupManagementUsageInner.class); + + /* + * Unit of the usage. + */ + @JsonProperty(value = "unit") + private UsagesUnit unit; + + /* + * Quota period of usage. + */ + @JsonProperty(value = "quotaPeriod") + private String quotaPeriod; + + /* + * Next reset time of usage. + */ + @JsonProperty(value = "nextResetTime") + private OffsetDateTime nextResetTime; + + /* + * Current value of usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * Limit of usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * Name of usage. + */ + @JsonProperty(value = "name") + private NameInfo name; + + /** + * Get the unit property: Unit of the usage. + * + * @return the unit value. + */ + public UsagesUnit unit() { + return this.unit; + } + + /** + * Set the unit property: Unit of the usage. + * + * @param unit the unit value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withUnit(UsagesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the quotaPeriod property: Quota period of usage. + * + * @return the quotaPeriod value. + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Set the quotaPeriod property: Quota period of usage. + * + * @param quotaPeriod the quotaPeriod value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withQuotaPeriod(String quotaPeriod) { + this.quotaPeriod = quotaPeriod; + return this; + } + + /** + * Get the nextResetTime property: Next reset time of usage. + * + * @return the nextResetTime value. + */ + public OffsetDateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Set the nextResetTime property: Next reset time of usage. + * + * @param nextResetTime the nextResetTime value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withNextResetTime(OffsetDateTime nextResetTime) { + this.nextResetTime = nextResetTime; + return this; + } + + /** + * Get the currentValue property: Current value of usage. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current value of usage. + * + * @param currentValue the currentValue value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: Limit of usage. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: Limit of usage. + * + * @param limit the limit value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: Name of usage. + * + * @return the name value. + */ + public NameInfo name() { + return this.name; + } + + /** + * Set the name property: Name of usage. + * + * @param name the name value to set. + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withName(NameInfo name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java new file mode 100644 index 0000000000000..6bdfc58c9455f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.BackupResourceConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The resource storage details. */ +@Fluent +public final class BackupResourceConfigResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceConfigResourceInner.class); + + /* + * BackupResourceConfigResource properties + */ + @JsonProperty(value = "properties") + private BackupResourceConfig properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: BackupResourceConfigResource properties. + * + * @return the properties value. + */ + public BackupResourceConfig properties() { + return this.properties; + } + + /** + * Set the properties property: BackupResourceConfigResource properties. + * + * @param properties the properties value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withProperties(BackupResourceConfig properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the BackupResourceConfigResourceInner object itself. + */ + public BackupResourceConfigResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceConfigResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceConfigResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java new file mode 100644 index 0000000000000..13013f6d80689 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.BackupResourceEncryptionConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The BackupResourceEncryptionConfigResource model. */ +@Fluent +public final class BackupResourceEncryptionConfigResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigResourceInner.class); + + /* + * BackupResourceEncryptionConfigResource properties + */ + @JsonProperty(value = "properties") + private BackupResourceEncryptionConfig properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: BackupResourceEncryptionConfigResource properties. + * + * @return the properties value. + */ + public BackupResourceEncryptionConfig properties() { + return this.properties; + } + + /** + * Set the properties property: BackupResourceEncryptionConfigResource properties. + * + * @param properties the properties value to set. + * @return the BackupResourceEncryptionConfigResourceInner object itself. + */ + public BackupResourceEncryptionConfigResourceInner withProperties(BackupResourceEncryptionConfig properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the BackupResourceEncryptionConfigResourceInner object itself. + */ + public BackupResourceEncryptionConfigResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceEncryptionConfigResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java new file mode 100644 index 0000000000000..3b9884e2807a4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Backup resource vault config details. */ +@Fluent +public final class BackupResourceVaultConfigResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceVaultConfigResourceInner.class); + + /* + * BackupResourceVaultConfigResource properties + */ + @JsonProperty(value = "properties") + private BackupResourceVaultConfig properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: BackupResourceVaultConfigResource properties. + * + * @return the properties value. + */ + public BackupResourceVaultConfig properties() { + return this.properties; + } + + /** + * Set the properties property: BackupResourceVaultConfigResource properties. + * + * @param properties the properties value to set. + * @return the BackupResourceVaultConfigResourceInner object itself. + */ + public BackupResourceVaultConfigResourceInner withProperties(BackupResourceVaultConfig properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the BackupResourceVaultConfigResourceInner object itself. + */ + public BackupResourceVaultConfigResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceVaultConfigResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupResourceVaultConfigResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java new file mode 100644 index 0000000000000..710cd4fd9fb33 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.FabricName; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BackupStatus response. */ +@Fluent +public final class BackupStatusResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupStatusResponseInner.class); + + /* + * Specifies whether the container is registered or not + */ + @JsonProperty(value = "protectionStatus") + private ProtectionStatus protectionStatus; + + /* + * Specifies the arm resource id of the vault + */ + @JsonProperty(value = "vaultId") + private String vaultId; + + /* + * Specifies the fabric name - Azure or AD + */ + @JsonProperty(value = "fabricName") + private FabricName fabricName; + + /* + * Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;csname;vmname. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;csname;vmname. + */ + @JsonProperty(value = "protectedItemName") + private String protectedItemName; + + /* + * ErrorCode in case of intent failed + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * ErrorMessage in case of intent failed. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Specifies the policy name which is used for protection + */ + @JsonProperty(value = "policyName") + private String policyName; + + /* + * Container registration status + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * Get the protectionStatus property: Specifies whether the container is registered or not. + * + * @return the protectionStatus value. + */ + public ProtectionStatus protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Specifies whether the container is registered or not. + * + * @param protectionStatus the protectionStatus value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withProtectionStatus(ProtectionStatus protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the vaultId property: Specifies the arm resource id of the vault. + * + * @return the vaultId value. + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set the vaultId property: Specifies the arm resource id of the vault. + * + * @param vaultId the vaultId value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get the fabricName property: Specifies the fabric name - Azure or AD. + * + * @return the fabricName value. + */ + public FabricName fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: Specifies the fabric name - Azure or AD. + * + * @param fabricName the fabricName value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withFabricName(FabricName fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;csname;vmname. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;csname;vmname. + * + * @param containerName the containerName value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;csname;vmname. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Set the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;csname;vmname. + * + * @param protectedItemName the protectedItemName value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withProtectedItemName(String protectedItemName) { + this.protectedItemName = protectedItemName; + return this; + } + + /** + * Get the errorCode property: ErrorCode in case of intent failed. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: ErrorCode in case of intent failed. + * + * @param errorCode the errorCode value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: ErrorMessage in case of intent failed. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: ErrorMessage in case of intent failed. + * + * @param errorMessage the errorMessage value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the policyName property: Specifies the policy name which is used for protection. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Specifies the policy name which is used for protection. + * + * @param policyName the policyName value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the registrationStatus property: Container registration status. + * + * @return the registrationStatus value. + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set the registrationStatus property: Container registration status. + * + * @param registrationStatus the registrationStatus value to set. + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java new file mode 100644 index 0000000000000..082db679fb8e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryDisplay; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Available operation details. */ +@Fluent +public final class ClientDiscoveryValueForSingleApiInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryValueForSingleApiInner.class); + + /* + * Name of the Operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Contains the localized display information for this particular operation + */ + @JsonProperty(value = "display") + private ClientDiscoveryDisplay display; + + /* + * The intended executor of the operation;governs the display of the + * operation in the RBAC UX and the audit logs UX + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * ShoeBox properties for the given operation. + */ + @JsonProperty(value = "properties") + private ClientDiscoveryForProperties properties; + + /** + * Get the name property: Name of the Operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Operation. + * + * @param name the name value to set. + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Contains the localized display information for this particular operation. + * + * @return the display value. + */ + public ClientDiscoveryDisplay display() { + return this.display; + } + + /** + * Set the display property: Contains the localized display information for this particular operation. + * + * @param display the display value to set. + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withDisplay(ClientDiscoveryDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation;governs the display of the operation in the RBAC + * UX and the audit logs UX. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation;governs the display of the operation in the RBAC + * UX and the audit logs UX. + * + * @param origin the origin value to set. + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: ShoeBox properties for the given operation. + * + * @return the properties value. + */ + public ClientDiscoveryForProperties properties() { + return this.properties; + } + + /** + * Set the properties property: ShoeBox properties for the given operation. + * + * @param properties the properties value to set. + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withProperties(ClientDiscoveryForProperties 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(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java new file mode 100644 index 0000000000000..0cd561edb40c8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrrAccessTokenResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.CrrAccessToken; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The CrrAccessTokenResource model. */ +@Fluent +public final class CrrAccessTokenResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrAccessTokenResourceInner.class); + + /* + * CrrAccessTokenResource properties + */ + @JsonProperty(value = "properties") + private CrrAccessToken properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: CrrAccessTokenResource properties. + * + * @return the properties value. + */ + public CrrAccessToken properties() { + return this.properties; + } + + /** + * Set the properties property: CrrAccessTokenResource properties. + * + * @param properties the properties value to set. + * @return the CrrAccessTokenResourceInner object itself. + */ + public CrrAccessTokenResourceInner withProperties(CrrAccessToken properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the CrrAccessTokenResourceInner object itself. + */ + public CrrAccessTokenResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public CrrAccessTokenResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CrrAccessTokenResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java new file mode 100644 index 0000000000000..72455badea161 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.Job; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines workload agnostic properties for a job. */ +@Fluent +public final class JobResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceInner.class); + + /* + * JobResource properties + */ + @JsonProperty(value = "properties") + private Job properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: JobResource properties. + * + * @return the properties value. + */ + public Job properties() { + return this.properties; + } + + /** + * Set the properties property: JobResource properties. + * + * @param properties the properties value to set. + * @return the JobResourceInner object itself. + */ + public JobResourceInner withProperties(Job properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the JobResourceInner object itself. + */ + public JobResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java new file mode 100644 index 0000000000000..5837812b445e8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.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.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.HttpStatusCode; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBase; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationWorkerResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Base class for operation result info. */ +@Fluent +public final class OperationResultInfoBaseResourceInner extends OperationWorkerResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInfoBaseResourceInner.class); + + /* + * OperationResultInfoBaseResource operation + */ + @JsonProperty(value = "operation") + private OperationResultInfoBase operation; + + /** + * Get the operation property: OperationResultInfoBaseResource operation. + * + * @return the operation value. + */ + public OperationResultInfoBase operation() { + return this.operation; + } + + /** + * Set the operation property: OperationResultInfoBaseResource operation. + * + * @param operation the operation value to set. + * @return the OperationResultInfoBaseResourceInner object itself. + */ + public OperationResultInfoBaseResourceInner withOperation(OperationResultInfoBase operation) { + this.operation = operation; + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationResultInfoBaseResourceInner withStatusCode(HttpStatusCode statusCode) { + super.withStatusCode(statusCode); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationResultInfoBaseResourceInner withHeaders(Map> headers) { + super.withHeaders(headers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (operation() != null) { + operation().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java new file mode 100644 index 0000000000000..4c6a10b70a9b2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusError; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusExtendedInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusValues; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation status. */ +@Fluent +public final class OperationStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); + + /* + * ID of the operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status") + private OperationStatusValues status; + + /* + * Operation start time. Format: ISO-8601. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Operation end time. Format: ISO-8601. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Error information related to this operation. + */ + @JsonProperty(value = "error") + private OperationStatusError error; + + /* + * Additional information associated with this operation. + */ + @JsonProperty(value = "properties") + private OperationStatusExtendedInfo properties; + + /** + * Get the id property: ID of the operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the operation. + * + * @param id the id value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public OperationStatusValues status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(OperationStatusValues status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Operation start time. Format: ISO-8601. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Operation start time. Format: ISO-8601. + * + * @param startTime the startTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Operation end time. Format: ISO-8601. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Operation end time. Format: ISO-8601. + * + * @param endTime the endTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the error property: Error information related to this operation. + * + * @return the error value. + */ + public OperationStatusError error() { + return this.error; + } + + /** + * Set the error property: Error information related to this operation. + * + * @param error the error value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withError(OperationStatusError error) { + this.error = error; + return this; + } + + /** + * Get the properties property: Additional information associated with this operation. + * + * @return the properties value. + */ + public OperationStatusExtendedInfo properties() { + return this.properties; + } + + /** + * Set the properties property: Additional information associated with this operation. + * + * @param properties the properties value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withProperties(OperationStatusExtendedInfo properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java new file mode 100644 index 0000000000000..8b461be53b2cc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response contract for enable backup validation request. */ +@Fluent +public final class PreValidateEnableBackupResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreValidateEnableBackupResponseInner.class); + + /* + * Validation Status + */ + @JsonProperty(value = "status") + private ValidationStatus status; + + /* + * Response error code + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /* + * Response error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Recommended action for user + */ + @JsonProperty(value = "recommendation") + private String recommendation; + + /* + * Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + * for portal + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;rgname;vmname. This is required for portal + */ + @JsonProperty(value = "protectedItemName") + private String protectedItemName; + + /** + * Get the status property: Validation Status. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Set the status property: Validation Status. + * + * @param status the status value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withStatus(ValidationStatus status) { + this.status = status; + return this; + } + + /** + * Get the errorCode property: Response error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Response error code. + * + * @param errorCode the errorCode value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorMessage property: Response error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Response error message. + * + * @param errorMessage the errorMessage value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the recommendation property: Recommended action for user. + * + * @return the recommendation value. + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Set the recommendation property: Recommended action for user. + * + * @param recommendation the recommendation value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withRecommendation(String recommendation) { + this.recommendation = recommendation; + return this; + } + + /** + * Get the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @param containerName the containerName value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @return the protectedItemName value. + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Set the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @param protectedItemName the protectedItemName value to set. + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withProtectedItemName(String protectedItemName) { + this.protectedItemName = protectedItemName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java new file mode 100644 index 0000000000000..4058c4f23ad88 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.PrivateEndpointConnection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Private Endpoint Connection Response Properties. */ +@Fluent +public final class PrivateEndpointConnectionResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionResourceInner.class); + + /* + * PrivateEndpointConnectionResource properties + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnection properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: PrivateEndpointConnectionResource properties. + * + * @return the properties value. + */ + public PrivateEndpointConnection properties() { + return this.properties; + } + + /** + * Set the properties property: PrivateEndpointConnectionResource properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionResourceInner object itself. + */ + public PrivateEndpointConnectionResourceInner withProperties(PrivateEndpointConnection properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the PrivateEndpointConnectionResourceInner object itself. + */ + public PrivateEndpointConnectionResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java new file mode 100644 index 0000000000000..615587b63db1b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.ProtectableContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Protectable Container Class. */ +@Fluent +public final class ProtectableContainerResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableContainerResourceInner.class); + + /* + * ProtectableContainerResource properties + */ + @JsonProperty(value = "properties") + private ProtectableContainer properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ProtectableContainerResource properties. + * + * @return the properties value. + */ + public ProtectableContainer properties() { + return this.properties; + } + + /** + * Set the properties property: ProtectableContainerResource properties. + * + * @param properties the properties value to set. + * @return the ProtectableContainerResourceInner object itself. + */ + public ProtectableContainerResourceInner withProperties(ProtectableContainer properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the ProtectableContainerResourceInner object itself. + */ + public ProtectableContainerResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectableContainerResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectableContainerResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java new file mode 100644 index 0000000000000..81c28b077929a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.ProtectedItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup items. */ +@Fluent +public final class ProtectedItemResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItemResourceInner.class); + + /* + * ProtectedItemResource properties + */ + @JsonProperty(value = "properties") + private ProtectedItem properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ProtectedItemResource properties. + * + * @return the properties value. + */ + public ProtectedItem properties() { + return this.properties; + } + + /** + * Set the properties property: ProtectedItemResource properties. + * + * @param properties the properties value to set. + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withProperties(ProtectedItem properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java new file mode 100644 index 0000000000000..31c441e1e896f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.ProtectionContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for container with backup items. Containers with specific workloads are derived from this class. */ +@Fluent +public final class ProtectionContainerResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerResourceInner.class); + + /* + * ProtectionContainerResource properties + */ + @JsonProperty(value = "properties") + private ProtectionContainer properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ProtectionContainerResource properties. + * + * @return the properties value. + */ + public ProtectionContainer properties() { + return this.properties; + } + + /** + * Set the properties property: ProtectionContainerResource properties. + * + * @param properties the properties value to set. + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withProperties(ProtectionContainer properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionContainerResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionContainerResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java new file mode 100644 index 0000000000000..260803ecc5fe7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.ProtectionIntent; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup ProtectionIntent. */ +@Fluent +public final class ProtectionIntentResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionIntentResourceInner.class); + + /* + * ProtectionIntentResource properties + */ + @JsonProperty(value = "properties") + private ProtectionIntent properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ProtectionIntentResource properties. + * + * @return the properties value. + */ + public ProtectionIntent properties() { + return this.properties; + } + + /** + * Set the properties property: ProtectionIntentResource properties. + * + * @param properties the properties value to set. + * @return the ProtectionIntentResourceInner object itself. + */ + public ProtectionIntentResourceInner withProperties(ProtectionIntent properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the ProtectionIntentResourceInner object itself. + */ + public ProtectionIntentResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionIntentResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionIntentResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java new file mode 100644 index 0000000000000..81680cb88e9f1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.ProtectionPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup policy. Workload-specific backup policies are derived from this class. */ +@Fluent +public final class ProtectionPolicyResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPolicyResourceInner.class); + + /* + * ProtectionPolicyResource properties + */ + @JsonProperty(value = "properties") + private ProtectionPolicy properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ProtectionPolicyResource properties. + * + * @return the properties value. + */ + public ProtectionPolicy properties() { + return this.properties; + } + + /** + * Set the properties property: ProtectionPolicyResource properties. + * + * @param properties the properties value to set. + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withProperties(ProtectionPolicy properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionPolicyResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionPolicyResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java new file mode 100644 index 0000000000000..4d4a437fb64eb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.RecoveryPoint; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup copies. Workload-specific backup copies are derived from this class. */ +@Fluent +public final class RecoveryPointResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointResourceInner.class); + + /* + * RecoveryPointResource properties + */ + @JsonProperty(value = "properties") + private RecoveryPoint properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: RecoveryPointResource properties. + * + * @return the properties value. + */ + public RecoveryPoint properties() { + return this.properties; + } + + /** + * Set the properties property: RecoveryPointResource properties. + * + * @param properties the properties value to set. + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withProperties(RecoveryPoint properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java new file mode 100644 index 0000000000000..9d3e6c6b73565 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.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.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The token information details. */ +@Fluent +public final class TokenInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenInformationInner.class); + + /* + * Token value. + */ + @JsonProperty(value = "token") + private String token; + + /* + * Expiry time of token. + */ + @JsonProperty(value = "expiryTimeInUtcTicks") + private Long expiryTimeInUtcTicks; + + /* + * Security PIN + */ + @JsonProperty(value = "securityPIN") + private String securityPin; + + /** + * Get the token property: Token value. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: Token value. + * + * @param token the token value to set. + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the expiryTimeInUtcTicks property: Expiry time of token. + * + * @return the expiryTimeInUtcTicks value. + */ + public Long expiryTimeInUtcTicks() { + return this.expiryTimeInUtcTicks; + } + + /** + * Set the expiryTimeInUtcTicks property: Expiry time of token. + * + * @param expiryTimeInUtcTicks the expiryTimeInUtcTicks value to set. + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withExpiryTimeInUtcTicks(Long expiryTimeInUtcTicks) { + this.expiryTimeInUtcTicks = expiryTimeInUtcTicks; + return this; + } + + /** + * Get the securityPin property: Security PIN. + * + * @return the securityPin value. + */ + public String securityPin() { + return this.securityPin; + } + + /** + * Set the securityPin property: Security PIN. + * + * @param securityPin the securityPin value to set. + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withSecurityPin(String securityPin) { + this.securityPin = securityPin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java new file mode 100644 index 0000000000000..695c39f49a5dd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.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.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ValidateOperationsResponse model. */ +@Fluent +public final class ValidateOperationsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateOperationsResponseInner.class); + + /* + * Base class for validate operation response. + */ + @JsonProperty(value = "validateOperationResponse") + private ValidateOperationResponse validateOperationResponse; + + /** + * Get the validateOperationResponse property: Base class for validate operation response. + * + * @return the validateOperationResponse value. + */ + public ValidateOperationResponse validateOperationResponse() { + return this.validateOperationResponse; + } + + /** + * Set the validateOperationResponse property: Base class for validate operation response. + * + * @param validateOperationResponse the validateOperationResponse value to set. + * @return the ValidateOperationsResponseInner object itself. + */ + public ValidateOperationsResponseInner withValidateOperationResponse( + ValidateOperationResponse validateOperationResponse) { + this.validateOperationResponse = validateOperationResponse; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validateOperationResponse() != null) { + validateOperationResponse().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java new file mode 100644 index 0000000000000..d1c3cbc093ffb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Operation result response for Vault Storage Config. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = VaultStorageConfigOperationResultResponseInner.class) +@JsonTypeName("VaultStorageConfigOperationResultResponse") +@JsonSubTypes({@JsonSubTypes.Type(name = "PrepareDataMoveResponse", value = PrepareDataMoveResponse.class)}) +@Immutable +public class VaultStorageConfigOperationResultResponseInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VaultStorageConfigOperationResultResponseInner.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java new file mode 100644 index 0000000000000..863bd60091e69 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.WorkloadItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup item. Workload-specific backup items are derived from this class. */ +@Fluent +public final class WorkloadItemResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadItemResourceInner.class); + + /* + * WorkloadItemResource properties + */ + @JsonProperty(value = "properties") + private WorkloadItem properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: WorkloadItemResource properties. + * + * @return the properties value. + */ + public WorkloadItem properties() { + return this.properties; + } + + /** + * Set the properties property: WorkloadItemResource properties. + * + * @param properties the properties value to set. + * @return the WorkloadItemResourceInner object itself. + */ + public WorkloadItemResourceInner withProperties(WorkloadItem properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the WorkloadItemResourceInner object itself. + */ + public WorkloadItemResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadItemResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadItemResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java new file mode 100644 index 0000000000000..60624ef562c3f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.models.WorkloadProtectableItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup item. Workload-specific backup items are derived from this class. */ +@Fluent +public final class WorkloadProtectableItemResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadProtectableItemResourceInner.class); + + /* + * WorkloadProtectableItemResource properties + */ + @JsonProperty(value = "properties") + private WorkloadProtectableItem properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: WorkloadProtectableItemResource properties. + * + * @return the properties value. + */ + public WorkloadProtectableItem properties() { + return this.properties; + } + + /** + * Set the properties property: WorkloadProtectableItemResource properties. + * + * @param properties the properties value to set. + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withProperties(WorkloadProtectableItem properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadProtectableItemResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadProtectableItemResourceInner withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java new file mode 100644 index 0000000000000..867ac2c9c5930 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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 RecoveryServicesBackupClient. Open API 2.0 Specs for Azure + * RecoveryServices Backup service. + */ +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java new file mode 100644 index 0000000000000..2f192edb59868 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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 RecoveryServicesBackupClient. Open API 2.0 Specs for Azure + * RecoveryServices Backup service. + */ +package com.azure.resourcemanager.recoveryservicesbackup.fluent; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java new file mode 100644 index 0000000000000..508b34178a01b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsClientImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AadPropertiesOperationsClient. */ +public final class AadPropertiesOperationsClientImpl implements AadPropertiesOperationsClient { + private final ClientLogger logger = new ClientLogger(AadPropertiesOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AadPropertiesOperationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of AadPropertiesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AadPropertiesOperationsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(AadPropertiesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientAadPropertiesOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface AadPropertiesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupAadProperties") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required 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 apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required 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 apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), apiVersion, azureRegion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion) { + return getWithResponseAsync(azureRegion) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AadPropertiesResourceInner get(String azureRegion) { + return getAsync(azureRegion).block(); + } + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, Context context) { + return getWithResponseAsync(azureRegion, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java new file mode 100644 index 0000000000000..289c0f409c0ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesOperationsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AadPropertiesOperationsImpl implements AadPropertiesOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadPropertiesOperationsImpl.class); + + private final AadPropertiesOperationsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public AadPropertiesOperationsImpl( + AadPropertiesOperationsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AadPropertiesResource get(String azureRegion) { + AadPropertiesResourceInner inner = this.serviceClient().get(azureRegion); + if (inner != null) { + return new AadPropertiesResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String azureRegion, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AadPropertiesResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AadPropertiesOperationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java new file mode 100644 index 0000000000000..eb9c34d27f923 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AadPropertiesResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.AadProperties; +import com.azure.resourcemanager.recoveryservicesbackup.models.AadPropertiesResource; +import java.util.Collections; +import java.util.Map; + +public final class AadPropertiesResourceImpl implements AadPropertiesResource { + private AadPropertiesResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + AadPropertiesResourceImpl(AadPropertiesResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AadProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public AadPropertiesResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java new file mode 100644 index 0000000000000..04098e5f3c3dc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.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.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.SupportStatus; + +public final class AzureVMResourceFeatureSupportResponseImpl implements AzureVMResourceFeatureSupportResponse { + private AzureVMResourceFeatureSupportResponseInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + AzureVMResourceFeatureSupportResponseImpl( + AzureVMResourceFeatureSupportResponseInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SupportStatus supportStatus() { + return this.innerModel().supportStatus(); + } + + public AzureVMResourceFeatureSupportResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.java new file mode 100644 index 0000000000000..f9681047b06fe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsClientImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupCrrJobDetailsClient. */ +public final class BackupCrrJobDetailsClientImpl implements BackupCrrJobDetailsClient { + private final ClientLogger logger = new ClientLogger(BackupCrrJobDetailsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupCrrJobDetailsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupCrrJobDetailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupCrrJobDetailsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupCrrJobDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupCrrJobDetails to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupCrrJobDetailsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CrrJobRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, CrrJobRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String azureRegion, CrrJobRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, CrrJobRequest parameters) { + return getWithResponseAsync(azureRegion, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobResourceInner get(String azureRegion, CrrJobRequest parameters) { + return getAsync(azureRegion, parameters).block(); + } + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { + return getWithResponseAsync(azureRegion, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.java new file mode 100644 index 0000000000000..8637359de6a32 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobDetailsImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupCrrJobDetailsImpl implements BackupCrrJobDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupCrrJobDetailsImpl.class); + + private final BackupCrrJobDetailsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupCrrJobDetailsImpl( + BackupCrrJobDetailsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public JobResource get(String azureRegion, CrrJobRequest parameters) { + JobResourceInner inner = this.serviceClient().get(azureRegion, parameters); + if (inner != null) { + return new JobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BackupCrrJobDetailsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java new file mode 100644 index 0000000000000..5bac8c160c57d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsClientImpl.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupCrrJobsClient. */ +public final class BackupCrrJobsClientImpl implements BackupCrrJobsClient { + private final ClientLogger logger = new ClientLogger(BackupCrrJobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupCrrJobsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupCrrJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupCrrJobsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupCrrJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupCrrJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupCrrJobsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupCrrJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @BodyParam("application/json") CrrJobRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + filter, + skipToken, + parameters, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + filter, + skipToken, + parameters, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String azureRegion, CrrJobRequest parameters) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(azureRegion, parameters, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String azureRegion, CrrJobRequest parameters) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(azureRegion, parameters, filter, skipToken)); + } + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(azureRegion, parameters, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job 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 list of Job 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java new file mode 100644 index 0000000000000..f8445880ec199 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupCrrJobsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupCrrJobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrJobRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupCrrJobsImpl implements BackupCrrJobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupCrrJobsImpl.class); + + private final BackupCrrJobsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupCrrJobsImpl(BackupCrrJobsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String azureRegion, CrrJobRequest parameters) { + PagedIterable inner = this.serviceClient().list(azureRegion, parameters); + return inner.mapPage(inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(azureRegion, parameters, filter, skipToken, context); + return inner.mapPage(inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + private BackupCrrJobsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java new file mode 100644 index 0000000000000..207a1eab128b4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBase; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBaseResource; +import java.util.Collections; +import java.util.Map; + +public final class BackupEngineBaseResourceImpl implements BackupEngineBaseResource { + private BackupEngineBaseResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupEngineBaseResourceImpl( + BackupEngineBaseResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public BackupEngineBase properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public BackupEngineBaseResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java new file mode 100644 index 0000000000000..9a48b5271c3ad --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBaseResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupEnginesClient. */ +public final class BackupEnginesClientImpl implements BackupEnginesClient { + private final ClientLogger logger = new ClientLogger(BackupEnginesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupEnginesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupEnginesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupEnginesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupEnginesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupEngines to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupEnginesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupEngines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupEngines/{backupEngineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("backupEngineName") String backupEngineName, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String backupEngineName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (backupEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupEngineName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + backupEngineName, + filter, + skipToken, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String backupEngineName, + String filter, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (backupEngineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupEngineName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + backupEngineName, + filter, + skipToken, + accept, + context); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String backupEngineName, String filter, String skipToken) { + return getWithResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String backupEngineName) { + final String filter = null; + final String skipToken = null; + return getWithResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName) { + final String filter = null; + final String skipToken = null; + return getAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken).block(); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String backupEngineName, + String filter, + String skipToken, + Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase 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 list of BackupEngineBase 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java new file mode 100644 index 0000000000000..bbe3053570bc3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBaseResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupEnginesImpl implements BackupEngines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupEnginesImpl.class); + + private final BackupEnginesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupEnginesImpl(BackupEnginesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new BackupEngineBaseResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new BackupEngineBaseResourceImpl(inner1, this.manager())); + } + + public BackupEngineBaseResource get(String vaultName, String resourceGroupName, String backupEngineName) { + BackupEngineBaseResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupEngineName); + if (inner != null) { + return new BackupEngineBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String backupEngineName, + String filter, + String skipToken, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(vaultName, resourceGroupName, backupEngineName, filter, skipToken, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupEngineBaseResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BackupEnginesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java new file mode 100644 index 0000000000000..3a26824656978 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupJobsClient. */ +public final class BackupJobsClientImpl implements BackupJobsClient { + private final ClientLogger logger = new ClientLogger(BackupJobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupJobsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupJobsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupJobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job 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 list of Job 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java new file mode 100644 index 0000000000000..235385c98bea9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupJobsImpl implements BackupJobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupJobsImpl.class); + + private final BackupJobsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupJobsImpl(BackupJobsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + private BackupJobsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java new file mode 100644 index 0000000000000..afe5d42c01a56 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.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.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsage; +import com.azure.resourcemanager.recoveryservicesbackup.models.NameInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.UsagesUnit; +import java.time.OffsetDateTime; + +public final class BackupManagementUsageImpl implements BackupManagementUsage { + private BackupManagementUsageInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupManagementUsageImpl(BackupManagementUsageInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UsagesUnit unit() { + return this.innerModel().unit(); + } + + public String quotaPeriod() { + return this.innerModel().quotaPeriod(); + } + + public OffsetDateTime nextResetTime() { + return this.innerModel().nextResetTime(); + } + + public Long currentValue() { + return this.innerModel().currentValue(); + } + + public Long limit() { + return this.innerModel().limit(); + } + + public NameInfo name() { + return this.innerModel().name(); + } + + public BackupManagementUsageInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java new file mode 100644 index 0000000000000..354dadb8a3de0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.BackupOperationResultsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupOperationResultsClient. */ +public final class BackupOperationResultsClientImpl implements BackupOperationResultsClient { + private final ClientLogger logger = new ClientLogger(BackupOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupOperationResults to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupOperationResults/{operationId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String vaultName, String resourceGroupName, String operationId) { + getAsync(vaultName, resourceGroupName, operationId).block(); + } + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java new file mode 100644 index 0000000000000..71736be1ae949 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupOperationResultsImpl implements BackupOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupOperationResultsImpl.class); + + private final BackupOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupOperationResultsImpl( + BackupOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String vaultName, String resourceGroupName, String operationId) { + this.serviceClient().get(vaultName, resourceGroupName, operationId); + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); + } + + private BackupOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java new file mode 100644 index 0000000000000..18742909e863d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.BackupOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupOperationStatusesClient. */ +public final class BackupOperationStatusesClientImpl implements BackupOperationStatusesClient { + private final ClientLogger logger = new ClientLogger(BackupOperationStatusesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupOperationStatusesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupOperationStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupOperationStatusesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupOperationStatusesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupOperationStatuses to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupOperationStatusesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupOperations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String vaultName, String resourceGroupName, String operationId) { + return getAsync(vaultName, resourceGroupName, operationId).block(); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java new file mode 100644 index 0000000000000..96fb5a913e8fc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupOperationStatusesImpl implements BackupOperationStatuses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupOperationStatusesImpl.class); + + private final BackupOperationStatusesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupOperationStatusesImpl( + BackupOperationStatusesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus get(String vaultName, String resourceGroupName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(vaultName, resourceGroupName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BackupOperationStatusesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java new file mode 100644 index 0000000000000..9f58a9f3ea5e5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ +public final class BackupPoliciesClientImpl implements BackupPoliciesClient { + private final ClientLogger logger = new ClientLogger(BackupPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupPoliciesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupPoliciesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @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 of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + 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 of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter)); + } + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy 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 list of ProtectionPolicy 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java new file mode 100644 index 0000000000000..cd463a2d66c2b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupPoliciesImpl implements BackupPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPoliciesImpl.class); + + private final BackupPoliciesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupPoliciesImpl(BackupPoliciesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new ProtectionPolicyResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, context); + return inner.mapPage(inner1 -> new ProtectionPolicyResourceImpl(inner1, this.manager())); + } + + private BackupPoliciesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java new file mode 100644 index 0000000000000..d8eba3d04b695 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItemResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupProtectableItemsClient. */ +public final class BackupProtectableItemsClientImpl implements BackupProtectableItemsClient { + private final ClientLogger logger = new ClientLogger(BackupProtectableItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupProtectableItemsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectableItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectableItemsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupProtectableItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupProtectableItems to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupProtectableItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupProtectableItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem 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 list of WorkloadProtectableItem 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java new file mode 100644 index 0000000000000..cd13e6b2d72ca --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItemResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupProtectableItemsImpl implements BackupProtectableItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectableItemsImpl.class); + + private final BackupProtectableItemsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupProtectableItemsImpl( + BackupProtectableItemsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new WorkloadProtectableItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new WorkloadProtectableItemResourceImpl(inner1, this.manager())); + } + + private BackupProtectableItemsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java new file mode 100644 index 0000000000000..8d7d42e126eaf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupProtectedItemsClient. */ +public final class BackupProtectedItemsClientImpl implements BackupProtectedItemsClient { + private final ClientLogger logger = new ClientLogger(BackupProtectedItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupProtectedItemsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectedItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectedItemsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupProtectedItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupProtectedItems to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupProtectedItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupProtectedItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem 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 list of ProtectedItem 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java new file mode 100644 index 0000000000000..c28055972988b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsClientImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupProtectedItemsCrrsClient. */ +public final class BackupProtectedItemsCrrsClientImpl implements BackupProtectedItemsCrrsClient { + private final ClientLogger logger = new ClientLogger(BackupProtectedItemsCrrsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupProtectedItemsCrrsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectedItemsCrrsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectedItemsCrrsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupProtectedItemsCrrsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupProtectedItemsCrrs to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupProtectedItemsCrrsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupProtectedItems/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem 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 list of ProtectedItem 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java new file mode 100644 index 0000000000000..dab635e23f46f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsCrrsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsCrrs; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupProtectedItemsCrrsImpl implements BackupProtectedItemsCrrs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectedItemsCrrsImpl.class); + + private final BackupProtectedItemsCrrsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupProtectedItemsCrrsImpl( + BackupProtectedItemsCrrsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + private BackupProtectedItemsCrrsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java new file mode 100644 index 0000000000000..07b47c5266570 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupProtectedItemsImpl implements BackupProtectedItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectedItemsImpl.class); + + private final BackupProtectedItemsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupProtectedItemsImpl( + BackupProtectedItemsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + private BackupProtectedItemsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java new file mode 100644 index 0000000000000..0d6274bb58ea8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupProtectionContainersClient. */ +public final class BackupProtectionContainersClientImpl implements BackupProtectionContainersClient { + private final ClientLogger logger = new ClientLogger(BackupProtectionContainersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupProtectionContainersService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectionContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectionContainersClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + BackupProtectionContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupProtectionContainers to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupProtectionContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupProtectionContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @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 containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + 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 containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter)); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer 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 list of ProtectionContainer 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java new file mode 100644 index 0000000000000..c6051eb1e125f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupProtectionContainersImpl implements BackupProtectionContainers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectionContainersImpl.class); + + private final BackupProtectionContainersClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupProtectionContainersImpl( + BackupProtectionContainersClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, context); + return inner.mapPage(inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); + } + + private BackupProtectionContainersClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java new file mode 100644 index 0000000000000..31efd3bfb69b3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupProtectionIntentsClient. */ +public final class BackupProtectionIntentsClientImpl implements BackupProtectionIntentsClient { + private final ClientLogger logger = new ClientLogger(BackupProtectionIntentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupProtectionIntentsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectionIntentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectionIntentsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupProtectionIntentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupProtectionIntents to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupProtectionIntentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupProtectionIntents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent 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 list of ProtectionIntent 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java new file mode 100644 index 0000000000000..8835e5e9402e6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupProtectionIntentsImpl implements BackupProtectionIntents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupProtectionIntentsImpl.class); + + private final BackupProtectionIntentsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupProtectionIntentsImpl( + BackupProtectionIntentsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new ProtectionIntentResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new ProtectionIntentResourceImpl(inner1, this.manager())); + } + + private BackupProtectionIntentsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java new file mode 100644 index 0000000000000..47c5a3b7b064f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfigResource; +import java.util.Collections; +import java.util.Map; + +public final class BackupResourceConfigResourceImpl implements BackupResourceConfigResource { + private BackupResourceConfigResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupResourceConfigResourceImpl( + BackupResourceConfigResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public BackupResourceConfig properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public BackupResourceConfigResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java new file mode 100644 index 0000000000000..47c26673cecc0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; +import java.util.Collections; +import java.util.Map; + +public final class BackupResourceEncryptionConfigResourceImpl implements BackupResourceEncryptionConfigResource { + private BackupResourceEncryptionConfigResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupResourceEncryptionConfigResourceImpl( + BackupResourceEncryptionConfigResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public BackupResourceEncryptionConfig properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public BackupResourceEncryptionConfigResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java new file mode 100644 index 0000000000000..558e8e0dbb5cf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. */ +public final class BackupResourceEncryptionConfigsClientImpl implements BackupResourceEncryptionConfigsClient { + private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupResourceEncryptionConfigsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupResourceEncryptionConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupResourceEncryptionConfigsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + BackupResourceEncryptionConfigsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupResourceEncryptionConfigs to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupResourceEncryptionConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupResourceEncryptionConfigResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName) { + return getWithResponseAsync(vaultName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceEncryptionConfigResourceInner get(String vaultName, String resourceGroupName) { + return getAsync(vaultName, resourceGroupName).block(); + } + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, context).block(); + } + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, + String resourceGroupName, + BackupResourceEncryptionConfigResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update( + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + updateAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceEncryptionConfigResourceInner parameters, + Context context) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java new file mode 100644 index 0000000000000..03cd0fed4ca81 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupResourceEncryptionConfigsImpl implements BackupResourceEncryptionConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfigsImpl.class); + + private final BackupResourceEncryptionConfigsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupResourceEncryptionConfigsImpl( + BackupResourceEncryptionConfigsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupResourceEncryptionConfigResource get(String vaultName, String resourceGroupName) { + BackupResourceEncryptionConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); + if (inner != null) { + return new BackupResourceEncryptionConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceEncryptionConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update( + String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters) { + this.serviceClient().update(vaultName, resourceGroupName, parameters); + } + + public Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceEncryptionConfigResourceInner parameters, + Context context) { + return this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); + } + + private BackupResourceEncryptionConfigsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java new file mode 100644 index 0000000000000..3b1bd632d5b06 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsClientImpl.java @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsClient. */ +public final class BackupResourceStorageConfigsClientImpl implements BackupResourceStorageConfigsClient { + private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupResourceStorageConfigsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupResourceStorageConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupResourceStorageConfigsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + BackupResourceStorageConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupResourceStorageConfigs to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupResourceStorageConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupResourceConfigResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName) { + return getWithResponseAsync(vaultName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceConfigResourceInner get(String vaultName, String resourceGroupName) { + return getAsync(vaultName, resourceGroupName).block(); + } + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, context).block(); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceConfigResourceInner update( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + return updateAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + return patchWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + patchAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + return patchWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java new file mode 100644 index 0000000000000..eb3c81368a05b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupResourceStorageConfigsImpl implements BackupResourceStorageConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceStorageConfigsImpl.class); + + private final BackupResourceStorageConfigsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupResourceStorageConfigsImpl( + BackupResourceStorageConfigsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupResourceConfigResource get(String vaultName, String resourceGroupName) { + BackupResourceConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); + if (inner != null) { + return new BackupResourceConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BackupResourceConfigResource update( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + BackupResourceConfigResourceInner inner = this.serviceClient().update(vaultName, resourceGroupName, parameters); + if (inner != null) { + return new BackupResourceConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + Response inner = + this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { + this.serviceClient().patch(vaultName, resourceGroupName, parameters); + } + + public Response patchWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) { + return this.serviceClient().patchWithResponse(vaultName, resourceGroupName, parameters, context); + } + + private BackupResourceStorageConfigsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java new file mode 100644 index 0000000000000..6e74265fdcf8a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigResource; +import java.util.Collections; +import java.util.Map; + +public final class BackupResourceVaultConfigResourceImpl implements BackupResourceVaultConfigResource { + private BackupResourceVaultConfigResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupResourceVaultConfigResourceImpl( + BackupResourceVaultConfigResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public BackupResourceVaultConfig properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public BackupResourceVaultConfigResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java new file mode 100644 index 0000000000000..4d6bcbf253459 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupResourceVaultConfigsClient. */ +public final class BackupResourceVaultConfigsClientImpl implements BackupResourceVaultConfigsClient { + private final ClientLogger logger = new ClientLogger(BackupResourceVaultConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupResourceVaultConfigsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupResourceVaultConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupResourceVaultConfigsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + BackupResourceVaultConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupResourceVaultConfigs to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupResourceVaultConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupconfig/vaultconfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupconfig/vaultconfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupconfig/vaultconfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName) { + return getWithResponseAsync(vaultName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceVaultConfigResourceInner get(String vaultName, String resourceGroupName) { + return getAsync(vaultName, resourceGroupName).block(); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, context).block(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceVaultConfigResourceInner update( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return updateAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + return updateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return putWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceVaultConfigResourceInner put( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return putAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + return putWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java new file mode 100644 index 0000000000000..6d768e7b23d4e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupResourceVaultConfigsImpl implements BackupResourceVaultConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceVaultConfigsImpl.class); + + private final BackupResourceVaultConfigsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupResourceVaultConfigsImpl( + BackupResourceVaultConfigsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupResourceVaultConfigResource get(String vaultName, String resourceGroupName) { + BackupResourceVaultConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); + if (inner != null) { + return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BackupResourceVaultConfigResource update( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + BackupResourceVaultConfigResourceInner inner = + this.serviceClient().update(vaultName, resourceGroupName, parameters); + if (inner != null) { + return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + Response inner = + this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BackupResourceVaultConfigResource put( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + BackupResourceVaultConfigResourceInner inner = + this.serviceClient().put(vaultName, resourceGroupName, parameters); + if (inner != null) { + return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response putWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceVaultConfigResourceInner parameters, + Context context) { + Response inner = + this.serviceClient().putWithResponse(vaultName, resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BackupResourceVaultConfigsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java new file mode 100644 index 0000000000000..d3573a0c4d167 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.BackupStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupStatusClient. */ +public final class BackupStatusClientImpl implements BackupStatusClient { + private final ClientLogger logger = new ClientLogger(BackupStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupStatusService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupStatusClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupStatusService { + @Headers({"Content-Type: application/json"}) + @Post( + "/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackupStatusRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String azureRegion, BackupStatusRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String azureRegion, BackupStatusRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, BackupStatusRequest parameters) { + return getWithResponseAsync(azureRegion, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupStatusResponseInner get(String azureRegion, BackupStatusRequest parameters) { + return getAsync(azureRegion, parameters).block(); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String azureRegion, BackupStatusRequest parameters, Context context) { + return getWithResponseAsync(azureRegion, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java new file mode 100644 index 0000000000000..6356259b12b32 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupStatusImpl implements BackupStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupStatusImpl.class); + + private final BackupStatusClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupStatusImpl(BackupStatusClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupStatusResponse get(String azureRegion, BackupStatusRequest parameters) { + BackupStatusResponseInner inner = this.serviceClient().get(azureRegion, parameters); + if (inner != null) { + return new BackupStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String azureRegion, BackupStatusRequest parameters, Context context) { + Response inner = + this.serviceClient().getWithResponse(azureRegion, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupStatusResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BackupStatusClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java new file mode 100644 index 0000000000000..154eb05860d67 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.FabricName; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionStatus; + +public final class BackupStatusResponseImpl implements BackupStatusResponse { + private BackupStatusResponseInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + BackupStatusResponseImpl(BackupStatusResponseInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ProtectionStatus protectionStatus() { + return this.innerModel().protectionStatus(); + } + + public String vaultId() { + return this.innerModel().vaultId(); + } + + public FabricName fabricName() { + return this.innerModel().fabricName(); + } + + public String containerName() { + return this.innerModel().containerName(); + } + + public String protectedItemName() { + return this.innerModel().protectedItemName(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public String policyName() { + return this.innerModel().policyName(); + } + + public String registrationStatus() { + return this.innerModel().registrationStatus(); + } + + public BackupStatusResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java new file mode 100644 index 0000000000000..d4015537fca3f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupUsageSummariesClient. */ +public final class BackupUsageSummariesClientImpl implements BackupUsageSummariesClient { + private final ClientLogger logger = new ClientLogger(BackupUsageSummariesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupUsageSummariesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupUsageSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupUsageSummariesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(BackupUsageSummariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupUsageSummaries to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupUsageSummariesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupUsageSummaries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String vaultName, String resourceGroupName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken)); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, filter, skipToken, context)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java new file mode 100644 index 0000000000000..4942b49e9c1fa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsage; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupUsageSummariesImpl implements BackupUsageSummaries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupUsageSummariesImpl.class); + + private final BackupUsageSummariesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupUsageSummariesImpl( + BackupUsageSummariesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String vaultName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); + return inner.mapPage(inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); + return inner.mapPage(inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); + } + + private BackupUsageSummariesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java new file mode 100644 index 0000000000000..2a1547880d62a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItemResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupWorkloadItemsClient. */ +public final class BackupWorkloadItemsClientImpl implements BackupWorkloadItemsClient { + private final ClientLogger logger = new ClientLogger(BackupWorkloadItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupWorkloadItemsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupWorkloadItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupWorkloadItemsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(BackupWorkloadItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackupWorkloadItems to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupWorkloadItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @QueryParam("$filter") String filter, + @QueryParam("$skipToken") String skipToken, + @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); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + filter, + skipToken, + 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()))); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + filter, + skipToken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + vaultName, resourceGroupName, fabricName, containerName, filter, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken)); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context) { + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem 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 list of WorkloadItem 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java new file mode 100644 index 0000000000000..edfb28515c023 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItemResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupWorkloadItemsImpl implements BackupWorkloadItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupWorkloadItemsImpl.class); + + private final BackupWorkloadItemsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupWorkloadItemsImpl( + BackupWorkloadItemsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName); + return inner.mapPage(inner1 -> new WorkloadItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken, context); + return inner.mapPage(inner1 -> new WorkloadItemResourceImpl(inner1, this.manager())); + } + + private BackupWorkloadItemsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java new file mode 100644 index 0000000000000..89f78c9055473 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.BackupsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupsClient. */ +public final class BackupsClientImpl implements BackupsClient { + private final ClientLogger logger = new ClientLogger(BackupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = RestProxy.create(BackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBackups to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BackupsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/backup") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> trigger( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @BodyParam("application/json") BackupRequestResource parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> triggerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> triggerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + accept, + context); + } + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters) { + return triggerWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters) { + triggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).block(); + } + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response triggerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters, + Context context) { + return triggerWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java new file mode 100644 index 0000000000000..c5f297c90c8e2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupsImpl implements Backups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupsImpl.class); + + private final BackupsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BackupsImpl(BackupsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters) { + this + .serviceClient() + .trigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters); + } + + public Response triggerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters, + Context context) { + return this + .serviceClient() + .triggerWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context); + } + + private BackupsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java new file mode 100644 index 0000000000000..b59963fb60495 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BmsPrepareDataMoveOperationResultsClient. + */ +public final class BmsPrepareDataMoveOperationResultsClientImpl implements BmsPrepareDataMoveOperationResultsClient { + private final ClientLogger logger = new ClientLogger(BmsPrepareDataMoveOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BmsPrepareDataMoveOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BmsPrepareDataMoveOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BmsPrepareDataMoveOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + BmsPrepareDataMoveOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientBmsPrepareDataMoveOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface BmsPrepareDataMoveOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 operation result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultStorageConfigOperationResultResponseInner get( + String vaultName, String resourceGroupName, String operationId) { + return getAsync(vaultName, resourceGroupName, operationId).block(); + } + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 operation result response for Vault Storage Config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java new file mode 100644 index 0000000000000..c3aeb9b7a39f8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BmsPrepareDataMoveOperationResultsImpl implements BmsPrepareDataMoveOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BmsPrepareDataMoveOperationResultsImpl.class); + + private final BmsPrepareDataMoveOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public BmsPrepareDataMoveOperationResultsImpl( + BmsPrepareDataMoveOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VaultStorageConfigOperationResultResponse get( + String vaultName, String resourceGroupName, String operationId) { + VaultStorageConfigOperationResultResponseInner inner = + this.serviceClient().get(vaultName, resourceGroupName, operationId); + if (inner != null) { + return new VaultStorageConfigOperationResultResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultStorageConfigOperationResultResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BmsPrepareDataMoveOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java new file mode 100644 index 0000000000000..0f7381811b43a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryDisplay; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForProperties; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; + +public final class ClientDiscoveryValueForSingleApiImpl implements ClientDiscoveryValueForSingleApi { + private ClientDiscoveryValueForSingleApiInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + ClientDiscoveryValueForSingleApiImpl( + ClientDiscoveryValueForSingleApiInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public ClientDiscoveryDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ClientDiscoveryForProperties properties() { + return this.innerModel().properties(); + } + + public ClientDiscoveryValueForSingleApiInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java new file mode 100644 index 0000000000000..d03226055f4b7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresClientImpl.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.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.recoveryservicesbackup.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestoreRequest; +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 CrossRegionRestoresClient. */ +public final class CrossRegionRestoresClientImpl implements CrossRegionRestoresClient { + private final ClientLogger logger = new ClientLogger(CrossRegionRestoresClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CrossRegionRestoresService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of CrossRegionRestoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossRegionRestoresClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(CrossRegionRestoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientCrossRegionRestores to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface CrossRegionRestoresService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupCrossRegionRestore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> trigger( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CrossRegionRestoreRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync( + String azureRegion, CrossRegionRestoreRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .trigger( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync( + String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .trigger( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerAsync( + String azureRegion, CrossRegionRestoreRequest parameters) { + Mono>> mono = triggerWithResponseAsync(azureRegion, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerAsync( + String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = triggerWithResponseAsync(azureRegion, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTrigger(String azureRegion, CrossRegionRestoreRequest parameters) { + return beginTriggerAsync(azureRegion, parameters).getSyncPoller(); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTrigger( + String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + return beginTriggerAsync(azureRegion, parameters, context).getSyncPoller(); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String azureRegion, CrossRegionRestoreRequest parameters) { + return beginTriggerAsync(azureRegion, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + return beginTriggerAsync(azureRegion, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters) { + triggerAsync(azureRegion, parameters).block(); + } + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + triggerAsync(azureRegion, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.java new file mode 100644 index 0000000000000..741edff30a721 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossRegionRestoresImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossRegionRestores; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CrossRegionRestoresImpl implements CrossRegionRestores { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrossRegionRestoresImpl.class); + + private final CrossRegionRestoresClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public CrossRegionRestoresImpl( + CrossRegionRestoresClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters) { + this.serviceClient().trigger(azureRegion, parameters); + } + + public void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context) { + this.serviceClient().trigger(azureRegion, parameters, context); + } + + private CrossRegionRestoresClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java new file mode 100644 index 0000000000000..00a7f182aca8f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrAccessTokenResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessToken; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessTokenResource; +import java.util.Collections; +import java.util.Map; + +public final class CrrAccessTokenResourceImpl implements CrrAccessTokenResource { + private CrrAccessTokenResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + CrrAccessTokenResourceImpl(CrrAccessTokenResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CrrAccessToken properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public CrrAccessTokenResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java new file mode 100644 index 0000000000000..d544fc79c6d36 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsClientImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.CrrOperationResultsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CrrOperationResultsClient. */ +public final class CrrOperationResultsClientImpl implements CrrOperationResultsClient { + private final ClientLogger logger = new ClientLogger(CrrOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CrrOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of CrrOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrrOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(CrrOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientCrrOperationResults to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface CrrOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupCrrOperationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, String operationId) { + return getWithResponseAsync(azureRegion, operationId).flatMap((Response res) -> Mono.empty()); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String azureRegion, String operationId) { + getAsync(azureRegion, operationId).block(); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, String operationId, Context context) { + return getWithResponseAsync(azureRegion, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.java new file mode 100644 index 0000000000000..4191ae59f3b78 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationResultsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CrrOperationResultsImpl implements CrrOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrOperationResultsImpl.class); + + private final CrrOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public CrrOperationResultsImpl( + CrrOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String azureRegion, String operationId) { + this.serviceClient().get(azureRegion, operationId); + } + + public Response getWithResponse(String azureRegion, String operationId, Context context) { + return this.serviceClient().getWithResponse(azureRegion, operationId, context); + } + + private CrrOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.java new file mode 100644 index 0000000000000..f8f7c1e9f329e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusClientImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CrrOperationStatusClient. */ +public final class CrrOperationStatusClientImpl implements CrrOperationStatusClient { + private final ClientLogger logger = new ClientLogger(CrrOperationStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CrrOperationStatusService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of CrrOperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrrOperationStatusClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(CrrOperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientCrrOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface CrrOperationStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupCrrOperationsStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String azureRegion, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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 operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String azureRegion, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String azureRegion, String operationId) { + return getWithResponseAsync(azureRegion, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String azureRegion, String operationId) { + return getAsync(azureRegion, operationId).block(); + } + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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 operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String azureRegion, String operationId, Context context) { + return getWithResponseAsync(azureRegion, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.java new file mode 100644 index 0000000000000..dac89b4f7b9ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrrOperationStatusImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrOperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CrrOperationStatusImpl implements CrrOperationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrOperationStatusImpl.class); + + private final CrrOperationStatusClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public CrrOperationStatusImpl(CrrOperationStatusClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus get(String azureRegion, String operationId) { + OperationStatusInner inner = this.serviceClient().get(azureRegion, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String azureRegion, String operationId, Context context) { + Response inner = this.serviceClient().getWithResponse(azureRegion, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private CrrOperationStatusClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java new file mode 100644 index 0000000000000..dd7753bc4a35c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. */ +public final class ExportJobsOperationResultsClientImpl implements ExportJobsOperationResultsClient { + private final ClientLogger logger = new ClientLogger(ExportJobsOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExportJobsOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ExportJobsOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExportJobsOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ExportJobsOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientExportJobsOperationResults to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ExportJobsOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobs/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultInfoBaseResourceInner get(String vaultName, String resourceGroupName, String operationId) { + return getAsync(vaultName, resourceGroupName, operationId).block(); + } + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java new file mode 100644 index 0000000000000..692b88722d6b9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBaseResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExportJobsOperationResultsImpl implements ExportJobsOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsOperationResultsImpl.class); + + private final ExportJobsOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ExportJobsOperationResultsImpl( + ExportJobsOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResultInfoBaseResource get(String vaultName, String resourceGroupName, String operationId) { + OperationResultInfoBaseResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, operationId); + if (inner != null) { + return new OperationResultInfoBaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResultInfoBaseResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExportJobsOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java new file mode 100644 index 0000000000000..90809a1dec306 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.FeatureSupportsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FeatureSupportsClient. */ +public final class FeatureSupportsClientImpl implements FeatureSupportsClient { + private final ClientLogger logger = new ClientLogger(FeatureSupportsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FeatureSupportsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of FeatureSupportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeatureSupportsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(FeatureSupportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientFeatureSupports to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface FeatureSupportsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupValidateFeatures") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FeatureSupportRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String azureRegion, FeatureSupportRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String azureRegion, FeatureSupportRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String azureRegion, FeatureSupportRequest parameters) { + return validateWithResponseAsync(azureRegion, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureVMResourceFeatureSupportResponseInner validate(String azureRegion, FeatureSupportRequest parameters) { + return validateAsync(azureRegion, parameters).block(); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String azureRegion, FeatureSupportRequest parameters, Context context) { + return validateWithResponseAsync(azureRegion, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java new file mode 100644 index 0000000000000..359c5bc9b1930 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FeatureSupportsImpl implements FeatureSupports { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureSupportsImpl.class); + + private final FeatureSupportsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public FeatureSupportsImpl(FeatureSupportsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AzureVMResourceFeatureSupportResponse validate(String azureRegion, FeatureSupportRequest parameters) { + AzureVMResourceFeatureSupportResponseInner inner = this.serviceClient().validate(azureRegion, parameters); + if (inner != null) { + return new AzureVMResourceFeatureSupportResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateWithResponse( + String azureRegion, FeatureSupportRequest parameters, Context context) { + Response inner = + this.serviceClient().validateWithResponse(azureRegion, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureVMResourceFeatureSupportResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private FeatureSupportsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java new file mode 100644 index 0000000000000..320066766297d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java @@ -0,0 +1,620 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ItemLevelRecoveryConnectionsClient. */ +public final class ItemLevelRecoveryConnectionsClientImpl implements ItemLevelRecoveryConnectionsClient { + private final ClientLogger logger = new ClientLogger(ItemLevelRecoveryConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ItemLevelRecoveryConnectionsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ItemLevelRecoveryConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ItemLevelRecoveryConnectionsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ItemLevelRecoveryConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientItemLevelRecoveryConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ItemLevelRecoveryConnectionsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> provision( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @BodyParam("application/json") IlrRequestResource parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> revoke( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> provisionWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .provision( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> provisionWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .provision( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters) { + return provisionWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void provision( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters) { + provisionAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .block(); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response provisionWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters, + Context context) { + return provisionWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .block(); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revokeWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .revoke( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revokeWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .revoke( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + accept, + context); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + return revokeWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revoke( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + revokeAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId) + .block(); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response revokeWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + return revokeWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java new file mode 100644 index 0000000000000..a1b4172058281 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ItemLevelRecoveryConnectionsImpl implements ItemLevelRecoveryConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ItemLevelRecoveryConnectionsImpl.class); + + private final ItemLevelRecoveryConnectionsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ItemLevelRecoveryConnectionsImpl( + ItemLevelRecoveryConnectionsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void provision( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters) { + this + .serviceClient() + .provision( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + } + + public Response provisionWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters, + Context context) { + return this + .serviceClient() + .provisionWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + } + + public void revoke( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + this + .serviceClient() + .revoke(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId); + } + + public Response revokeWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + return this + .serviceClient() + .revokeWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, context); + } + + private ItemLevelRecoveryConnectionsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java new file mode 100644 index 0000000000000..9d4d6b7cf4cd2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.JobCancellationsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobCancellationsClient. */ +public final class JobCancellationsClientImpl implements JobCancellationsClient { + private final ClientLogger logger = new ClientLogger(JobCancellationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobCancellationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobCancellationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobCancellationsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(JobCancellationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientJobCancellations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface JobCancellationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobs/{jobName}/cancel") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> trigger( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> triggerWithResponseAsync(String vaultName, String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> triggerWithResponseAsync( + String vaultName, String resourceGroupName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context); + } + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String vaultName, String resourceGroupName, String jobName) { + return triggerWithResponseAsync(vaultName, resourceGroupName, jobName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String vaultName, String resourceGroupName, String jobName) { + triggerAsync(vaultName, resourceGroupName, jobName).block(); + } + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response triggerWithResponse( + String vaultName, String resourceGroupName, String jobName, Context context) { + return triggerWithResponseAsync(vaultName, resourceGroupName, jobName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java new file mode 100644 index 0000000000000..171775ba35479 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobCancellations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobCancellationsImpl implements JobCancellations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobCancellationsImpl.class); + + private final JobCancellationsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public JobCancellationsImpl(JobCancellationsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void trigger(String vaultName, String resourceGroupName, String jobName) { + this.serviceClient().trigger(vaultName, resourceGroupName, jobName); + } + + public Response triggerWithResponse( + String vaultName, String resourceGroupName, String jobName, Context context) { + return this.serviceClient().triggerWithResponse(vaultName, resourceGroupName, jobName, context); + } + + private JobCancellationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java new file mode 100644 index 0000000000000..b05b2824e0187 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.JobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobDetailsClient. */ +public final class JobDetailsClientImpl implements JobDetailsClient { + private final ClientLogger logger = new ClientLogger(JobDetailsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobDetailsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobDetailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobDetailsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(JobDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientJobDetails to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface JobDetailsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + accept, + context); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName, String jobName) { + return getWithResponseAsync(vaultName, resourceGroupName, jobName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobResourceInner get(String vaultName, String resourceGroupName, String jobName) { + return getAsync(vaultName, resourceGroupName, jobName).block(); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, jobName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java new file mode 100644 index 0000000000000..2963c8f491f58 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobDetailsImpl implements JobDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDetailsImpl.class); + + private final JobDetailsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public JobDetailsImpl(JobDetailsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public JobResource get(String vaultName, String resourceGroupName, String jobName) { + JobResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, jobName); + if (inner != null) { + return new JobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private JobDetailsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java new file mode 100644 index 0000000000000..7f1673c7ca689 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.JobOperationResultsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobOperationResultsClient. */ +public final class JobOperationResultsClientImpl implements JobOperationResultsClient { + private final ClientLogger logger = new ClientLogger(JobOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(JobOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientJobOperationResults to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface JobOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("jobName") String jobName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String jobName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String jobName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + jobName, + operationId, + accept, + context); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName, String jobName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, jobName, operationId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { + getAsync(vaultName, resourceGroupName, jobName, operationId).block(); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, jobName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java new file mode 100644 index 0000000000000..460ed3101ab87 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobOperationResultsImpl implements JobOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobOperationResultsImpl.class); + + private final JobOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public JobOperationResultsImpl( + JobOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { + this.serviceClient().get(vaultName, resourceGroupName, jobName, operationId); + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, String operationId, Context context) { + return this.serviceClient().getWithResponse(vaultName, resourceGroupName, jobName, operationId, context); + } + + private JobOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java new file mode 100644 index 0000000000000..ced5716dc1bf5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.Job; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import java.util.Collections; +import java.util.Map; + +public final class JobResourceImpl implements JobResource { + private JobResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + JobResourceImpl(JobResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Job properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public JobResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java new file mode 100644 index 0000000000000..f2fca16562a77 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.JobsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public final class JobsClientImpl implements JobsClient { + private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface JobsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupJobsExport") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> export( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportWithResponseAsync(String vaultName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .export( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportWithResponseAsync( + String vaultName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .export( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + filter, + accept, + context); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync(String vaultName, String resourceGroupName, String filter) { + return exportWithResponseAsync(vaultName, resourceGroupName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync(String vaultName, String resourceGroupName) { + final String filter = null; + return exportWithResponseAsync(vaultName, resourceGroupName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void export(String vaultName, String resourceGroupName) { + final String filter = null; + exportAsync(vaultName, resourceGroupName, filter).block(); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportWithResponse( + String vaultName, String resourceGroupName, String filter, Context context) { + return exportWithResponseAsync(vaultName, resourceGroupName, filter, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java new file mode 100644 index 0000000000000..a8e2cd7e9a8ea --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobsImpl implements Jobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + + private final JobsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public JobsImpl(JobsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void export(String vaultName, String resourceGroupName) { + this.serviceClient().export(vaultName, resourceGroupName); + } + + public Response exportWithResponse( + String vaultName, String resourceGroupName, String filter, Context context) { + return this.serviceClient().exportWithResponse(vaultName, resourceGroupName, filter, context); + } + + private JobsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java new file mode 100644 index 0000000000000..6ef0979789ce8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.HttpStatusCode; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBase; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBaseResource; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class OperationResultInfoBaseResourceImpl implements OperationResultInfoBaseResource { + private OperationResultInfoBaseResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + OperationResultInfoBaseResourceImpl( + OperationResultInfoBaseResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public HttpStatusCode statusCode() { + return this.innerModel().statusCode(); + } + + public Map> headers() { + Map> inner = this.innerModel().headers(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationResultInfoBase operation() { + return this.innerModel().operation(); + } + + public OperationResultInfoBaseResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java new file mode 100644 index 0000000000000..2a9cf97adacc3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusError; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusExtendedInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusValues; +import java.time.OffsetDateTime; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + OperationStatusImpl(OperationStatusInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationStatusValues status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public OperationStatusError error() { + return this.innerModel().error(); + } + + public OperationStatusExtendedInfo properties() { + return this.innerModel().properties(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..0e8d83dead699 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupValidateOperation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ValidateOperationRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateWithResponseAsync(vaultName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationsResponseInner validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + return validateWithResponseAsync(vaultName, resourceGroupName, parameters, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..bc9bffdafbd86 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ValidateOperationsResponse validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + ValidateOperationsResponseInner inner = this.serviceClient().validate(vaultName, resourceGroupName, parameters); + if (inner != null) { + return new ValidateOperationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context) { + Response inner = + this.serviceClient().validateWithResponse(vaultName, resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java new file mode 100644 index 0000000000000..83443d9e090ef --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsOperationsClient. */ +public final class OperationsOperationsClientImpl implements OperationsOperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsOperationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of OperationsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsOperationsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(OperationsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientOperationsOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface OperationsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.RecoveryServices/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2016-08-10"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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()))); + } + + /** + * Returns the list of available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2016-08-10"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns the list of available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns the list of available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + @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 operations List response which contains list of available APIs. + */ + @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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java new file mode 100644 index 0000000000000..520b547306537 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsOperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationsOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsOperationsImpl implements OperationsOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsOperationsImpl.class); + + private final OperationsOperationsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public OperationsOperationsImpl( + OperationsOperationsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); + } + + private OperationsOperationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java new file mode 100644 index 0000000000000..b27a86caf961b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.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.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidationStatus; + +public final class PreValidateEnableBackupResponseImpl implements PreValidateEnableBackupResponse { + private PreValidateEnableBackupResponseInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + PreValidateEnableBackupResponseImpl( + PreValidateEnableBackupResponseInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ValidationStatus status() { + return this.innerModel().status(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public String recommendation() { + return this.innerModel().recommendation(); + } + + public String containerName() { + return this.innerModel().containerName(); + } + + public String protectedItemName() { + return this.innerModel().protectedItemName(); + } + + public PreValidateEnableBackupResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java new file mode 100644 index 0000000000000..7b251cd5b43c2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; +import java.util.Collections; +import java.util.Map; + +public final class PrivateEndpointConnectionResourceImpl + implements PrivateEndpointConnectionResource, + PrivateEndpointConnectionResource.Definition, + PrivateEndpointConnectionResource.Update { + private PrivateEndpointConnectionResourceInner innerObject; + + private final RecoveryServicesBackupManager 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 PrivateEndpointConnection properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateEndpointConnectionResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String vaultName; + + private String resourceGroupName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionResourceImpl withExistingVault(String vaultName, String resourceGroupName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateEndpointConnectionResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnectionResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionResourceImpl(String name, RecoveryServicesBackupManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionResourceInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionResourceImpl update() { + return this; + } + + public PrivateEndpointConnectionResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnectionResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionResourceImpl( + PrivateEndpointConnectionResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnectionResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnectionResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateEndpointConnectionResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateEndpointConnectionResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateEndpointConnectionResourceImpl withProperties(PrivateEndpointConnection properties) { + this.innerModel().withProperties(properties); + return this; + } + + public PrivateEndpointConnectionResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..b8ff1e43d66ed --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,886 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.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.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; +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 PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> put( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return getWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner get( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return getAsync(vaultName, resourceGroupName, privateEndpointConnectionName).block(); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context).block(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionResourceInner> + beginPutAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + Mono>> mono = + putWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionResourceInner.class, + PrivateEndpointConnectionResourceInner.class, + Context.NONE); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionResourceInner> + beginPutAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + putWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionResourceInner.class, + PrivateEndpointConnectionResourceInner.class, + context); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginPut( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + return beginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).getSyncPoller(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginPut( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context) { + return beginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + return beginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context) { + return beginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner put( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters) { + return putAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 private Endpoint Connection Response Properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner put( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + PrivateEndpointConnectionResourceInner parameters, + Context context) { + return putAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context).block(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + deleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).block(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + deleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..dc1bad8207e0a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnectionResource get( + String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + PrivateEndpointConnectionResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + this.serviceClient().delete(vaultName, resourceGroupName, privateEndpointConnectionName); + } + + public void delete( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(vaultName, resourceGroupName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnectionResource getById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(vaultName, resourceGroupName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionResourceImpl define(String name) { + return new PrivateEndpointConnectionResourceImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java new file mode 100644 index 0000000000000..fa50dd15a05f2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointsClient. */ +public final class PrivateEndpointsClientImpl implements PrivateEndpointsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of PrivateEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(PrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientPrivateEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface PrivateEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus" + + "/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOperationStatus( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOperationStatus( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + String operationId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOperationStatus( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + operationId, + accept, + context); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationStatusAsync( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + return getOperationStatusWithResponseAsync( + vaultName, resourceGroupName, privateEndpointConnectionName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner getOperationStatus( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + return getOperationStatusAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId) + .block(); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation status for a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + String operationId, + Context context) { + return getOperationStatusWithResponseAsync( + vaultName, resourceGroupName, privateEndpointConnectionName, operationId, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java new file mode 100644 index 0000000000000..15092103fed0e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointsImpl implements PrivateEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointsImpl.class); + + private final PrivateEndpointsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public PrivateEndpointsImpl(PrivateEndpointsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus getOperationStatus( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + OperationStatusInner inner = + this + .serviceClient() + .getOperationStatus(vaultName, resourceGroupName, privateEndpointConnectionName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOperationStatusWithResponse( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + String operationId, + Context context) { + Response inner = + this + .serviceClient() + .getOperationStatusWithResponse( + vaultName, resourceGroupName, privateEndpointConnectionName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java new file mode 100644 index 0000000000000..939c880c84bcc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainer; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainerResource; +import java.util.Collections; +import java.util.Map; + +public final class ProtectableContainerResourceImpl implements ProtectableContainerResource { + private ProtectableContainerResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + ProtectableContainerResourceImpl( + ProtectableContainerResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProtectableContainer properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProtectableContainerResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java new file mode 100644 index 0000000000000..b4d81c67387e6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainerResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectableContainersClient. */ +public final class ProtectableContainersClientImpl implements ProtectableContainersClient { + private final ClientLogger logger = new ClientLogger(ProtectableContainersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectableContainersService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectableContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectableContainersClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(ProtectableContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectableContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectableContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @QueryParam("$filter") String filter, + @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 containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String fabricName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + 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 containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, String resourceGroupName, String fabricName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName) { + final String filter = null; + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, fabricName, filter)); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context) { + return new PagedIterable<>(listAsync(vaultName, resourceGroupName, fabricName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer 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 list of ProtectableContainer 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java new file mode 100644 index 0000000000000..425155eef1137 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainerResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectableContainersImpl implements ProtectableContainers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableContainersImpl.class); + + private final ProtectableContainersClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectableContainersImpl( + ProtectableContainersClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, fabricName); + return inner.mapPage(inner1 -> new ProtectableContainerResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, fabricName, filter, context); + return inner.mapPage(inner1 -> new ProtectableContainerResourceImpl(inner1, this.manager())); + } + + private ProtectableContainersClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java new file mode 100644 index 0000000000000..87e6d9e84dc32 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationResultsClient. */ +public final class ProtectedItemOperationResultsClientImpl implements ProtectedItemOperationResultsClient { + private final ClientLogger logger = new ClientLogger(ProtectedItemOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectedItemOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectedItemOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectedItemOperationResults to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectedItemOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/operationResults/{operationId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + operationId, + accept, + context); + } + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemResourceInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + return getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .block(); + } + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java new file mode 100644 index 0000000000000..1a781393124ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectedItemOperationResultsImpl implements ProtectedItemOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItemOperationResultsImpl.class); + + private final ProtectedItemOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectedItemOperationResultsImpl( + ProtectedItemOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectedItemResource get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + ProtectedItemResourceInner inner = + this + .serviceClient() + .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId); + if (inner != null) { + return new ProtectedItemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectedItemResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProtectedItemOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java new file mode 100644 index 0000000000000..f4d8e2d2f4441 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusesClient. */ +public final class ProtectedItemOperationStatusesClientImpl implements ProtectedItemOperationStatusesClient { + private final ClientLogger logger = new ClientLogger(ProtectedItemOperationStatusesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectedItemOperationStatusesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationStatusesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectedItemOperationStatusesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectedItemOperationStatuses to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectedItemOperationStatusesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/operationsStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + operationId, + accept, + context); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + return getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .block(); + } + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java new file mode 100644 index 0000000000000..2da0861037bd0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatuses; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectedItemOperationStatusesImpl implements ProtectedItemOperationStatuses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItemOperationStatusesImpl.class); + + private final ProtectedItemOperationStatusesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectedItemOperationStatusesImpl( + ProtectedItemOperationStatusesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId) { + OperationStatusInner inner = + this + .serviceClient() + .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProtectedItemOperationStatusesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java new file mode 100644 index 0000000000000..a97b0978fb896 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import java.util.Collections; +import java.util.Map; + +public final class ProtectedItemResourceImpl + implements ProtectedItemResource, ProtectedItemResource.Definition, ProtectedItemResource.Update { + private ProtectedItemResourceInner innerObject; + + private final RecoveryServicesBackupManager 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 ProtectedItem properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProtectedItemResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String vaultName; + + private String resourceGroupName; + + private String fabricName; + + private String containerName; + + private String protectedItemName; + + public ProtectedItemResourceImpl withExistingProtectionContainer( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + this.containerName = containerName; + return this; + } + + public ProtectedItemResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .createOrUpdateWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ProtectedItemResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .createOrUpdateWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + this.innerModel(), + context) + .getValue(); + return this; + } + + ProtectedItemResourceImpl(String name, RecoveryServicesBackupManager serviceManager) { + this.innerObject = new ProtectedItemResourceInner(); + this.serviceManager = serviceManager; + this.protectedItemName = name; + } + + public ProtectedItemResourceImpl update() { + return this; + } + + public ProtectedItemResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .createOrUpdateWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ProtectedItemResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .createOrUpdateWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + this.innerModel(), + context) + .getValue(); + return this; + } + + ProtectedItemResourceImpl(ProtectedItemResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "backupFabrics"); + this.containerName = Utils.getValueFromIdByName(innerObject.id(), "protectionContainers"); + this.protectedItemName = Utils.getValueFromIdByName(innerObject.id(), "protectedItems"); + } + + public ProtectedItemResource refresh() { + String localFilter = null; + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .getWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + localFilter, + Context.NONE) + .getValue(); + return this; + } + + public ProtectedItemResource refresh(Context context) { + String localFilter = null; + this.innerObject = + serviceManager + .serviceClient() + .getProtectedItems() + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, localFilter, context) + .getValue(); + return this; + } + + public ProtectedItemResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProtectedItemResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProtectedItemResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProtectedItemResourceImpl withProperties(ProtectedItem properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProtectedItemResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java new file mode 100644 index 0000000000000..5190df7d4cd58 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java @@ -0,0 +1,829 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.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.recoveryservicesbackup.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectedItemsClient. */ +public final class ProtectedItemsClientImpl implements ProtectedItemsClient { + private final ClientLogger logger = new ClientLogger(ProtectedItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectedItemsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(ProtectedItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectedItems to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectedItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @BodyParam("application/json") ProtectedItemResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + filter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + filter, + accept, + context); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).block(); + } + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context) + .block(); + } + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + accept, + context); + } + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters) { + return createOrUpdateWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemResourceInner createOrUpdate( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters) { + return createOrUpdateAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + .block(); + } + + /** + * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an + * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Item name to be backed up. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ProtectedItemResourceInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context) + .block(); + } + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + accept, + context); + } + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return deleteWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + deleteAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).block(); + } + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + Context context) { + return deleteWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java new file mode 100644 index 0000000000000..95a0065aa7a25 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItems; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectedItemsImpl implements ProtectedItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItemsImpl.class); + + private final ProtectedItemsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectedItemsImpl(ProtectedItemsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectedItemResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + ProtectedItemResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); + if (inner != null) { + return new ProtectedItemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectedItemResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + this.serviceClient().delete(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); + } + + public Response deleteWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, context); + } + + public ProtectedItemResource getById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + String localFilter = null; + return this + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, localFilter, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String filter, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + return this + .getWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); + } + + public void deleteById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + this + .deleteWithResponse( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + String protectedItemName = Utils.getValueFromIdByName(id, "protectedItems"); + if (protectedItemName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); + } + return this + .deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, context); + } + + private ProtectedItemsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public ProtectedItemResourceImpl define(String name) { + return new ProtectedItemResourceImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java new file mode 100644 index 0000000000000..158b35f607960 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProtectionContainerOperationResultsClient. + */ +public final class ProtectionContainerOperationResultsClientImpl implements ProtectionContainerOperationResultsClient { + private final ClientLogger logger = new ClientLogger(ProtectionContainerOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionContainerOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainerOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionContainerOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectionContainerOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionContainerOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionContainerOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults" + + "/{operationId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String operationId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + operationId, + accept, + context); + } + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + return getAsync(vaultName, resourceGroupName, fabricName, containerName, operationId).block(); + } + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String operationId, + Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId, context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java new file mode 100644 index 0000000000000..1e01570e156ab --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionContainerOperationResultsImpl implements ProtectionContainerOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerOperationResultsImpl.class); + + private final ProtectionContainerOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionContainerOperationResultsImpl( + ProtectionContainerOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectionContainerResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + ProtectionContainerResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName, operationId); + if (inner != null) { + return new ProtectionContainerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String operationId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionContainerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProtectionContainerOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java new file mode 100644 index 0000000000000..b318b96f1cf09 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectionContainerRefreshOperationResultsClient. + */ +public final class ProtectionContainerRefreshOperationResultsClientImpl + implements ProtectionContainerRefreshOperationResultsClient { + private final ClientLogger logger = new ClientLogger(ProtectionContainerRefreshOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionContainerRefreshOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainerRefreshOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionContainerRefreshOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectionContainerRefreshOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupClientProtectionContainerRefreshOperationResults to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionContainerRefreshOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + operationId, + accept, + context); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, operationId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String vaultName, String resourceGroupName, String fabricName, String operationId) { + getAsync(vaultName, resourceGroupName, fabricName, operationId).block(); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java new file mode 100644 index 0000000000000..c80a04fff6985 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerRefreshOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionContainerRefreshOperationResultsImpl + implements ProtectionContainerRefreshOperationResults { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ProtectionContainerRefreshOperationResultsImpl.class); + + private final ProtectionContainerRefreshOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionContainerRefreshOperationResultsImpl( + ProtectionContainerRefreshOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String vaultName, String resourceGroupName, String fabricName, String operationId) { + this.serviceClient().get(vaultName, resourceGroupName, fabricName, operationId); + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String operationId, Context context) { + return this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, operationId, context); + } + + private ProtectionContainerRefreshOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java new file mode 100644 index 0000000000000..8c2704f1fc82a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; +import java.util.Collections; +import java.util.Map; + +public final class ProtectionContainerResourceImpl + implements ProtectionContainerResource, ProtectionContainerResource.Definition, ProtectionContainerResource.Update { + private ProtectionContainerResourceInner innerObject; + + private final RecoveryServicesBackupManager 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 ProtectionContainer properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProtectionContainerResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String vaultName; + + private String resourceGroupName; + + private String fabricName; + + private String containerName; + + public ProtectionContainerResourceImpl withExistingBackupFabric( + String vaultName, String resourceGroupName, String fabricName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public ProtectionContainerResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .registerWithResponse( + vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionContainerResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .registerWithResponse( + vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionContainerResourceImpl(String name, RecoveryServicesBackupManager serviceManager) { + this.innerObject = new ProtectionContainerResourceInner(); + this.serviceManager = serviceManager; + this.containerName = name; + } + + public ProtectionContainerResourceImpl update() { + return this; + } + + public ProtectionContainerResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .registerWithResponse( + vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionContainerResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .registerWithResponse( + vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionContainerResourceImpl( + ProtectionContainerResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "backupFabrics"); + this.containerName = Utils.getValueFromIdByName(innerObject.id(), "protectionContainers"); + } + + public ProtectionContainerResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE) + .getValue(); + return this; + } + + public ProtectionContainerResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionContainers() + .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context) + .getValue(); + return this; + } + + public ProtectionContainerResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProtectionContainerResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProtectionContainerResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProtectionContainerResourceImpl withProperties(ProtectionContainer properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProtectionContainerResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java new file mode 100644 index 0000000000000..4865d868b2e52 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java @@ -0,0 +1,1127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.recoveryservicesbackup.fluent.ProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectionContainersClient. */ +public final class ProtectionContainersClientImpl implements ProtectionContainersClient { + private final ClientLogger logger = new ClientLogger(ProtectionContainersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionContainersService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionContainersClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create(ProtectionContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> register( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @BodyParam("application/json") ProtectionContainerResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> unregister( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> inquire( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> refresh( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + accept, + context); + } + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + return getAsync(vaultName, resourceGroupName, fabricName, containerName).block(); + } + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, context).block(); + } + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> registerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .register( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for 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 base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> registerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .register( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + parameters, + accept, + context); + } + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono registerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters) { + return registerWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionContainerResourceInner register( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters) { + return registerAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).block(); + } + + /** + * Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation + * status, use location header to call get latest status of the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for 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 base class for container with backup items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response registerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + ProtectionContainerResourceInner parameters, + Context context) { + return registerWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters, context) + .block(); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unregisterWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .unregister( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unregisterWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .unregister( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + accept, + context); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unregisterAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + return unregisterWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName) { + unregisterAsync(vaultName, resourceGroupName, fabricName, containerName).block(); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response unregisterWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + return unregisterWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, context).block(); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> inquireWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .inquire( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + filter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> inquireWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .inquire( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + filter, + accept, + context); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono inquireAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String filter) { + return inquireWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono inquireAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + final String filter = null; + return inquireWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName) { + final String filter = null; + inquireAsync(vaultName, resourceGroupName, fabricName, containerName, filter).block(); + } + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response inquireWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + Context context) { + return inquireWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter, context) + .block(); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> refreshWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refresh( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + filter, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> refreshWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refresh( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + filter, + accept, + context); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String vaultName, String resourceGroupName, String fabricName, String filter) { + return refreshWithResponseAsync(vaultName, resourceGroupName, fabricName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String vaultName, String resourceGroupName, String fabricName) { + final String filter = null; + return refreshWithResponseAsync(vaultName, resourceGroupName, fabricName, filter) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void refresh(String vaultName, String resourceGroupName, String fabricName) { + final String filter = null; + refreshAsync(vaultName, resourceGroupName, fabricName, filter).block(); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response refreshWithResponse( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context) { + return refreshWithResponseAsync(vaultName, resourceGroupName, fabricName, filter, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java new file mode 100644 index 0000000000000..fb19bd300ced9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionContainersImpl implements ProtectionContainers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainersImpl.class); + + private final ProtectionContainersClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionContainersImpl( + ProtectionContainersClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectionContainerResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName) { + ProtectionContainerResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName); + if (inner != null) { + return new ProtectionContainerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionContainerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName) { + this.serviceClient().unregister(vaultName, resourceGroupName, fabricName, containerName); + } + + public Response unregisterWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context) { + return this + .serviceClient() + .unregisterWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); + } + + public void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName) { + this.serviceClient().inquire(vaultName, resourceGroupName, fabricName, containerName); + } + + public Response inquireWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + Context context) { + return this + .serviceClient() + .inquireWithResponse(vaultName, resourceGroupName, fabricName, containerName, filter, context); + } + + public void refresh(String vaultName, String resourceGroupName, String fabricName) { + this.serviceClient().refresh(vaultName, resourceGroupName, fabricName); + } + + public Response refreshWithResponse( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context) { + return this.serviceClient().refreshWithResponse(vaultName, resourceGroupName, fabricName, filter, context); + } + + public ProtectionContainerResource getById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + return this.getWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "protectionContainers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", + id))); + } + return this.getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); + } + + private ProtectionContainersClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public ProtectionContainerResourceImpl define(String name) { + return new ProtectionContainerResourceImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java new file mode 100644 index 0000000000000..60e7c2fc2f983 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; +import java.util.Collections; +import java.util.Map; + +public final class ProtectionIntentResourceImpl + implements ProtectionIntentResource, ProtectionIntentResource.Definition, ProtectionIntentResource.Update { + private ProtectionIntentResourceInner innerObject; + + private final RecoveryServicesBackupManager 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 ProtectionIntent properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProtectionIntentResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String vaultName; + + private String resourceGroupName; + + private String fabricName; + + private String intentObjectName; + + public ProtectionIntentResourceImpl withExistingBackupFabric( + String vaultName, String resourceGroupName, String fabricName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + public ProtectionIntentResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .createOrUpdateWithResponse( + vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionIntentResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .createOrUpdateWithResponse( + vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionIntentResourceImpl(String name, RecoveryServicesBackupManager serviceManager) { + this.innerObject = new ProtectionIntentResourceInner(); + this.serviceManager = serviceManager; + this.intentObjectName = name; + } + + public ProtectionIntentResourceImpl update() { + return this; + } + + public ProtectionIntentResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .createOrUpdateWithResponse( + vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionIntentResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .createOrUpdateWithResponse( + vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionIntentResourceImpl( + ProtectionIntentResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fabricName = Utils.getValueFromIdByName(innerObject.id(), "backupFabrics"); + this.intentObjectName = Utils.getValueFromIdByName(innerObject.id(), "backupProtectionIntent"); + } + + public ProtectionIntentResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE) + .getValue(); + return this; + } + + public ProtectionIntentResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionIntents() + .getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context) + .getValue(); + return this; + } + + public ProtectionIntentResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProtectionIntentResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProtectionIntentResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProtectionIntentResourceImpl withProperties(ProtectionIntent properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProtectionIntentResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java new file mode 100644 index 0000000000000..2323123d0161f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java @@ -0,0 +1,865 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.recoveryservicesbackup.fluent.ProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProtectionIntentsClient. */ +public final class ProtectionIntentsClientImpl implements ProtectionIntentsClient { + private final ClientLogger logger = new ClientLogger(ProtectionIntentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionIntentsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionIntentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionIntentsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(ProtectionIntentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionIntents to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionIntentsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}" + + "/backupPreValidateProtection") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("azureRegion") String azureRegion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PreValidateEnableBackupRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("intentObjectName") String intentObjectName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("intentObjectName") String intentObjectName, + @BodyParam("application/json") ProtectionIntentResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("intentObjectName") String intentObjectName, + Context context); + } + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String azureRegion, PreValidateEnableBackupRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String azureRegion, PreValidateEnableBackupRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (azureRegion == null) { + return Mono.error(new IllegalArgumentException("Parameter azureRegion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + apiVersion, + azureRegion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String azureRegion, PreValidateEnableBackupRequest parameters) { + return validateWithResponseAsync(azureRegion, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PreValidateEnableBackupResponseInner validate( + String azureRegion, PreValidateEnableBackupRequest parameters) { + return validateAsync(azureRegion, parameters).block(); + } + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String azureRegion, PreValidateEnableBackupRequest parameters, Context context) { + return validateWithResponseAsync(azureRegion, parameters, context).block(); + } + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + accept, + context); + } + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionIntentResourceInner get( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + return getAsync(vaultName, resourceGroupName, fabricName, intentObjectName).block(); + } + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, context).block(); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + parameters, + accept, + context); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters) { + return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionIntentResourceInner createOrUpdate( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters) { + return createOrUpdateAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters).block(); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String intentObjectName, + ProtectionIntentResourceInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + vaultName, resourceGroupName, fabricName, intentObjectName, parameters, context) + .block(); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (intentObjectName == null) { + return Mono + .error(new IllegalArgumentException("Parameter intentObjectName is required and cannot be null.")); + } + final String apiVersion = "2017-07-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + intentObjectName, + context); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + return deleteWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + deleteAsync(vaultName, resourceGroupName, fabricName, intentObjectName).block(); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + return deleteWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java new file mode 100644 index 0000000000000..edb31696d0898 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntents; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionIntentsImpl implements ProtectionIntents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionIntentsImpl.class); + + private final ProtectionIntentsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionIntentsImpl(ProtectionIntentsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PreValidateEnableBackupResponse validate(String azureRegion, PreValidateEnableBackupRequest parameters) { + PreValidateEnableBackupResponseInner inner = this.serviceClient().validate(azureRegion, parameters); + if (inner != null) { + return new PreValidateEnableBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateWithResponse( + String azureRegion, PreValidateEnableBackupRequest parameters, Context context) { + Response inner = + this.serviceClient().validateWithResponse(azureRegion, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PreValidateEnableBackupResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProtectionIntentResource get( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + ProtectionIntentResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, fabricName, intentObjectName); + if (inner != null) { + return new ProtectionIntentResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionIntentResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + this.serviceClient().delete(vaultName, resourceGroupName, fabricName, intentObjectName); + } + + public Response deleteWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context) { + return this + .serviceClient() + .deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); + } + + public ProtectionIntentResource getById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String intentObjectName = Utils.getValueFromIdByName(id, "backupProtectionIntent"); + if (intentObjectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", + id))); + } + return this + .getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String intentObjectName = Utils.getValueFromIdByName(id, "backupProtectionIntent"); + if (intentObjectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", + id))); + } + return this.getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); + } + + public void deleteById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String intentObjectName = Utils.getValueFromIdByName(id, "backupProtectionIntent"); + if (intentObjectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", + id))); + } + this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 fabricName = Utils.getValueFromIdByName(id, "backupFabrics"); + if (fabricName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); + } + String intentObjectName = Utils.getValueFromIdByName(id, "backupProtectionIntent"); + if (intentObjectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", + id))); + } + return this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); + } + + private ProtectionIntentsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public ProtectionIntentResourceImpl define(String name) { + return new ProtectionIntentResourceImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java new file mode 100644 index 0000000000000..e32c464dff317 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java @@ -0,0 +1,742 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.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.recoveryservicesbackup.fluent.ProtectionPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +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 ProtectionPoliciesClient. */ +public final class ProtectionPoliciesClientImpl implements ProtectionPoliciesClient { + private final ClientLogger logger = new ClientLogger(ProtectionPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionPoliciesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionPoliciesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(ProtectionPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies/{policyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @BodyParam("application/json") ProtectionPolicyResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies/{policyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + accept, + context); + } + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String policyName) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName) { + return getAsync(vaultName, resourceGroupName, policyName).block(); + } + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName, context).block(); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String vaultName, + String resourceGroupName, + String policyName, + ProtectionPolicyResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + parameters, + accept, + context); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters) { + return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, policyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionPolicyResourceInner createOrUpdate( + String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters) { + return createOrUpdateAsync(vaultName, resourceGroupName, policyName, parameters).block(); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched + * using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be created. + * @param parameters resource backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String vaultName, + String resourceGroupName, + String policyName, + ProtectionPolicyResourceInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, policyName, parameters, context).block(); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String policyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + accept, + context); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String vaultName, String resourceGroupName, String policyName) { + Mono>> mono = deleteWithResponseAsync(vaultName, resourceGroupName, policyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String vaultName, String resourceGroupName, String policyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(vaultName, resourceGroupName, policyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String policyName) { + return beginDeleteAsync(vaultName, resourceGroupName, policyName).getSyncPoller(); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String vaultName, String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(vaultName, resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String vaultName, String resourceGroupName, String policyName) { + return beginDeleteAsync(vaultName, resourceGroupName, policyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String vaultName, String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(vaultName, resourceGroupName, policyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String vaultName, String resourceGroupName, String policyName) { + deleteAsync(vaultName, resourceGroupName, policyName).block(); + } + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String vaultName, String resourceGroupName, String policyName, Context context) { + deleteAsync(vaultName, resourceGroupName, policyName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java new file mode 100644 index 0000000000000..37d35e8d12292 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicies; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionPoliciesImpl implements ProtectionPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPoliciesImpl.class); + + private final ProtectionPoliciesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionPoliciesImpl(ProtectionPoliciesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName) { + ProtectionPolicyResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, policyName); + if (inner != null) { + return new ProtectionPolicyResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionPolicyResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String vaultName, String resourceGroupName, String policyName) { + this.serviceClient().delete(vaultName, resourceGroupName, policyName); + } + + public void delete(String vaultName, String resourceGroupName, String policyName, Context context) { + this.serviceClient().delete(vaultName, resourceGroupName, policyName, context); + } + + public ProtectionPolicyResource getById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 policyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + return this.getWithResponse(vaultName, resourceGroupName, policyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 policyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + return this.getWithResponse(vaultName, resourceGroupName, policyName, context); + } + + public void deleteById(String id) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 policyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + this.delete(vaultName, resourceGroupName, policyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", 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 policyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + this.delete(vaultName, resourceGroupName, policyName, context); + } + + private ProtectionPoliciesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public ProtectionPolicyResourceImpl define(String name) { + return new ProtectionPolicyResourceImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java new file mode 100644 index 0000000000000..d6a7e6cfa5dba --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.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.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationResultsClient. + */ +public final class ProtectionPolicyOperationResultsClientImpl implements ProtectionPolicyOperationResultsClient { + private final ClientLogger logger = new ClientLogger(ProtectionPolicyOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionPolicyOperationResultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPolicyOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionPolicyOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectionPolicyOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionPolicyOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionPolicyOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + operationId, + accept, + context); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectionPolicyResourceInner get( + String vaultName, String resourceGroupName, String policyName, String operationId) { + return getAsync(vaultName, resourceGroupName, policyName, operationId).block(); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java new file mode 100644 index 0000000000000..31b41c15d8093 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionPolicyOperationResultsImpl implements ProtectionPolicyOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPolicyOperationResultsImpl.class); + + private final ProtectionPolicyOperationResultsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionPolicyOperationResultsImpl( + ProtectionPolicyOperationResultsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ProtectionPolicyResource get( + String vaultName, String resourceGroupName, String policyName, String operationId) { + ProtectionPolicyResourceInner inner = + this.serviceClient().get(vaultName, resourceGroupName, policyName, operationId); + if (inner != null) { + return new ProtectionPolicyResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProtectionPolicyResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProtectionPolicyOperationResultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java new file mode 100644 index 0000000000000..1eb1ed039a2ec --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationStatusesClient. + */ +public final class ProtectionPolicyOperationStatusesClientImpl implements ProtectionPolicyOperationStatusesClient { + private final ClientLogger logger = new ClientLogger(ProtectionPolicyOperationStatusesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProtectionPolicyOperationStatusesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPolicyOperationStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectionPolicyOperationStatusesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + ProtectionPolicyOperationStatusesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientProtectionPolicyOperationStatuses to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ProtectionPolicyOperationStatusesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyName") String policyName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyName == null) { + return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + policyName, + operationId, + accept, + context); + } + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String vaultName, String resourceGroupName, String policyName, String operationId) { + return getAsync(vaultName, resourceGroupName, policyName, operationId).block(); + } + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java new file mode 100644 index 0000000000000..b2121aba17d95 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationStatuses; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProtectionPolicyOperationStatusesImpl implements ProtectionPolicyOperationStatuses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPolicyOperationStatusesImpl.class); + + private final ProtectionPolicyOperationStatusesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ProtectionPolicyOperationStatusesImpl( + ProtectionPolicyOperationStatusesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus get(String vaultName, String resourceGroupName, String policyName, String operationId) { + OperationStatusInner inner = this.serviceClient().get(vaultName, resourceGroupName, policyName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ProtectionPolicyOperationStatusesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java new file mode 100644 index 0000000000000..43e5cf368c159 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicy; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; +import java.util.Collections; +import java.util.Map; + +public final class ProtectionPolicyResourceImpl + implements ProtectionPolicyResource, ProtectionPolicyResource.Definition, ProtectionPolicyResource.Update { + private ProtectionPolicyResourceInner innerObject; + + private final RecoveryServicesBackupManager 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 ProtectionPolicy properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProtectionPolicyResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String vaultName; + + private String resourceGroupName; + + private String policyName; + + public ProtectionPolicyResourceImpl withExistingVault(String vaultName, String resourceGroupName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public ProtectionPolicyResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionPolicyResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionPolicyResourceImpl(String name, RecoveryServicesBackupManager serviceManager) { + this.innerObject = new ProtectionPolicyResourceInner(); + this.serviceManager = serviceManager; + this.policyName = name; + } + + public ProtectionPolicyResourceImpl update() { + return this; + } + + public ProtectionPolicyResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProtectionPolicyResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), context) + .getValue(); + return this; + } + + ProtectionPolicyResourceImpl( + ProtectionPolicyResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = Utils.getValueFromIdByName(innerObject.id(), "backupPolicies"); + } + + public ProtectionPolicyResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .getWithResponse(vaultName, resourceGroupName, policyName, Context.NONE) + .getValue(); + return this; + } + + public ProtectionPolicyResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProtectionPolicies() + .getWithResponse(vaultName, resourceGroupName, policyName, context) + .getValue(); + return this; + } + + public ProtectionPolicyResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProtectionPolicyResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProtectionPolicyResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProtectionPolicyResourceImpl withProperties(ProtectionPolicy properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProtectionPolicyResourceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java new file mode 100644 index 0000000000000..cef1fc87dd306 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoint; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import java.util.Collections; +import java.util.Map; + +public final class RecoveryPointResourceImpl implements RecoveryPointResource { + private RecoveryPointResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + RecoveryPointResourceImpl(RecoveryPointResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RecoveryPoint properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public RecoveryPointResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java new file mode 100644 index 0000000000000..14a6e72121bec --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java @@ -0,0 +1,1015 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */ +public final class RecoveryPointsClientImpl implements RecoveryPointsClient { + private final ClientLogger logger = new ClientLogger(RecoveryPointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RecoveryPointsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(RecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientRecoveryPoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface RecoveryPointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken") + @ExpectedResponses({200, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAccessToken( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @BodyParam("application/json") AadPropertiesResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + 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 backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + return new PagedFlux<>( + () -> + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedFlux<>( + () -> + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context)); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + accept, + context); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPointResourceInner get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + return getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId) + .block(); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + return getWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, context) + .block(); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessTokenWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAccessToken( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessTokenWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAccessToken( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAccessTokenAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters) { + return getAccessTokenWithResponseAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CrrAccessTokenResourceInner getAccessToken( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters) { + return getAccessTokenAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .block(); + } + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessTokenWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters, + Context context) { + return getAccessTokenWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint 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 list of RecoveryPoint 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java new file mode 100644 index 0000000000000..a482af07a4240 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsClientImpl.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecoveryPointsCrrsClient. */ +public final class RecoveryPointsCrrsClientImpl implements RecoveryPointsCrrsClient { + private final ClientLogger logger = new ClientLogger(RecoveryPointsCrrsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RecoveryPointsCrrsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RecoveryPointsCrrsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsCrrsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(RecoveryPointsCrrsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientRecoveryPointsCrrs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface RecoveryPointsCrrsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @QueryParam("$filter") String filter, + @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 backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + 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 backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + final String apiVersion = "2018-12-20"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter) { + return new PagedFlux<>( + () -> + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedFlux<>( + () -> + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter)); + } + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint 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 list of RecoveryPoint 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java new file mode 100644 index 0000000000000..8ad173c737f88 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsCrrsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsCrrs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecoveryPointsCrrsImpl implements RecoveryPointsCrrs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointsCrrsImpl.class); + + private final RecoveryPointsCrrsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public RecoveryPointsCrrsImpl(RecoveryPointsCrrsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + private RecoveryPointsCrrsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java new file mode 100644 index 0000000000000..188c5b0801d05 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrrAccessTokenResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecoveryPointsImpl implements RecoveryPoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointsImpl.class); + + private final RecoveryPointsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public RecoveryPointsImpl(RecoveryPointsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + PagedIterable inner = + this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public RecoveryPointResource get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId) { + RecoveryPointResourceInner inner = + this + .serviceClient() + .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId); + if (inner != null) { + return new RecoveryPointResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoveryPointResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CrrAccessTokenResource getAccessToken( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters) { + CrrAccessTokenResourceInner inner = + this + .serviceClient() + .getAccessToken( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + if (inner != null) { + return new CrrAccessTokenResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAccessTokenWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .getAccessTokenWithResponse( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CrrAccessTokenResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private RecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java new file mode 100644 index 0000000000000..aa800da03ce79 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RecoveryPointsRecommendedForMovesClient. + */ +public final class RecoveryPointsRecommendedForMovesClientImpl implements RecoveryPointsRecommendedForMovesClient { + private final ClientLogger logger = new ClientLogger(RecoveryPointsRecommendedForMovesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RecoveryPointsRecommendedForMovesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RecoveryPointsRecommendedForMovesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryPointsRecommendedForMovesClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy + .create( + RecoveryPointsRecommendedForMovesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientRecoveryPointsRecommendedForMoves to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface RecoveryPointsRecommendedForMovesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPointsRecommendedForMove") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @BodyParam("application/json") ListRecoveryPointsRecommendedForMoveRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + 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 recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + parameters, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters) { + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters)); + } + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context) { + return new PagedIterable<>( + listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint 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 list of RecoveryPoint 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java new file mode 100644 index 0000000000000..bad353df08702 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsRecommendedForMoves; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecoveryPointsRecommendedForMovesImpl implements RecoveryPointsRecommendedForMoves { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointsRecommendedForMovesImpl.class); + + private final RecoveryPointsRecommendedForMovesClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public RecoveryPointsRecommendedForMovesImpl( + RecoveryPointsRecommendedForMovesClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters) { + PagedIterable inner = + this + .serviceClient() + .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context); + return inner.mapPage(inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + private RecoveryPointsRecommendedForMovesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientBuilder.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientBuilder.java new file mode 100644 index 0000000000000..40b049d10c981 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientBuilder.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.recoveryservicesbackup.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 RecoveryServicesBackupClientImpl type. */ +@ServiceClientBuilder(serviceClients = {RecoveryServicesBackupClientImpl.class}) +public final class RecoveryServicesBackupClientBuilder { + /* + * The subscription Id. + */ + private String subscriptionId; + + /** + * Sets The subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder 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 RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder 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 RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder 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 RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder 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 RecoveryServicesBackupClientBuilder. + */ + public RecoveryServicesBackupClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of RecoveryServicesBackupClientImpl with the provided parameters. + * + * @return an instance of RecoveryServicesBackupClientImpl. + */ + public RecoveryServicesBackupClientImpl 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(); + } + RecoveryServicesBackupClientImpl client = + new RecoveryServicesBackupClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java new file mode 100644 index 0000000000000..bf524e8bc5379 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupClientImpl.java @@ -0,0 +1,995 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.fluent.AadPropertiesOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupCrrJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossRegionRestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrrOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionIntentsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPoliciesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsCrrsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryServicesBackupClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; +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 RecoveryServicesBackupClientImpl type. */ +@ServiceClient(builder = RecoveryServicesBackupClientBuilder.class) +public final class RecoveryServicesBackupClientImpl implements RecoveryServicesBackupClient { + private final ClientLogger logger = new ClientLogger(RecoveryServicesBackupClientImpl.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; + } + + /** 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 BackupResourceVaultConfigsClient object to access its operations. */ + private final BackupResourceVaultConfigsClient backupResourceVaultConfigs; + + /** + * Gets the BackupResourceVaultConfigsClient object to access its operations. + * + * @return the BackupResourceVaultConfigsClient object. + */ + public BackupResourceVaultConfigsClient getBackupResourceVaultConfigs() { + return this.backupResourceVaultConfigs; + } + + /** The BackupResourceEncryptionConfigsClient object to access its operations. */ + private final BackupResourceEncryptionConfigsClient backupResourceEncryptionConfigs; + + /** + * Gets the BackupResourceEncryptionConfigsClient object to access its operations. + * + * @return the BackupResourceEncryptionConfigsClient object. + */ + public BackupResourceEncryptionConfigsClient getBackupResourceEncryptionConfigs() { + return this.backupResourceEncryptionConfigs; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateEndpointsClient object to access its operations. */ + private final PrivateEndpointsClient privateEndpoints; + + /** + * Gets the PrivateEndpointsClient object to access its operations. + * + * @return the PrivateEndpointsClient object. + */ + public PrivateEndpointsClient getPrivateEndpoints() { + return this.privateEndpoints; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The BmsPrepareDataMoveOperationResultsClient object to access its operations. */ + private final BmsPrepareDataMoveOperationResultsClient bmsPrepareDataMoveOperationResults; + + /** + * Gets the BmsPrepareDataMoveOperationResultsClient object to access its operations. + * + * @return the BmsPrepareDataMoveOperationResultsClient object. + */ + public BmsPrepareDataMoveOperationResultsClient getBmsPrepareDataMoveOperationResults() { + return this.bmsPrepareDataMoveOperationResults; + } + + /** The ProtectedItemsClient object to access its operations. */ + private final ProtectedItemsClient protectedItems; + + /** + * Gets the ProtectedItemsClient object to access its operations. + * + * @return the ProtectedItemsClient object. + */ + public ProtectedItemsClient getProtectedItems() { + return this.protectedItems; + } + + /** The ProtectedItemOperationResultsClient object to access its operations. */ + private final ProtectedItemOperationResultsClient protectedItemOperationResults; + + /** + * Gets the ProtectedItemOperationResultsClient object to access its operations. + * + * @return the ProtectedItemOperationResultsClient object. + */ + public ProtectedItemOperationResultsClient getProtectedItemOperationResults() { + return this.protectedItemOperationResults; + } + + /** The RecoveryPointsClient object to access its operations. */ + private final RecoveryPointsClient recoveryPoints; + + /** + * Gets the RecoveryPointsClient object to access its operations. + * + * @return the RecoveryPointsClient object. + */ + public RecoveryPointsClient getRecoveryPoints() { + return this.recoveryPoints; + } + + /** The RestoresClient object to access its operations. */ + private final RestoresClient restores; + + /** + * Gets the RestoresClient object to access its operations. + * + * @return the RestoresClient object. + */ + public RestoresClient getRestores() { + return this.restores; + } + + /** The BackupPoliciesClient object to access its operations. */ + private final BackupPoliciesClient backupPolicies; + + /** + * Gets the BackupPoliciesClient object to access its operations. + * + * @return the BackupPoliciesClient object. + */ + public BackupPoliciesClient getBackupPolicies() { + return this.backupPolicies; + } + + /** The ProtectionPoliciesClient object to access its operations. */ + private final ProtectionPoliciesClient protectionPolicies; + + /** + * Gets the ProtectionPoliciesClient object to access its operations. + * + * @return the ProtectionPoliciesClient object. + */ + public ProtectionPoliciesClient getProtectionPolicies() { + return this.protectionPolicies; + } + + /** The ProtectionPolicyOperationResultsClient object to access its operations. */ + private final ProtectionPolicyOperationResultsClient protectionPolicyOperationResults; + + /** + * Gets the ProtectionPolicyOperationResultsClient object to access its operations. + * + * @return the ProtectionPolicyOperationResultsClient object. + */ + public ProtectionPolicyOperationResultsClient getProtectionPolicyOperationResults() { + return this.protectionPolicyOperationResults; + } + + /** The BackupJobsClient object to access its operations. */ + private final BackupJobsClient backupJobs; + + /** + * Gets the BackupJobsClient object to access its operations. + * + * @return the BackupJobsClient object. + */ + public BackupJobsClient getBackupJobs() { + return this.backupJobs; + } + + /** The JobDetailsClient object to access its operations. */ + private final JobDetailsClient jobDetails; + + /** + * Gets the JobDetailsClient object to access its operations. + * + * @return the JobDetailsClient object. + */ + public JobDetailsClient getJobDetails() { + return this.jobDetails; + } + + /** The JobCancellationsClient object to access its operations. */ + private final JobCancellationsClient jobCancellations; + + /** + * Gets the JobCancellationsClient object to access its operations. + * + * @return the JobCancellationsClient object. + */ + public JobCancellationsClient getJobCancellations() { + return this.jobCancellations; + } + + /** The JobOperationResultsClient object to access its operations. */ + private final JobOperationResultsClient jobOperationResults; + + /** + * Gets the JobOperationResultsClient object to access its operations. + * + * @return the JobOperationResultsClient object. + */ + public JobOperationResultsClient getJobOperationResults() { + return this.jobOperationResults; + } + + /** The ExportJobsOperationResultsClient object to access its operations. */ + private final ExportJobsOperationResultsClient exportJobsOperationResults; + + /** + * Gets the ExportJobsOperationResultsClient object to access its operations. + * + * @return the ExportJobsOperationResultsClient object. + */ + public ExportJobsOperationResultsClient getExportJobsOperationResults() { + return this.exportJobsOperationResults; + } + + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The BackupProtectedItemsClient object to access its operations. */ + private final BackupProtectedItemsClient backupProtectedItems; + + /** + * Gets the BackupProtectedItemsClient object to access its operations. + * + * @return the BackupProtectedItemsClient object. + */ + public BackupProtectedItemsClient getBackupProtectedItems() { + return this.backupProtectedItems; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The BackupEnginesClient object to access its operations. */ + private final BackupEnginesClient backupEngines; + + /** + * Gets the BackupEnginesClient object to access its operations. + * + * @return the BackupEnginesClient object. + */ + public BackupEnginesClient getBackupEngines() { + return this.backupEngines; + } + + /** The ProtectionContainerRefreshOperationResultsClient object to access its operations. */ + private final ProtectionContainerRefreshOperationResultsClient protectionContainerRefreshOperationResults; + + /** + * Gets the ProtectionContainerRefreshOperationResultsClient object to access its operations. + * + * @return the ProtectionContainerRefreshOperationResultsClient object. + */ + public ProtectionContainerRefreshOperationResultsClient getProtectionContainerRefreshOperationResults() { + return this.protectionContainerRefreshOperationResults; + } + + /** The ProtectableContainersClient object to access its operations. */ + private final ProtectableContainersClient protectableContainers; + + /** + * Gets the ProtectableContainersClient object to access its operations. + * + * @return the ProtectableContainersClient object. + */ + public ProtectableContainersClient getProtectableContainers() { + return this.protectableContainers; + } + + /** The ProtectionContainersClient object to access its operations. */ + private final ProtectionContainersClient protectionContainers; + + /** + * Gets the ProtectionContainersClient object to access its operations. + * + * @return the ProtectionContainersClient object. + */ + public ProtectionContainersClient getProtectionContainers() { + return this.protectionContainers; + } + + /** The BackupWorkloadItemsClient object to access its operations. */ + private final BackupWorkloadItemsClient backupWorkloadItems; + + /** + * Gets the BackupWorkloadItemsClient object to access its operations. + * + * @return the BackupWorkloadItemsClient object. + */ + public BackupWorkloadItemsClient getBackupWorkloadItems() { + return this.backupWorkloadItems; + } + + /** The ProtectionContainerOperationResultsClient object to access its operations. */ + private final ProtectionContainerOperationResultsClient protectionContainerOperationResults; + + /** + * Gets the ProtectionContainerOperationResultsClient object to access its operations. + * + * @return the ProtectionContainerOperationResultsClient object. + */ + public ProtectionContainerOperationResultsClient getProtectionContainerOperationResults() { + return this.protectionContainerOperationResults; + } + + /** The BackupsClient object to access its operations. */ + private final BackupsClient backups; + + /** + * Gets the BackupsClient object to access its operations. + * + * @return the BackupsClient object. + */ + public BackupsClient getBackups() { + return this.backups; + } + + /** The ProtectedItemOperationStatusesClient object to access its operations. */ + private final ProtectedItemOperationStatusesClient protectedItemOperationStatuses; + + /** + * Gets the ProtectedItemOperationStatusesClient object to access its operations. + * + * @return the ProtectedItemOperationStatusesClient object. + */ + public ProtectedItemOperationStatusesClient getProtectedItemOperationStatuses() { + return this.protectedItemOperationStatuses; + } + + /** The ItemLevelRecoveryConnectionsClient object to access its operations. */ + private final ItemLevelRecoveryConnectionsClient itemLevelRecoveryConnections; + + /** + * Gets the ItemLevelRecoveryConnectionsClient object to access its operations. + * + * @return the ItemLevelRecoveryConnectionsClient object. + */ + public ItemLevelRecoveryConnectionsClient getItemLevelRecoveryConnections() { + return this.itemLevelRecoveryConnections; + } + + /** The BackupOperationResultsClient object to access its operations. */ + private final BackupOperationResultsClient backupOperationResults; + + /** + * Gets the BackupOperationResultsClient object to access its operations. + * + * @return the BackupOperationResultsClient object. + */ + public BackupOperationResultsClient getBackupOperationResults() { + return this.backupOperationResults; + } + + /** The BackupOperationStatusesClient object to access its operations. */ + private final BackupOperationStatusesClient backupOperationStatuses; + + /** + * Gets the BackupOperationStatusesClient object to access its operations. + * + * @return the BackupOperationStatusesClient object. + */ + public BackupOperationStatusesClient getBackupOperationStatuses() { + return this.backupOperationStatuses; + } + + /** The ProtectionPolicyOperationStatusesClient object to access its operations. */ + private final ProtectionPolicyOperationStatusesClient protectionPolicyOperationStatuses; + + /** + * Gets the ProtectionPolicyOperationStatusesClient object to access its operations. + * + * @return the ProtectionPolicyOperationStatusesClient object. + */ + public ProtectionPolicyOperationStatusesClient getProtectionPolicyOperationStatuses() { + return this.protectionPolicyOperationStatuses; + } + + /** The BackupProtectableItemsClient object to access its operations. */ + private final BackupProtectableItemsClient backupProtectableItems; + + /** + * Gets the BackupProtectableItemsClient object to access its operations. + * + * @return the BackupProtectableItemsClient object. + */ + public BackupProtectableItemsClient getBackupProtectableItems() { + return this.backupProtectableItems; + } + + /** The BackupProtectionContainersClient object to access its operations. */ + private final BackupProtectionContainersClient backupProtectionContainers; + + /** + * Gets the BackupProtectionContainersClient object to access its operations. + * + * @return the BackupProtectionContainersClient object. + */ + public BackupProtectionContainersClient getBackupProtectionContainers() { + return this.backupProtectionContainers; + } + + /** The SecurityPINsClient object to access its operations. */ + private final SecurityPINsClient securityPINs; + + /** + * Gets the SecurityPINsClient object to access its operations. + * + * @return the SecurityPINsClient object. + */ + public SecurityPINsClient getSecurityPINs() { + return this.securityPINs; + } + + /** The RecoveryPointsRecommendedForMovesClient object to access its operations. */ + private final RecoveryPointsRecommendedForMovesClient recoveryPointsRecommendedForMoves; + + /** + * Gets the RecoveryPointsRecommendedForMovesClient object to access its operations. + * + * @return the RecoveryPointsRecommendedForMovesClient object. + */ + public RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMoves() { + return this.recoveryPointsRecommendedForMoves; + } + + /** The AadPropertiesOperationsClient object to access its operations. */ + private final AadPropertiesOperationsClient aadPropertiesOperations; + + /** + * Gets the AadPropertiesOperationsClient object to access its operations. + * + * @return the AadPropertiesOperationsClient object. + */ + public AadPropertiesOperationsClient getAadPropertiesOperations() { + return this.aadPropertiesOperations; + } + + /** The CrossRegionRestoresClient object to access its operations. */ + private final CrossRegionRestoresClient crossRegionRestores; + + /** + * Gets the CrossRegionRestoresClient object to access its operations. + * + * @return the CrossRegionRestoresClient object. + */ + public CrossRegionRestoresClient getCrossRegionRestores() { + return this.crossRegionRestores; + } + + /** The BackupCrrJobDetailsClient object to access its operations. */ + private final BackupCrrJobDetailsClient backupCrrJobDetails; + + /** + * Gets the BackupCrrJobDetailsClient object to access its operations. + * + * @return the BackupCrrJobDetailsClient object. + */ + public BackupCrrJobDetailsClient getBackupCrrJobDetails() { + return this.backupCrrJobDetails; + } + + /** The BackupCrrJobsClient object to access its operations. */ + private final BackupCrrJobsClient backupCrrJobs; + + /** + * Gets the BackupCrrJobsClient object to access its operations. + * + * @return the BackupCrrJobsClient object. + */ + public BackupCrrJobsClient getBackupCrrJobs() { + return this.backupCrrJobs; + } + + /** The CrrOperationResultsClient object to access its operations. */ + private final CrrOperationResultsClient crrOperationResults; + + /** + * Gets the CrrOperationResultsClient object to access its operations. + * + * @return the CrrOperationResultsClient object. + */ + public CrrOperationResultsClient getCrrOperationResults() { + return this.crrOperationResults; + } + + /** The CrrOperationStatusClient object to access its operations. */ + private final CrrOperationStatusClient crrOperationStatus; + + /** + * Gets the CrrOperationStatusClient object to access its operations. + * + * @return the CrrOperationStatusClient object. + */ + public CrrOperationStatusClient getCrrOperationStatus() { + return this.crrOperationStatus; + } + + /** The BackupResourceStorageConfigsClient object to access its operations. */ + private final BackupResourceStorageConfigsClient backupResourceStorageConfigs; + + /** + * Gets the BackupResourceStorageConfigsClient object to access its operations. + * + * @return the BackupResourceStorageConfigsClient object. + */ + public BackupResourceStorageConfigsClient getBackupResourceStorageConfigs() { + return this.backupResourceStorageConfigs; + } + + /** The RecoveryPointsCrrsClient object to access its operations. */ + private final RecoveryPointsCrrsClient recoveryPointsCrrs; + + /** + * Gets the RecoveryPointsCrrsClient object to access its operations. + * + * @return the RecoveryPointsCrrsClient object. + */ + public RecoveryPointsCrrsClient getRecoveryPointsCrrs() { + return this.recoveryPointsCrrs; + } + + /** The BackupProtectedItemsCrrsClient object to access its operations. */ + private final BackupProtectedItemsCrrsClient backupProtectedItemsCrrs; + + /** + * Gets the BackupProtectedItemsCrrsClient object to access its operations. + * + * @return the BackupProtectedItemsCrrsClient object. + */ + public BackupProtectedItemsCrrsClient getBackupProtectedItemsCrrs() { + return this.backupProtectedItemsCrrs; + } + + /** The ProtectionIntentsClient object to access its operations. */ + private final ProtectionIntentsClient protectionIntents; + + /** + * Gets the ProtectionIntentsClient object to access its operations. + * + * @return the ProtectionIntentsClient object. + */ + public ProtectionIntentsClient getProtectionIntents() { + return this.protectionIntents; + } + + /** The BackupStatusClient object to access its operations. */ + private final BackupStatusClient backupStatus; + + /** + * Gets the BackupStatusClient object to access its operations. + * + * @return the BackupStatusClient object. + */ + public BackupStatusClient getBackupStatus() { + return this.backupStatus; + } + + /** The FeatureSupportsClient object to access its operations. */ + private final FeatureSupportsClient featureSupports; + + /** + * Gets the FeatureSupportsClient object to access its operations. + * + * @return the FeatureSupportsClient object. + */ + public FeatureSupportsClient getFeatureSupports() { + return this.featureSupports; + } + + /** The BackupProtectionIntentsClient object to access its operations. */ + private final BackupProtectionIntentsClient backupProtectionIntents; + + /** + * Gets the BackupProtectionIntentsClient object to access its operations. + * + * @return the BackupProtectionIntentsClient object. + */ + public BackupProtectionIntentsClient getBackupProtectionIntents() { + return this.backupProtectionIntents; + } + + /** The BackupUsageSummariesClient object to access its operations. */ + private final BackupUsageSummariesClient backupUsageSummaries; + + /** + * Gets the BackupUsageSummariesClient object to access its operations. + * + * @return the BackupUsageSummariesClient object. + */ + public BackupUsageSummariesClient getBackupUsageSummaries() { + return this.backupUsageSummaries; + } + + /** The OperationsOperationsClient object to access its operations. */ + private final OperationsOperationsClient operationsOperations; + + /** + * Gets the OperationsOperationsClient object to access its operations. + * + * @return the OperationsOperationsClient object. + */ + public OperationsOperationsClient getOperationsOperations() { + return this.operationsOperations; + } + + /** + * Initializes an instance of RecoveryServicesBackupClient 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. + */ + RecoveryServicesBackupClientImpl( + 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.backupResourceVaultConfigs = new BackupResourceVaultConfigsClientImpl(this); + this.backupResourceEncryptionConfigs = new BackupResourceEncryptionConfigsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateEndpoints = new PrivateEndpointsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.bmsPrepareDataMoveOperationResults = new BmsPrepareDataMoveOperationResultsClientImpl(this); + this.protectedItems = new ProtectedItemsClientImpl(this); + this.protectedItemOperationResults = new ProtectedItemOperationResultsClientImpl(this); + this.recoveryPoints = new RecoveryPointsClientImpl(this); + this.restores = new RestoresClientImpl(this); + this.backupPolicies = new BackupPoliciesClientImpl(this); + this.protectionPolicies = new ProtectionPoliciesClientImpl(this); + this.protectionPolicyOperationResults = new ProtectionPolicyOperationResultsClientImpl(this); + this.backupJobs = new BackupJobsClientImpl(this); + this.jobDetails = new JobDetailsClientImpl(this); + this.jobCancellations = new JobCancellationsClientImpl(this); + this.jobOperationResults = new JobOperationResultsClientImpl(this); + this.exportJobsOperationResults = new ExportJobsOperationResultsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.backupProtectedItems = new BackupProtectedItemsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.backupEngines = new BackupEnginesClientImpl(this); + this.protectionContainerRefreshOperationResults = + new ProtectionContainerRefreshOperationResultsClientImpl(this); + this.protectableContainers = new ProtectableContainersClientImpl(this); + this.protectionContainers = new ProtectionContainersClientImpl(this); + this.backupWorkloadItems = new BackupWorkloadItemsClientImpl(this); + this.protectionContainerOperationResults = new ProtectionContainerOperationResultsClientImpl(this); + this.backups = new BackupsClientImpl(this); + this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesClientImpl(this); + this.itemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsClientImpl(this); + this.backupOperationResults = new BackupOperationResultsClientImpl(this); + this.backupOperationStatuses = new BackupOperationStatusesClientImpl(this); + this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesClientImpl(this); + this.backupProtectableItems = new BackupProtectableItemsClientImpl(this); + this.backupProtectionContainers = new BackupProtectionContainersClientImpl(this); + this.securityPINs = new SecurityPINsClientImpl(this); + this.recoveryPointsRecommendedForMoves = new RecoveryPointsRecommendedForMovesClientImpl(this); + this.aadPropertiesOperations = new AadPropertiesOperationsClientImpl(this); + this.crossRegionRestores = new CrossRegionRestoresClientImpl(this); + this.backupCrrJobDetails = new BackupCrrJobDetailsClientImpl(this); + this.backupCrrJobs = new BackupCrrJobsClientImpl(this); + this.crrOperationResults = new CrrOperationResultsClientImpl(this); + this.crrOperationStatus = new CrrOperationStatusClientImpl(this); + this.backupResourceStorageConfigs = new BackupResourceStorageConfigsClientImpl(this); + this.recoveryPointsCrrs = new RecoveryPointsCrrsClientImpl(this); + this.backupProtectedItemsCrrs = new BackupProtectedItemsCrrsClientImpl(this); + this.protectionIntents = new ProtectionIntentsClientImpl(this); + this.backupStatus = new BackupStatusClientImpl(this); + this.featureSupports = new FeatureSupportsClientImpl(this); + this.backupProtectionIntents = new BackupProtectionIntentsClientImpl(this); + this.backupUsageSummaries = new BackupUsageSummariesClientImpl(this); + this.operationsOperations = new OperationsOperationsClientImpl(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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..14378ac4f9512 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.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.recoveryservicesbackup.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; +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 ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientResourceProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOperationStatus( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> bmsPrepareDataMove( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrepareDataMoveRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> bmsTriggerDataMove( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TriggerDataMoveRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/move") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> moveRecoveryPoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @BodyParam("application/json") MoveRPAcrossTiersRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String vaultName, String resourceGroupName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOperationStatus( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOperationStatusWithResponseAsync( + String vaultName, String resourceGroupName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOperationStatus( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + operationId, + accept, + context); + } + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOperationStatusAsync( + String vaultName, String resourceGroupName, String operationId) { + return getOperationStatusWithResponseAsync(vaultName, resourceGroupName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, String operationId) { + return getOperationStatusAsync(vaultName, resourceGroupName, operationId).block(); + } + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + return getOperationStatusWithResponseAsync(vaultName, resourceGroupName, operationId, context).block(); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bmsPrepareDataMoveWithResponseAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .bmsPrepareDataMove( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bmsPrepareDataMoveWithResponseAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .bmsPrepareDataMove( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBmsPrepareDataMoveAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + Mono>> mono = + bmsPrepareDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBmsPrepareDataMoveAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + bmsPrepareDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bmsPrepareDataMoveAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bmsPrepareDataMoveAsync( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + bmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void bmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + bmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters, context).block(); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bmsTriggerDataMoveWithResponseAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .bmsTriggerDataMove( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> bmsTriggerDataMoveWithResponseAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .bmsTriggerDataMove( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBmsTriggerDataMoveAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + Mono>> mono = + bmsTriggerDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBmsTriggerDataMoveAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + bmsTriggerDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).getSyncPoller(); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bmsTriggerDataMoveAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono bmsTriggerDataMoveAsync( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + bmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).block(); + } + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void bmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + bmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters, context).block(); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> moveRecoveryPointWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .moveRecoveryPoint( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> moveRecoveryPointWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .moveRecoveryPoint( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginMoveRecoveryPointAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + Mono>> mono = + moveRecoveryPointWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginMoveRecoveryPointAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + moveRecoveryPointWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginMoveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + return beginMoveRecoveryPointAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .getSyncPoller(); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginMoveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + return beginMoveRecoveryPointAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .getSyncPoller(); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono moveRecoveryPointAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + return beginMoveRecoveryPointAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono moveRecoveryPointAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + return beginMoveRecoveryPointAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + moveRecoveryPointAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .block(); + } + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + moveRecoveryPointAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..d21b6d8e0aad4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; +import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceProvidersImpl implements ResourceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public ResourceProvidersImpl(ResourceProvidersClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus getOperationStatus(String vaultName, String resourceGroupName, String operationId) { + OperationStatusInner inner = this.serviceClient().getOperationStatus(vaultName, resourceGroupName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOperationStatusWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context) { + Response inner = + this.serviceClient().getOperationStatusWithResponse(vaultName, resourceGroupName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { + this.serviceClient().bmsPrepareDataMove(vaultName, resourceGroupName, parameters); + } + + public void bmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context) { + this.serviceClient().bmsPrepareDataMove(vaultName, resourceGroupName, parameters, context); + } + + public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { + this.serviceClient().bmsTriggerDataMove(vaultName, resourceGroupName, parameters); + } + + public void bmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context) { + this.serviceClient().bmsTriggerDataMove(vaultName, resourceGroupName, parameters, context); + } + + public void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters) { + this + .serviceClient() + .moveRecoveryPoint( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + } + + public void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context) { + this + .serviceClient() + .moveRecoveryPoint( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java new file mode 100644 index 0000000000000..c9840518f4dff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.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.recoveryservicesbackup.fluent.RestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; +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 RestoresClient. */ +public final class RestoresClientImpl implements RestoresClient { + private final ClientLogger logger = new ClientLogger(RestoresClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RestoresService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RestoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestoresClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = RestProxy.create(RestoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientRestores to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface RestoresService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems" + + "/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> trigger( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fabricName") String fabricName, + @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, + @BodyParam("application/json") RestoreRequestResource parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fabricName == null) { + return Mono.error(new IllegalArgumentException("Parameter fabricName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (protectedItemName == null) { + return Mono + .error(new IllegalArgumentException("Parameter protectedItemName is required and cannot be null.")); + } + if (recoveryPointId == null) { + return Mono + .error(new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .trigger( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + accept, + context); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + Mono>> mono = + triggerWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + triggerWithResponseAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTrigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + return beginTriggerAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .getSyncPoller(); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTrigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + return beginTriggerAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .getSyncPoller(); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + return beginTriggerAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + return beginTriggerAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + triggerAsync( + vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters) + .block(); + } + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + triggerAsync( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context) + .block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java new file mode 100644 index 0000000000000..91c1465376bad --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.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.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RestoresImpl implements Restores { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoresImpl.class); + + private final RestoresClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public RestoresImpl(RestoresClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters) { + this + .serviceClient() + .trigger( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters); + } + + public void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context) { + this + .serviceClient() + .trigger( + vaultName, + resourceGroupName, + fabricName, + containerName, + protectedItemName, + recoveryPointId, + parameters, + context); + } + + private RestoresClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java new file mode 100644 index 0000000000000..0a75901d7ff27 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.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.recoveryservicesbackup.fluent.SecurityPINsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecurityPINsClient. */ +public final class SecurityPINsClientImpl implements SecurityPINsClient { + private final ClientLogger logger = new ClientLogger(SecurityPINsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityPINsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of SecurityPINsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityPINsClientImpl(RecoveryServicesBackupClientImpl client) { + this.service = + RestProxy.create(SecurityPINsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupClientSecurityPINs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesBack") + private interface SecurityPINsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/backupSecurityPIN") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String vaultName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String vaultName, 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 (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + vaultName, + resourceGroupName, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String vaultName, String resourceGroupName) { + return getWithResponseAsync(vaultName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInformationInner get(String vaultName, String resourceGroupName) { + return getAsync(vaultName, resourceGroupName).block(); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String vaultName, String resourceGroupName, Context context) { + return getWithResponseAsync(vaultName, resourceGroupName, context).block(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java new file mode 100644 index 0000000000000..8d30bc13f0a04 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; +import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityPINsImpl implements SecurityPINs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPINsImpl.class); + + private final SecurityPINsClient innerClient; + + private final RecoveryServicesBackupManager serviceManager; + + public SecurityPINsImpl(SecurityPINsClient innerClient, RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public TokenInformation get(String vaultName, String resourceGroupName) { + TokenInformationInner inner = this.serviceClient().get(vaultName, resourceGroupName); + if (inner != null) { + return new TokenInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String vaultName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TokenInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SecurityPINsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java new file mode 100644 index 0000000000000..085a826d44805 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.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.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation; + +public final class TokenInformationImpl implements TokenInformation { + private TokenInformationInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + TokenInformationImpl(TokenInformationInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String token() { + return this.innerModel().token(); + } + + public Long expiryTimeInUtcTicks() { + return this.innerModel().expiryTimeInUtcTicks(); + } + + public String securityPin() { + return this.innerModel().securityPin(); + } + + public TokenInformationInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/Utils.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/Utils.java new file mode 100644 index 0000000000000..990b38a36e38b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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.recoveryservicesbackup.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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java new file mode 100644 index 0000000000000..7c0a4ac4d4fc4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.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.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; + +public final class ValidateOperationsResponseImpl implements ValidateOperationsResponse { + private ValidateOperationsResponseInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + ValidateOperationsResponseImpl( + ValidateOperationsResponseInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ValidateOperationResponse validateOperationResponse() { + return this.innerModel().validateOperationResponse(); + } + + public ValidateOperationsResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java new file mode 100644 index 0000000000000..cb56a324449d1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse; + +public final class VaultStorageConfigOperationResultResponseImpl implements VaultStorageConfigOperationResultResponse { + private VaultStorageConfigOperationResultResponseInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + VaultStorageConfigOperationResultResponseImpl( + VaultStorageConfigOperationResultResponseInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VaultStorageConfigOperationResultResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java new file mode 100644 index 0000000000000..db6736c56acea --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItem; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItemResource; +import java.util.Collections; +import java.util.Map; + +public final class WorkloadItemResourceImpl implements WorkloadItemResource { + private WorkloadItemResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + WorkloadItemResourceImpl(WorkloadItemResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WorkloadItem properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public WorkloadItemResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java new file mode 100644 index 0000000000000..a2f2ce4e856f7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItem; +import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItemResource; +import java.util.Collections; +import java.util.Map; + +public final class WorkloadProtectableItemResourceImpl implements WorkloadProtectableItemResource { + private WorkloadProtectableItemResourceInner innerObject; + + private final RecoveryServicesBackupManager serviceManager; + + WorkloadProtectableItemResourceImpl( + WorkloadProtectableItemResourceInner innerObject, RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WorkloadProtectableItem properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public WorkloadProtectableItemResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java new file mode 100644 index 0000000000000..3ce5bb6113840 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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 RecoveryServicesBackupClient. Open API 2.0 Specs for Azure + * RecoveryServices Backup service. + */ +package com.azure.resourcemanager.recoveryservicesbackup.implementation; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.java new file mode 100644 index 0000000000000..3ab3cbc42d0f5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadProperties.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.recoveryservicesbackup.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 AadProperties model. */ +@Fluent +public final class AadProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadProperties.class); + + /* + * The servicePrincipalClientId property. + */ + @JsonProperty(value = "servicePrincipalClientId") + private String servicePrincipalClientId; + + /* + * The tenantId property. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The authority property. + */ + @JsonProperty(value = "authority") + private String authority; + + /* + * The audience property. + */ + @JsonProperty(value = "audience") + private String audience; + + /* + * The servicePrincipalObjectId property. + */ + @JsonProperty(value = "servicePrincipalObjectId") + private String servicePrincipalObjectId; + + /** + * Get the servicePrincipalClientId property: The servicePrincipalClientId property. + * + * @return the servicePrincipalClientId value. + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set the servicePrincipalClientId property: The servicePrincipalClientId property. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set. + * @return the AadProperties object itself. + */ + public AadProperties withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the AadProperties object itself. + */ + public AadProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the authority property: The authority property. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: The authority property. + * + * @param authority the authority value to set. + * @return the AadProperties object itself. + */ + public AadProperties withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the audience property: The audience property. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: The audience property. + * + * @param audience the audience value to set. + * @return the AadProperties object itself. + */ + public AadProperties withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the servicePrincipalObjectId property: The servicePrincipalObjectId property. + * + * @return the servicePrincipalObjectId value. + */ + public String servicePrincipalObjectId() { + return this.servicePrincipalObjectId; + } + + /** + * Set the servicePrincipalObjectId property: The servicePrincipalObjectId property. + * + * @param servicePrincipalObjectId the servicePrincipalObjectId value to set. + * @return the AadProperties object itself. + */ + public AadProperties withServicePrincipalObjectId(String servicePrincipalObjectId) { + this.servicePrincipalObjectId = servicePrincipalObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.java new file mode 100644 index 0000000000000..dde5763bee8ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesOperations.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AadPropertiesOperations. */ +public interface AadPropertiesOperations { + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + AadPropertiesResource get(String azureRegion); + + /** + * Fetches the AAD properties from target region BCM stamp. + * + * @param azureRegion Azure region to hit Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse(String azureRegion, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.java new file mode 100644 index 0000000000000..ab7a7ba8c14c0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AadPropertiesResource.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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; +import java.util.Map; + +/** An immutable client-side representation of AadPropertiesResource. */ +public interface AadPropertiesResource { + /** + * 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 properties property: AADPropertiesResource properties. + * + * @return the properties value. + */ + AadProperties properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner object. + * + * @return the inner object. + */ + AadPropertiesResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java new file mode 100644 index 0000000000000..8ab1e44e29197 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure backup goal feature specific request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "featureType") +@JsonTypeName("AzureBackupGoals") +@Immutable +public final class AzureBackupGoalFeatureSupportRequest extends FeatureSupportRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupGoalFeatureSupportRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java new file mode 100644 index 0000000000000..480df590f0a86 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** AzureBackupServer (DPMVenus) workload-specific protection container. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("AzureBackupServerContainer") +@Immutable +public final class AzureBackupServerContainer extends DpmContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupServerContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withCanReRegister(Boolean canReRegister) { + super.withCanReRegister(canReRegister); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withContainerId(String containerId) { + super.withContainerId(containerId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withProtectedItemCount(Long protectedItemCount) { + super.withProtectedItemCount(protectedItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withDpmAgentVersion(String dpmAgentVersion) { + super.withDpmAgentVersion(dpmAgentVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withDpmServers(List dpmServers) { + super.withDpmServers(dpmServers); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withUpgradeAvailable(Boolean upgradeAvailable) { + super.withUpgradeAvailable(upgradeAvailable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withExtendedInfo(DpmContainerExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java new file mode 100644 index 0000000000000..977a67f1e67e8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Backup engine type when Azure Backup Server is used to manage the backups. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") +@JsonTypeName("AzureBackupServerEngine") +@Immutable +public final class AzureBackupServerEngine extends BackupEngineBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupServerEngine.class); + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withBackupEngineState(String backupEngineState) { + super.withBackupEngineState(backupEngineState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withCanReRegister(Boolean canReRegister) { + super.withCanReRegister(canReRegister); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withBackupEngineId(String backupEngineId) { + super.withBackupEngineId(backupEngineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withDpmVersion(String dpmVersion) { + super.withDpmVersion(dpmVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withAzureBackupAgentVersion(String azureBackupAgentVersion) { + super.withAzureBackupAgentVersion(azureBackupAgentVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) { + super.withIsAzureBackupAgentUpgradeAvailable(isAzureBackupAgentUpgradeAvailable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) { + super.withIsDpmUpgradeAvailable(isDpmUpgradeAvailable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBackupServerEngine withExtendedInfo(BackupEngineExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java new file mode 100644 index 0000000000000..1b21a9525b6b8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** AzureFileShare workload-specific backup request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureFileShareBackupRequest") +@Fluent +public final class AzureFileShareBackupRequest extends BackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareBackupRequest.class); + + /* + * Backup copy will expire after the time specified (UTC). + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private OffsetDateTime recoveryPointExpiryTimeInUtc; + + /** + * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @return the recoveryPointExpiryTimeInUtc value. + */ + public OffsetDateTime recoveryPointExpiryTimeInUtc() { + return this.recoveryPointExpiryTimeInUtc; + } + + /** + * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. + * @return the AzureFileShareBackupRequest object itself. + */ + public AzureFileShareBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { + this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java new file mode 100644 index 0000000000000..ab092cc282b4d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Protectable item for Azure Fileshare workloads. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("AzureFileShare") +@Fluent +public final class AzureFileShareProtectableItem extends WorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareProtectableItem.class); + + /* + * Full Fabric ID of container to which this protectable item belongs. For + * example, ARM ID. + */ + @JsonProperty(value = "parentContainerFabricId") + private String parentContainerFabricId; + + /* + * Friendly name of container to which this protectable item belongs. + */ + @JsonProperty(value = "parentContainerFriendlyName") + private String parentContainerFriendlyName; + + /* + * File Share type XSync or XSMB. + */ + @JsonProperty(value = "azureFileShareType") + private AzureFileShareType azureFileShareType; + + /** + * Get the parentContainerFabricId property: Full Fabric ID of container to which this protectable item belongs. For + * example, ARM ID. + * + * @return the parentContainerFabricId value. + */ + public String parentContainerFabricId() { + return this.parentContainerFabricId; + } + + /** + * Set the parentContainerFabricId property: Full Fabric ID of container to which this protectable item belongs. For + * example, ARM ID. + * + * @param parentContainerFabricId the parentContainerFabricId value to set. + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withParentContainerFabricId(String parentContainerFabricId) { + this.parentContainerFabricId = parentContainerFabricId; + return this; + } + + /** + * Get the parentContainerFriendlyName property: Friendly name of container to which this protectable item belongs. + * + * @return the parentContainerFriendlyName value. + */ + public String parentContainerFriendlyName() { + return this.parentContainerFriendlyName; + } + + /** + * Set the parentContainerFriendlyName property: Friendly name of container to which this protectable item belongs. + * + * @param parentContainerFriendlyName the parentContainerFriendlyName value to set. + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withParentContainerFriendlyName(String parentContainerFriendlyName) { + this.parentContainerFriendlyName = parentContainerFriendlyName; + return this; + } + + /** + * Get the azureFileShareType property: File Share type XSync or XSMB. + * + * @return the azureFileShareType value. + */ + public AzureFileShareType azureFileShareType() { + return this.azureFileShareType; + } + + /** + * Set the azureFileShareType property: File Share type XSync or XSMB. + * + * @param azureFileShareType the azureFileShareType value to set. + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withAzureFileShareType(AzureFileShareType azureFileShareType) { + this.azureFileShareType = azureFileShareType; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java new file mode 100644 index 0000000000000..51e4f17335f46 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** AzureStorage backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureStorage") +@Fluent +public final class AzureFileShareProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareProtectionPolicy.class); + + /* + * Type of workload for the backup management + */ + @JsonProperty(value = "workLoadType") + private WorkloadType workLoadType; + + /* + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /* + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /* + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Get the workLoadType property: Type of workload for the backup management. + * + * @return the workLoadType value. + */ + public WorkloadType workLoadType() { + return this.workLoadType; + } + + /** + * Set the workLoadType property: Type of workload for the backup management. + * + * @param workLoadType the workLoadType value to set. + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { + this.workLoadType = workLoadType; + return this; + } + + /** + * Get the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value. + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set. + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set. + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileShareProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (schedulePolicy() != null) { + schedulePolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java new file mode 100644 index 0000000000000..1615851cfd9ac --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Update snapshot Uri with the correct friendly Name of the source Azure file share. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureFileShareProvisionILRRequest") +@Fluent +public final class AzureFileShareProvisionIlrRequest extends IlrRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareProvisionIlrRequest.class); + + /* + * Recovery point ID. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Source Storage account ARM Id + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Get the recoveryPointId property: Recovery point ID. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: Recovery point ID. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the AzureFileShareProvisionIlrRequest object itself. + */ + public AzureFileShareProvisionIlrRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the sourceResourceId property: Source Storage account ARM Id. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Source Storage account ARM Id. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureFileShareProvisionIlrRequest object itself. + */ + public AzureFileShareProvisionIlrRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java new file mode 100644 index 0000000000000..e231b143b1190 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Azure File Share workload specific backup copy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureFileShareRecoveryPoint") +@Fluent +public final class AzureFileShareRecoveryPoint extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareRecoveryPoint.class); + + /* + * Type of the backup copy. Specifies whether it is a crash consistent + * backup or app consistent. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime") + private OffsetDateTime recoveryPointTime; + + /* + * Contains Url to the snapshot of fileshare, if applicable + */ + @JsonProperty(value = "fileShareSnapshotUri") + private String fileShareSnapshotUri; + + /* + * Contains recovery point size + */ + @JsonProperty(value = "recoveryPointSizeInGB") + private Integer recoveryPointSizeInGB; + + /** + * Get the recoveryPointType property: Type of the backup copy. Specifies whether it is a crash consistent backup or + * app consistent. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: Type of the backup copy. Specifies whether it is a crash consistent backup or + * app consistent. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the AzureFileShareRecoveryPoint object itself. + */ + public AzureFileShareRecoveryPoint withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Time at which this backup copy was created. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the AzureFileShareRecoveryPoint object itself. + */ + public AzureFileShareRecoveryPoint withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the fileShareSnapshotUri property: Contains Url to the snapshot of fileshare, if applicable. + * + * @return the fileShareSnapshotUri value. + */ + public String fileShareSnapshotUri() { + return this.fileShareSnapshotUri; + } + + /** + * Set the fileShareSnapshotUri property: Contains Url to the snapshot of fileshare, if applicable. + * + * @param fileShareSnapshotUri the fileShareSnapshotUri value to set. + * @return the AzureFileShareRecoveryPoint object itself. + */ + public AzureFileShareRecoveryPoint withFileShareSnapshotUri(String fileShareSnapshotUri) { + this.fileShareSnapshotUri = fileShareSnapshotUri; + return this; + } + + /** + * Get the recoveryPointSizeInGB property: Contains recovery point size. + * + * @return the recoveryPointSizeInGB value. + */ + public Integer recoveryPointSizeInGB() { + return this.recoveryPointSizeInGB; + } + + /** + * Set the recoveryPointSizeInGB property: Contains recovery point size. + * + * @param recoveryPointSizeInGB the recoveryPointSizeInGB value to set. + * @return the AzureFileShareRecoveryPoint object itself. + */ + public AzureFileShareRecoveryPoint withRecoveryPointSizeInGB(Integer recoveryPointSizeInGB) { + this.recoveryPointSizeInGB = recoveryPointSizeInGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.java new file mode 100644 index 0000000000000..3a1bc5dd464c0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPointAutoGenerated.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Azure File Share workload specific backup copy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureFileShareRecoveryPoint") +@Immutable +public final class AzureFileShareRecoveryPointAutoGenerated extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareRecoveryPointAutoGenerated.class); + + /* + * Type of the backup copy. Specifies whether it is a crash consistent + * backup or app consistent. + */ + @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime recoveryPointTime; + + /* + * Contains Url to the snapshot of fileshare, if applicable + */ + @JsonProperty(value = "fileShareSnapshotUri", access = JsonProperty.Access.WRITE_ONLY) + private String fileShareSnapshotUri; + + /* + * Contains recovery point size + */ + @JsonProperty(value = "recoveryPointSizeInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer recoveryPointSizeInGB; + + /** + * Get the recoveryPointType property: Type of the backup copy. Specifies whether it is a crash consistent backup or + * app consistent. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the fileShareSnapshotUri property: Contains Url to the snapshot of fileshare, if applicable. + * + * @return the fileShareSnapshotUri value. + */ + public String fileShareSnapshotUri() { + return this.fileShareSnapshotUri; + } + + /** + * Get the recoveryPointSizeInGB property: Contains recovery point size. + * + * @return the recoveryPointSizeInGB value. + */ + public Integer recoveryPointSizeInGB() { + return this.recoveryPointSizeInGB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java new file mode 100644 index 0000000000000..69e9c85377edb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** AzureFileShare Restore Request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureFileShareRestoreRequest") +@Fluent +public final class AzureFileShareRestoreRequest extends RestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileShareRestoreRequest.class); + + /* + * Type of this recovery. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /* + * Source storage account ARM Id + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * Options to resolve copy conflicts. + */ + @JsonProperty(value = "copyOptions") + private CopyOptions copyOptions; + + /* + * Restore Type (FullShareRestore or ItemLevelRestore) + */ + @JsonProperty(value = "restoreRequestType") + private RestoreRequestType restoreRequestType; + + /* + * List of Source Files/Folders(which need to recover) and TargetFolderPath + * details + */ + @JsonProperty(value = "restoreFileSpecs") + private List restoreFileSpecs; + + /* + * Target File Share Details + */ + @JsonProperty(value = "targetDetails") + private TargetAfsRestoreInfo targetDetails; + + /** + * Get the recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Source storage account ARM Id. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Source storage account ARM Id. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the copyOptions property: Options to resolve copy conflicts. + * + * @return the copyOptions value. + */ + public CopyOptions copyOptions() { + return this.copyOptions; + } + + /** + * Set the copyOptions property: Options to resolve copy conflicts. + * + * @param copyOptions the copyOptions value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withCopyOptions(CopyOptions copyOptions) { + this.copyOptions = copyOptions; + return this; + } + + /** + * Get the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). + * + * @return the restoreRequestType value. + */ + public RestoreRequestType restoreRequestType() { + return this.restoreRequestType; + } + + /** + * Set the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). + * + * @param restoreRequestType the restoreRequestType value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreRequestType(RestoreRequestType restoreRequestType) { + this.restoreRequestType = restoreRequestType; + return this; + } + + /** + * Get the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath + * details. + * + * @return the restoreFileSpecs value. + */ + public List restoreFileSpecs() { + return this.restoreFileSpecs; + } + + /** + * Set the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath + * details. + * + * @param restoreFileSpecs the restoreFileSpecs value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreFileSpecs(List restoreFileSpecs) { + this.restoreFileSpecs = restoreFileSpecs; + return this; + } + + /** + * Get the targetDetails property: Target File Share Details. + * + * @return the targetDetails value. + */ + public TargetAfsRestoreInfo targetDetails() { + return this.targetDetails; + } + + /** + * Set the targetDetails property: Target File Share Details. + * + * @param targetDetails the targetDetails value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withTargetDetails(TargetAfsRestoreInfo targetDetails) { + this.targetDetails = targetDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (restoreFileSpecs() != null) { + restoreFileSpecs().forEach(e -> e.validate()); + } + if (targetDetails() != null) { + targetDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java new file mode 100644 index 0000000000000..6b067cd5332fe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFileShareType. */ +public final class AzureFileShareType extends ExpandableStringEnum { + /** Static value Invalid for AzureFileShareType. */ + public static final AzureFileShareType INVALID = fromString("Invalid"); + + /** Static value XSMB for AzureFileShareType. */ + public static final AzureFileShareType XSMB = fromString("XSMB"); + + /** Static value XSync for AzureFileShareType. */ + public static final AzureFileShareType XSYNC = fromString("XSync"); + + /** + * Creates or finds a AzureFileShareType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFileShareType. + */ + @JsonCreator + public static AzureFileShareType fromString(String name) { + return fromString(name, AzureFileShareType.class); + } + + /** @return known AzureFileShareType values. */ + public static Collection values() { + return values(AzureFileShareType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java new file mode 100644 index 0000000000000..014a1e81bd813 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure File Share workload-specific backup item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureFileShareProtectedItem") +@Fluent +public final class AzureFileshareProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileshareProtectedItem.class); + + /* + * Friendly name of the fileshare represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /* + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private OffsetDateTime lastBackupTime; + + /* + * Health details of different KPIs + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /* + * Additional information with this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureFileshareProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendlyName property: Friendly name of the fileshare represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the fileshare represented by this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get the extendedInfo property: Additional information with this backup item. + * + * @return the extendedInfo value. + */ + public AzureFileshareProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information with this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withExtendedInfo(AzureFileshareProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (kpisHealths() != null) { + kpisHealths() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java new file mode 100644 index 0000000000000..a14f75db8f00c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemAutoGenerated.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure File Share workload-specific backup item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureFileShareProtectedItem") +@Fluent +public final class AzureFileshareProtectedItemAutoGenerated extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileshareProtectedItemAutoGenerated.class); + + /* + * Friendly name of the fileshare represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /* + * backups running status for this backup item. + */ + @JsonProperty(value = "healthStatus") + private HealthStatus healthStatus; + + /* + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private OffsetDateTime lastBackupTime; + + /* + * Health details of different KPIs + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /* + * Additional information with this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureFileshareProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendlyName property: Friendly name of the fileshare represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the fileshare represented by this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the healthStatus property: backups running status for this backup item. + * + * @return the healthStatus value. + */ + public HealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Set the healthStatus property: backups running status for this backup item. + * + * @param healthStatus the healthStatus value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withHealthStatus(HealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get the extendedInfo property: Additional information with this backup item. + * + * @return the extendedInfo value. + */ + public AzureFileshareProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information with this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureFileshareProtectedItemAutoGenerated object itself. + */ + public AzureFileshareProtectedItemAutoGenerated withExtendedInfo( + AzureFileshareProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withBackupManagementType( + BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withDeferredDeleteTimeInUtc( + OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withIsScheduledForDeferredDelete( + Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withDeferredDeleteTimeRemaining( + String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileshareProtectedItemAutoGenerated withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (kpisHealths() != null) { + kpisHealths() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..2757927557ebf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information about Azure File Share backup item. */ +@Fluent +public final class AzureFileshareProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileshareProtectedItemExtendedInfo.class); + + /* + * The oldest backup copy available for this item in the service. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of available backup copies associated with this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /* + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /* + * Indicates the state of this resource. Possible values are from enum + * ResourceState {Invalid, Active, SoftDeleted, Deleted} + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private String resourceState; + + /* + * The resource state sync time for this backup item. + */ + @JsonProperty(value = "resourceStateSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime resourceStateSyncTime; + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set. + * @return the AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Get the resourceState property: Indicates the state of this resource. Possible values are from enum ResourceState + * {Invalid, Active, SoftDeleted, Deleted}. + * + * @return the resourceState value. + */ + public String resourceState() { + return this.resourceState; + } + + /** + * Get the resourceStateSyncTime property: The resource state sync time for this backup item. + * + * @return the resourceStateSyncTime value. + */ + public OffsetDateTime resourceStateSyncTime() { + return this.resourceStateSyncTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java new file mode 100644 index 0000000000000..72abdd5b96841 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup item representing a classic virtual machine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +@Immutable +public final class AzureIaaSClassicComputeVMContainer extends IaaSvmContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withVirtualMachineVersion(String virtualMachineVersion) { + super.withVirtualMachineVersion(virtualMachineVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withResourceGroup(String resourceGroup) { + super.withResourceGroup(resourceGroup); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java new file mode 100644 index 0000000000000..5c8a6dcd67967 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup item representing the Classic Compute VM. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +@Immutable +public final class AzureIaaSClassicComputeVMProtectableItem extends IaaSvmProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectableItem withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java new file mode 100644 index 0000000000000..0e5ca1f612924 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** IaaS VM workload-specific backup item representing the Classic Compute VM. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +@Immutable +public final class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSvmProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSClassicComputeVMProtectedItem.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withProtectionState(ProtectionState protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withHealthStatus(HealthStatus healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withHealthDetails(List healthDetails) { + super.withHealthDetails(healthDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withKpisHealths(Map kpisHealths) { + super.withKpisHealths(kpisHealths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withLastBackupStatus(String lastBackupStatus) { + super.withLastBackupStatus(lastBackupStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + super.withLastBackupTime(lastBackupTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withProtectedItemDataId(String protectedItemDataId) { + super.withProtectedItemDataId(protectedItemDataId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { + super.withExtendedProperties(extendedProperties); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withIsScheduledForDeferredDelete( + Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSClassicComputeVMProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java new file mode 100644 index 0000000000000..7fca52777a878 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +@Immutable +public final class AzureIaaSComputeVMContainer extends IaaSvmContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withVirtualMachineVersion(String virtualMachineVersion) { + super.withVirtualMachineVersion(virtualMachineVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withResourceGroup(String resourceGroup) { + super.withResourceGroup(resourceGroup); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java new file mode 100644 index 0000000000000..afb50958e22a7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup item representing the Azure Resource Manager VM. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +@Immutable +public final class AzureIaaSComputeVMProtectableItem extends IaaSvmProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectableItem withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java new file mode 100644 index 0000000000000..69bb67971f10a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** IaaS VM workload-specific backup item representing the Azure Resource Manager VM. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +@Immutable +public final class AzureIaaSComputeVMProtectedItem extends AzureIaaSvmProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSComputeVMProtectedItem.class); + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withVirtualMachineId(String virtualMachineId) { + super.withVirtualMachineId(virtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withProtectionState(ProtectionState protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withHealthStatus(HealthStatus healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withHealthDetails(List healthDetails) { + super.withHealthDetails(healthDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withKpisHealths(Map kpisHealths) { + super.withKpisHealths(kpisHealths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withLastBackupStatus(String lastBackupStatus) { + super.withLastBackupStatus(lastBackupStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + super.withLastBackupTime(lastBackupTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withProtectedItemDataId(String protectedItemDataId) { + super.withProtectedItemDataId(protectedItemDataId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { + super.withExtendedProperties(extendedProperties); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSComputeVMProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java new file mode 100644 index 0000000000000..dac6c1d86ca38 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure IaaS VM workload-specific error information. */ +@Immutable +public final class AzureIaaSvmErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmErrorInfo.class); + + /* + * Error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /* + * Title: Typically, the entity that the error pertains to. + */ + @JsonProperty(value = "errorTitle", access = JsonProperty.Access.WRITE_ONLY) + private String errorTitle; + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString", access = JsonProperty.Access.WRITE_ONLY) + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorTitle property: Title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value. + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java new file mode 100644 index 0000000000000..003a2a1445cd3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Azure IaaS VM workload-specific Health Details. */ +@Immutable +public final class AzureIaaSvmHealthDetails extends ResourceHealthDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmHealthDetails.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java new file mode 100644 index 0000000000000..bffe9e5702b49 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Azure IaaS VM workload-specific job object. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("AzureIaaSVMJob") +@Fluent +public final class AzureIaaSvmJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmJob.class); + + /* + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Specifies whether the backup item is a Classic or an Azure Resource + * Manager VM. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /* + * Additional information for this job. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSvmJobExtendedInfo extendedInfo; + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the AzureIaaSvmJob object itself. + */ + public AzureIaaSvmJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the AzureIaaSvmJob object itself. + */ + public AzureIaaSvmJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details on execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the AzureIaaSvmJob object itself. + */ + public AzureIaaSvmJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the virtualMachineVersion property: Specifies whether the backup item is a Classic or an Azure Resource + * Manager VM. + * + * @return the virtualMachineVersion value. + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set the virtualMachineVersion property: Specifies whether the backup item is a Classic or an Azure Resource + * Manager VM. + * + * @param virtualMachineVersion the virtualMachineVersion value to set. + * @return the AzureIaaSvmJob object itself. + */ + public AzureIaaSvmJob withVirtualMachineVersion(String virtualMachineVersion) { + this.virtualMachineVersion = virtualMachineVersion; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this job. + * + * @return the extendedInfo value. + */ + public AzureIaaSvmJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureIaaSvmJob object itself. + */ + public AzureIaaSvmJob withExtendedInfo(AzureIaaSvmJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java new file mode 100644 index 0000000000000..f5aea0d99977f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure IaaS VM workload-specific additional information for job. */ +@Fluent +public final class AzureIaaSvmJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmJobExtendedInfo.class); + + /* + * List of tasks associated with this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /* + * Job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Job internal properties. + */ + @JsonProperty(value = "internalPropertyBag") + private Map internalPropertyBag; + + /* + * Indicates progress of the job. Null if it has not started or completed. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /* + * Time remaining for execution of this job. + */ + @JsonProperty(value = "estimatedRemainingDuration") + private String estimatedRemainingDuration; + + /* + * Non localized error message on job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get the tasksList property: List of tasks associated with this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set the tasksList property: List of tasks associated with this job. + * + * @param tasksList the tasksList value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the internalPropertyBag property: Job internal properties. + * + * @return the internalPropertyBag value. + */ + public Map internalPropertyBag() { + return this.internalPropertyBag; + } + + /** + * Set the internalPropertyBag property: Job internal properties. + * + * @param internalPropertyBag the internalPropertyBag value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withInternalPropertyBag(Map internalPropertyBag) { + this.internalPropertyBag = internalPropertyBag; + return this; + } + + /** + * Get the progressPercentage property: Indicates progress of the job. Null if it has not started or completed. + * + * @return the progressPercentage value. + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: Indicates progress of the job. Null if it has not started or completed. + * + * @param progressPercentage the progressPercentage value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withProgressPercentage(Double progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get the estimatedRemainingDuration property: Time remaining for execution of this job. + * + * @return the estimatedRemainingDuration value. + */ + public String estimatedRemainingDuration() { + return this.estimatedRemainingDuration; + } + + /** + * Set the estimatedRemainingDuration property: Time remaining for execution of this job. + * + * @param estimatedRemainingDuration the estimatedRemainingDuration value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withEstimatedRemainingDuration(String estimatedRemainingDuration) { + this.estimatedRemainingDuration = estimatedRemainingDuration; + return this; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set the dynamicErrorMessage property: Non localized error message on job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set. + * @return the AzureIaaSvmJobExtendedInfo object itself. + */ + public AzureIaaSvmJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasksList() != null) { + tasksList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java new file mode 100644 index 0000000000000..0abad6b219245 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Azure IaaS VM workload-specific job task details. */ +@Fluent +public final class AzureIaaSvmJobTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmJobTaskDetails.class); + + /* + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The instanceId. + */ + @JsonProperty(value = "instanceId") + private String instanceId; + + /* + * Time elapsed for task. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Progress of the task. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /* + * Details about execution of the task. + * eg: number of bytes transferred etc + */ + @JsonProperty(value = "taskExecutionDetails") + private String taskExecutionDetails; + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The task display name. + * + * @param taskId the taskId value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the instanceId property: The instanceId. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: The instanceId. + * + * @param instanceId the instanceId value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed for task. + * + * @param duration the duration value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status. + * + * @param status the status value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the progressPercentage property: Progress of the task. + * + * @return the progressPercentage value. + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progressPercentage property: Progress of the task. + * + * @param progressPercentage the progressPercentage value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withProgressPercentage(Double progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get the taskExecutionDetails property: Details about execution of the task. eg: number of bytes transferred etc. + * + * @return the taskExecutionDetails value. + */ + public String taskExecutionDetails() { + return this.taskExecutionDetails; + } + + /** + * Set the taskExecutionDetails property: Details about execution of the task. eg: number of bytes transferred etc. + * + * @param taskExecutionDetails the taskExecutionDetails value to set. + * @return the AzureIaaSvmJobTaskDetails object itself. + */ + public AzureIaaSvmJobTaskDetails withTaskExecutionDetails(String taskExecutionDetails) { + this.taskExecutionDetails = taskExecutionDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java new file mode 100644 index 0000000000000..edfd9a2b4a952 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** IaaS VM workload-specific backup item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectedItemType", + defaultImpl = AzureIaaSvmProtectedItem.class) +@JsonTypeName("AzureIaaSVMProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "Microsoft.ClassicCompute/virtualMachines", + value = AzureIaaSClassicComputeVMProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectedItem.class) +}) +@Fluent +public class AzureIaaSvmProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmProtectedItem.class); + + /* + * Friendly name of the VM represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Fully qualified ARM ID of the virtual machine represented by this item. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /* + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /* + * Health status of protected item. + */ + @JsonProperty(value = "healthStatus") + private HealthStatus healthStatus; + + /* + * Health details on this backup item. + */ + @JsonProperty(value = "healthDetails") + private List healthDetails; + + /* + * Health details of different KPIs + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /* + * Last backup operation status. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private OffsetDateTime lastBackupTime; + + /* + * Data ID of the protected item. + */ + @JsonProperty(value = "protectedItemDataId") + private String protectedItemDataId; + + /* + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSvmProtectedItemExtendedInfo extendedInfo; + + /* + * Extended Properties for Azure IaasVM Backup. + */ + @JsonProperty(value = "extendedProperties") + private ExtendedProperties extendedProperties; + + /** + * Get the friendlyName property: Friendly name of the VM represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the VM represented by this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item. + * + * @param virtualMachineId the virtualMachineId value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the healthStatus property: Health status of protected item. + * + * @return the healthStatus value. + */ + public HealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Set the healthStatus property: Health status of protected item. + * + * @param healthStatus the healthStatus value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withHealthStatus(HealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the healthDetails property: Health details on this backup item. + * + * @return the healthDetails value. + */ + public List healthDetails() { + return this.healthDetails; + } + + /** + * Set the healthDetails property: Health details on this backup item. + * + * @param healthDetails the healthDetails value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withHealthDetails(List healthDetails) { + this.healthDetails = healthDetails; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the protectedItemDataId property: Data ID of the protected item. + * + * @return the protectedItemDataId value. + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Set the protectedItemDataId property: Data ID of the protected item. + * + * @param protectedItemDataId the protectedItemDataId value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withProtectedItemDataId(String protectedItemDataId) { + this.protectedItemDataId = protectedItemDataId; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this backup item. + * + * @return the extendedInfo value. + */ + public AzureIaaSvmProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the extendedProperties property: Extended Properties for Azure IaasVM Backup. + * + * @return the extendedProperties value. + */ + public ExtendedProperties extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Extended Properties for Azure IaasVM Backup. + * + * @param extendedProperties the extendedProperties value to set. + * @return the AzureIaaSvmProtectedItem object itself. + */ + public AzureIaaSvmProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (healthDetails() != null) { + healthDetails().forEach(e -> e.validate()); + } + if (kpisHealths() != null) { + kpisHealths() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + if (extendedProperties() != null) { + extendedProperties().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..7be914474e7a3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information on Azure IaaS VM specific backup item. */ +@Fluent +public final class AzureIaaSvmProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmProtectedItemExtendedInfo.class); + + /* + * The oldest backup copy available for this backup item. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies available for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /* + * Specifies if backup policy associated with the backup item is + * inconsistent. + */ + @JsonProperty(value = "policyInconsistent") + private Boolean policyInconsistent; + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. + */ + public AzureIaaSvmProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. + */ + public AzureIaaSvmProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the policyInconsistent property: Specifies if backup policy associated with the backup item is inconsistent. + * + * @return the policyInconsistent value. + */ + public Boolean policyInconsistent() { + return this.policyInconsistent; + } + + /** + * Set the policyInconsistent property: Specifies if backup policy associated with the backup item is inconsistent. + * + * @param policyInconsistent the policyInconsistent value to set. + * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. + */ + public AzureIaaSvmProtectedItemExtendedInfo withPolicyInconsistent(Boolean policyInconsistent) { + this.policyInconsistent = policyInconsistent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java new file mode 100644 index 0000000000000..efa3eaa4394cf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureIaasVM") +@Fluent +public final class AzureIaaSvmProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureIaaSvmProtectionPolicy.class); + + /* + * The instantRPDetails property. + */ + @JsonProperty(value = "instantRPDetails") + private InstantRPAdditionalDetails instantRPDetails; + + /* + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /* + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /* + * Instant RP retention policy range in days + */ + @JsonProperty(value = "instantRpRetentionRangeInDays") + private Integer instantRpRetentionRangeInDays; + + /* + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Get the instantRPDetails property: The instantRPDetails property. + * + * @return the instantRPDetails value. + */ + public InstantRPAdditionalDetails instantRPDetails() { + return this.instantRPDetails; + } + + /** + * Set the instantRPDetails property: The instantRPDetails property. + * + * @param instantRPDetails the instantRPDetails value to set. + * @return the AzureIaaSvmProtectionPolicy object itself. + */ + public AzureIaaSvmProtectionPolicy withInstantRPDetails(InstantRPAdditionalDetails instantRPDetails) { + this.instantRPDetails = instantRPDetails; + return this; + } + + /** + * Get the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value. + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set. + * @return the AzureIaaSvmProtectionPolicy object itself. + */ + public AzureIaaSvmProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the AzureIaaSvmProtectionPolicy object itself. + */ + public AzureIaaSvmProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the instantRpRetentionRangeInDays property: Instant RP retention policy range in days. + * + * @return the instantRpRetentionRangeInDays value. + */ + public Integer instantRpRetentionRangeInDays() { + return this.instantRpRetentionRangeInDays; + } + + /** + * Set the instantRpRetentionRangeInDays property: Instant RP retention policy range in days. + * + * @param instantRpRetentionRangeInDays the instantRpRetentionRangeInDays value to set. + * @return the AzureIaaSvmProtectionPolicy object itself. + */ + public AzureIaaSvmProtectionPolicy withInstantRpRetentionRangeInDays(Integer instantRpRetentionRangeInDays) { + this.instantRpRetentionRangeInDays = instantRpRetentionRangeInDays; + return this; + } + + /** + * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set. + * @return the AzureIaaSvmProtectionPolicy object itself. + */ + public AzureIaaSvmProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureIaaSvmProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (instantRPDetails() != null) { + instantRPDetails().validate(); + } + if (schedulePolicy() != null) { + schedulePolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java new file mode 100644 index 0000000000000..7b6e721d5a2aa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Azure Recovery Services Vault specific protection intent item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectionIntentItemType", + defaultImpl = AzureRecoveryServiceVaultProtectionIntent.class) +@JsonTypeName("RecoveryServiceVaultItem") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSQLAutoProtectionIntent", + value = AzureWorkloadSqlAutoProtectionIntent.class) +}) +@Immutable +public class AzureRecoveryServiceVaultProtectionIntent extends ProtectionIntent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureRecoveryServiceVaultProtectionIntent.class); + + /** {@inheritDoc} */ + @Override + public AzureRecoveryServiceVaultProtectionIntent withBackupManagementType( + BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureRecoveryServiceVaultProtectionIntent withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureRecoveryServiceVaultProtectionIntent withItemId(String itemId) { + super.withItemId(itemId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureRecoveryServiceVaultProtectionIntent withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureRecoveryServiceVaultProtectionIntent withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java new file mode 100644 index 0000000000000..3d19287ddf4bd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.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.recoveryservicesbackup.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; + +/** IaaS VM specific backup protection intent item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType") +@JsonTypeName("AzureResourceItem") +@Fluent +public final class AzureResourceProtectionIntent extends ProtectionIntent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceProtectionIntent.class); + + /* + * Friendly name of the VM represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get the friendlyName property: Friendly name of the VM represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the VM represented by this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the AzureResourceProtectionIntent object itself. + */ + public AzureResourceProtectionIntent withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResourceProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResourceProtectionIntent withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResourceProtectionIntent withItemId(String itemId) { + super.withItemId(itemId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResourceProtectionIntent withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureResourceProtectionIntent withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java new file mode 100644 index 0000000000000..befdfaed75f2c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.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.recoveryservicesbackup.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; + +/** Azure Sql workload-specific container. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("AzureSqlContainer") +@Immutable +public final class AzureSqlContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureSqlContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java new file mode 100644 index 0000000000000..ed49dcdda61ad --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Azure SQL workload-specific backup item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.Sql/servers/databases") +@Fluent +public final class AzureSqlProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlProtectedItem.class); + + /* + * Internal ID of a backup item. Used by Azure SQL Backup engine to contact + * Recovery Services. + */ + @JsonProperty(value = "protectedItemDataId") + private String protectedItemDataId; + + /* + * Backup state of the backed up item. + */ + @JsonProperty(value = "protectionState") + private ProtectedItemState protectionState; + + /* + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureSqlProtectedItemExtendedInfo extendedInfo; + + /** + * Get the protectedItemDataId property: Internal ID of a backup item. Used by Azure SQL Backup engine to contact + * Recovery Services. + * + * @return the protectedItemDataId value. + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Set the protectedItemDataId property: Internal ID of a backup item. Used by Azure SQL Backup engine to contact + * Recovery Services. + * + * @param protectedItemDataId the protectedItemDataId value to set. + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withProtectedItemDataId(String protectedItemDataId) { + this.protectedItemDataId = protectedItemDataId; + return this; + } + + /** + * Get the protectionState property: Backup state of the backed up item. + * + * @return the protectionState value. + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of the backed up item. + * + * @param protectionState the protectionState value to set. + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withProtectionState(ProtectedItemState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this backup item. + * + * @return the extendedInfo value. + */ + public AzureSqlProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withExtendedInfo(AzureSqlProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..1bf411e16f447 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information on Azure Sql specific protected item. */ +@Fluent +public final class AzureSqlProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlProtectedItemExtendedInfo.class); + + /* + * The oldest backup copy available for this item in the service. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of available backup copies associated with this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /* + * State of the backup policy associated with this backup item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: Number of available backup copies associated with this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the policyState property: State of the backup policy associated with this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Set the policyState property: State of the backup policy associated with this backup item. + * + * @param policyState the policyState value to set. + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java new file mode 100644 index 0000000000000..db49064cd2739 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure SQL workload-specific backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureSql") +@Fluent +public final class AzureSqlProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlProtectionPolicy.class); + + /* + * Retention policy details. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the retentionPolicy property: Retention policy details. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Retention policy details. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the AzureSqlProtectionPolicy object itself. + */ + public AzureSqlProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java new file mode 100644 index 0000000000000..4694adf54ac87 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Container for SQL workloads under SQL Availability Group. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("SQLAGWorkLoadContainer") +@Immutable +public final class AzureSqlagWorkloadContainerProtectionContainer extends AzureWorkloadContainer { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureSqlagWorkloadContainerProtectionContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + super.withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withExtendedInfo( + AzureWorkloadContainerExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withWorkloadType(WorkloadType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withOperationType(OperationType operationType) { + super.withOperationType(operationType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withBackupManagementType( + BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureSqlagWorkloadContainerProtectionContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java new file mode 100644 index 0000000000000..9ff03accdff79 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.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.recoveryservicesbackup.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; + +/** Azure Storage Account workload-specific container. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("StorageContainer") +@Fluent +public final class AzureStorageContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageContainer.class); + + /* + * Fully qualified ARM url. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * Storage account version. + */ + @JsonProperty(value = "storageAccountVersion") + private String storageAccountVersion; + + /* + * Resource group name of Recovery Services Vault. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Number of items backed up in this container. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /** + * Get the sourceResourceId property: Fully qualified ARM url. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified ARM url. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the storageAccountVersion property: Storage account version. + * + * @return the storageAccountVersion value. + */ + public String storageAccountVersion() { + return this.storageAccountVersion; + } + + /** + * Set the storageAccountVersion property: Storage account version. + * + * @param storageAccountVersion the storageAccountVersion value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withStorageAccountVersion(String storageAccountVersion) { + this.storageAccountVersion = storageAccountVersion; + return this; + } + + /** + * Get the resourceGroup property: Resource group name of Recovery Services Vault. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Resource group name of Recovery Services Vault. + * + * @param resourceGroup the resourceGroup value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the protectedItemCount property: Number of items backed up in this container. + * + * @return the protectedItemCount value. + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of items backed up in this container. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java new file mode 100644 index 0000000000000..322f177017cf2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure storage specific error information. */ +@Fluent +public final class AzureStorageErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageErrorInfo.class); + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Set the errorString property: Localized error string. + * + * @param errorString the errorString value to set. + * @return the AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: List of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set. + * @return the AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java new file mode 100644 index 0000000000000..39b1ba00e0868 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Azure storage specific job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("AzureStorageJob") +@Fluent +public final class AzureStorageJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageJob.class); + + /* + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Specifies friendly name of the storage account. + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /* + * Specifies whether the Storage account is a Classic or an Azure Resource + * Manager Storage account. + */ + @JsonProperty(value = "storageAccountVersion") + private String storageAccountVersion; + + /* + * Additional information about the job. + */ + @JsonProperty(value = "extendedInfo") + private AzureStorageJobExtendedInfo extendedInfo; + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details on execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the storageAccountName property: Specifies friendly name of the storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Specifies friendly name of the storage account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountVersion property: Specifies whether the Storage account is a Classic or an Azure Resource + * Manager Storage account. + * + * @return the storageAccountVersion value. + */ + public String storageAccountVersion() { + return this.storageAccountVersion; + } + + /** + * Set the storageAccountVersion property: Specifies whether the Storage account is a Classic or an Azure Resource + * Manager Storage account. + * + * @param storageAccountVersion the storageAccountVersion value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withStorageAccountVersion(String storageAccountVersion) { + this.storageAccountVersion = storageAccountVersion; + return this; + } + + /** + * Get the extendedInfo property: Additional information about the job. + * + * @return the extendedInfo value. + */ + public AzureStorageJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information about the job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withExtendedInfo(AzureStorageJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java new file mode 100644 index 0000000000000..d525ec20308ac --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Storage workload-specific additional information for job. */ +@Fluent +public final class AzureStorageJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageJobExtendedInfo.class); + + /* + * List of tasks for this job + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /* + * Job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set the tasksList property: List of tasks for this job. + * + * @param tasksList the tasksList value to set. + * @return the AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set the dynamicErrorMessage property: Non localized error message on job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set. + * @return the AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasksList() != null) { + tasksList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java new file mode 100644 index 0000000000000..44804d63397b0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure storage workload specific job task details. */ +@Fluent +public final class AzureStorageJobTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageJobTaskDetails.class); + + /* + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The task display name. + * + * @param taskId the taskId value to set. + * @return the AzureStorageJobTaskDetails object itself. + */ + public AzureStorageJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status. + * + * @param status the status value to set. + * @return the AzureStorageJobTaskDetails object itself. + */ + public AzureStorageJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java new file mode 100644 index 0000000000000..6c0f223ad21a6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.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.recoveryservicesbackup.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; + +/** Azure Storage-specific protectable containers. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType") +@JsonTypeName("StorageContainer") +@Immutable +public final class AzureStorageProtectableContainer extends ProtectableContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStorageProtectableContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureStorageProtectableContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageProtectableContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageProtectableContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureStorageProtectableContainer withContainerId(String containerId) { + super.withContainerId(containerId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java new file mode 100644 index 0000000000000..a400221029393 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.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.recoveryservicesbackup.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; + +/** Azure workload-specific container. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType") +@JsonTypeName("VMAppContainer") +@Immutable +public final class AzureVMAppContainerProtectableContainer extends ProtectableContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMAppContainerProtectableContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectableContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectableContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectableContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectableContainer withContainerId(String containerId) { + super.withContainerId(containerId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java new file mode 100644 index 0000000000000..a809634cff839 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Container for SQL workloads under Azure Virtual Machines. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("VMAppContainer") +@Immutable +public final class AzureVMAppContainerProtectionContainer extends AzureWorkloadContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMAppContainerProtectionContainer.class); + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + super.withLastUpdatedTime(lastUpdatedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withWorkloadType(WorkloadType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withOperationType(OperationType operationType) { + super.withOperationType(operationType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVMAppContainerProtectionContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java new file mode 100644 index 0000000000000..c2785b7a970c9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** AzureResource(IaaS VM) Specific feature support request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "featureType") +@JsonTypeName("AzureVMResourceBackup") +@Fluent +public final class AzureVMResourceFeatureSupportRequest extends FeatureSupportRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVMResourceFeatureSupportRequest.class); + + /* + * Size of the resource: VM size(A/D series etc) in case of IaasVM + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * SKUs (Premium/Managed etc) in case of IaasVM + */ + @JsonProperty(value = "vmSku") + private String vmSku; + + /** + * Get the vmSize property: Size of the resource: VM size(A/D series etc) in case of IaasVM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Size of the resource: VM size(A/D series etc) in case of IaasVM. + * + * @param vmSize the vmSize value to set. + * @return the AzureVMResourceFeatureSupportRequest object itself. + */ + public AzureVMResourceFeatureSupportRequest withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the vmSku property: SKUs (Premium/Managed etc) in case of IaasVM. + * + * @return the vmSku value. + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set the vmSku property: SKUs (Premium/Managed etc) in case of IaasVM. + * + * @param vmSku the vmSku value to set. + * @return the AzureVMResourceFeatureSupportRequest object itself. + */ + public AzureVMResourceFeatureSupportRequest withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java new file mode 100644 index 0000000000000..3d21fb714cdb1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; + +/** An immutable client-side representation of AzureVMResourceFeatureSupportResponse. */ +public interface AzureVMResourceFeatureSupportResponse { + /** + * Gets the supportStatus property: Support status of feature. + * + * @return the supportStatus value. + */ + SupportStatus supportStatus(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner object. + * + * @return the inner object. + */ + AzureVMResourceFeatureSupportResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java new file mode 100644 index 0000000000000..c42cbdeee0373 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "workloadItemType", + defaultImpl = AzureVmWorkloadItem.class) +@JsonTypeName("AzureVmWorkloadItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SAPAseDatabase", value = AzureVmWorkloadSapAseDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSapAseSystemWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSapHanaDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSapHanaSystemWorkloadItem.class), + @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSqlDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSqlInstanceWorkloadItem.class) +}) +@Fluent +public class AzureVmWorkloadItem extends WorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadItem.class); + + /* + * Name for instance or AG + */ + @JsonProperty(value = "parentName") + private String parentName; + + /* + * Host/Cluster Name for instance or AG + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Indicates if workload item is auto-protectable + */ + @JsonProperty(value = "isAutoProtectable") + private Boolean isAutoProtectable; + + /* + * For instance or AG, indicates number of DB's present + */ + @JsonProperty(value = "subinquireditemcount") + private Integer subinquireditemcount; + + /* + * For instance or AG, indicates number of DB's to be protected + */ + @JsonProperty(value = "subWorkloadItemCount") + private Integer subWorkloadItemCount; + + /** + * Get the parentName property: Name for instance or AG. + * + * @return the parentName value. + */ + public String parentName() { + return this.parentName; + } + + /** + * Set the parentName property: Name for instance or AG. + * + * @param parentName the parentName value to set. + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get the serverName property: Host/Cluster Name for instance or AG. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set. + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the isAutoProtectable property: Indicates if workload item is auto-protectable. + * + * @return the isAutoProtectable value. + */ + public Boolean isAutoProtectable() { + return this.isAutoProtectable; + } + + /** + * Set the isAutoProtectable property: Indicates if workload item is auto-protectable. + * + * @param isAutoProtectable the isAutoProtectable value to set. + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + this.isAutoProtectable = isAutoProtectable; + return this; + } + + /** + * Get the subinquireditemcount property: For instance or AG, indicates number of DB's present. + * + * @return the subinquireditemcount value. + */ + public Integer subinquireditemcount() { + return this.subinquireditemcount; + } + + /** + * Set the subinquireditemcount property: For instance or AG, indicates number of DB's present. + * + * @param subinquireditemcount the subinquireditemcount value to set. + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + this.subinquireditemcount = subinquireditemcount; + return this; + } + + /** + * Get the subWorkloadItemCount property: For instance or AG, indicates number of DB's to be protected. + * + * @return the subWorkloadItemCount value. + */ + public Integer subWorkloadItemCount() { + return this.subWorkloadItemCount; + } + + /** + * Set the subWorkloadItemCount property: For instance or AG, indicates number of DB's to be protected. + * + * @param subWorkloadItemCount the subWorkloadItemCount value to set. + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + this.subWorkloadItemCount = subWorkloadItemCount; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java new file mode 100644 index 0000000000000..0eec4cfd5e0d1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectableItemType", + defaultImpl = AzureVmWorkloadProtectableItem.class) +@JsonTypeName("AzureVmWorkloadProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSapAseSystemProtectableItem.class), + @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSapHanaDatabaseProtectableItem.class), + @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSapHanaSystemProtectableItem.class), + @JsonSubTypes.Type( + name = "SQLAvailabilityGroupContainer", + value = AzureVmWorkloadSqlAvailabilityGroupProtectableItem.class), + @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSqlDatabaseProtectableItem.class), + @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSqlInstanceProtectableItem.class) +}) +@Fluent +public class AzureVmWorkloadProtectableItem extends WorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadProtectableItem.class); + + /* + * Name for instance or AG + */ + @JsonProperty(value = "parentName") + private String parentName; + + /* + * Parent Unique Name is added to provide the service formatted URI Name of + * the Parent + * Only Applicable for data bases where the parent would be either Instance + * or a SQL AG. + */ + @JsonProperty(value = "parentUniqueName") + private String parentUniqueName; + + /* + * Host/Cluster Name for instance or AG + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Indicates if protectable item is auto-protectable + */ + @JsonProperty(value = "isAutoProtectable") + private Boolean isAutoProtectable; + + /* + * Indicates if protectable item is auto-protected + */ + @JsonProperty(value = "isAutoProtected") + private Boolean isAutoProtected; + + /* + * For instance or AG, indicates number of DB's present + */ + @JsonProperty(value = "subinquireditemcount") + private Integer subinquireditemcount; + + /* + * For instance or AG, indicates number of DB's to be protected + */ + @JsonProperty(value = "subprotectableitemcount") + private Integer subprotectableitemcount; + + /* + * Pre-backup validation for protectable objects + */ + @JsonProperty(value = "prebackupvalidation") + private PreBackupValidation prebackupvalidation; + + /** + * Get the parentName property: Name for instance or AG. + * + * @return the parentName value. + */ + public String parentName() { + return this.parentName; + } + + /** + * Set the parentName property: Name for instance or AG. + * + * @param parentName the parentName value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get the parentUniqueName property: Parent Unique Name is added to provide the service formatted URI Name of the + * Parent Only Applicable for data bases where the parent would be either Instance or a SQL AG. + * + * @return the parentUniqueName value. + */ + public String parentUniqueName() { + return this.parentUniqueName; + } + + /** + * Set the parentUniqueName property: Parent Unique Name is added to provide the service formatted URI Name of the + * Parent Only Applicable for data bases where the parent would be either Instance or a SQL AG. + * + * @param parentUniqueName the parentUniqueName value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withParentUniqueName(String parentUniqueName) { + this.parentUniqueName = parentUniqueName; + return this; + } + + /** + * Get the serverName property: Host/Cluster Name for instance or AG. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the isAutoProtectable property: Indicates if protectable item is auto-protectable. + * + * @return the isAutoProtectable value. + */ + public Boolean isAutoProtectable() { + return this.isAutoProtectable; + } + + /** + * Set the isAutoProtectable property: Indicates if protectable item is auto-protectable. + * + * @param isAutoProtectable the isAutoProtectable value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + this.isAutoProtectable = isAutoProtectable; + return this; + } + + /** + * Get the isAutoProtected property: Indicates if protectable item is auto-protected. + * + * @return the isAutoProtected value. + */ + public Boolean isAutoProtected() { + return this.isAutoProtected; + } + + /** + * Set the isAutoProtected property: Indicates if protectable item is auto-protected. + * + * @param isAutoProtected the isAutoProtected value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + this.isAutoProtected = isAutoProtected; + return this; + } + + /** + * Get the subinquireditemcount property: For instance or AG, indicates number of DB's present. + * + * @return the subinquireditemcount value. + */ + public Integer subinquireditemcount() { + return this.subinquireditemcount; + } + + /** + * Set the subinquireditemcount property: For instance or AG, indicates number of DB's present. + * + * @param subinquireditemcount the subinquireditemcount value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + this.subinquireditemcount = subinquireditemcount; + return this; + } + + /** + * Get the subprotectableitemcount property: For instance or AG, indicates number of DB's to be protected. + * + * @return the subprotectableitemcount value. + */ + public Integer subprotectableitemcount() { + return this.subprotectableitemcount; + } + + /** + * Set the subprotectableitemcount property: For instance or AG, indicates number of DB's to be protected. + * + * @param subprotectableitemcount the subprotectableitemcount value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + this.subprotectableitemcount = subprotectableitemcount; + return this; + } + + /** + * Get the prebackupvalidation property: Pre-backup validation for protectable objects. + * + * @return the prebackupvalidation value. + */ + public PreBackupValidation prebackupvalidation() { + return this.prebackupvalidation; + } + + /** + * Set the prebackupvalidation property: Pre-backup validation for protectable objects. + * + * @param prebackupvalidation the prebackupvalidation value to set. + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { + this.prebackupvalidation = prebackupvalidation; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (prebackupvalidation() != null) { + prebackupvalidation().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java new file mode 100644 index 0000000000000..71065f0108ce7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure VM workload-specific protected item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectedItemType", + defaultImpl = AzureVmWorkloadProtectedItem.class) +@JsonTypeName("AzureVmWorkloadProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureVmWorkloadSAPAseDatabase", + value = AzureVmWorkloadSapAseDatabaseProtectedItem.class), + @JsonSubTypes.Type( + name = "AzureVmWorkloadSAPHanaDatabase", + value = AzureVmWorkloadSapHanaDatabaseProtectedItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadSQLDatabase", value = AzureVmWorkloadSqlDatabaseProtectedItem.class) +}) +@Fluent +public class AzureVmWorkloadProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadProtectedItem.class); + + /* + * Friendly name of the DB represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Host/Cluster Name for instance or AG + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Parent name of the DB such as Instance or Availability Group. + */ + @JsonProperty(value = "parentName") + private String parentName; + + /* + * Parent type of protected item, example: for a DB, standalone server or + * distributed + */ + @JsonProperty(value = "parentType") + private String parentType; + + /* + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /* + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + @JsonProperty(value = "lastBackupStatus") + private LastBackupStatus lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private OffsetDateTime lastBackupTime; + + /* + * Error details in last backup + */ + @JsonProperty(value = "lastBackupErrorDetail") + private ErrorDetail lastBackupErrorDetail; + + /* + * Data ID of the protected item. + */ + @JsonProperty(value = "protectedItemDataSourceId") + private String protectedItemDataSourceId; + + /* + * Health status of the backup item, evaluated based on last heartbeat + * received + */ + @JsonProperty(value = "protectedItemHealthStatus") + private ProtectedItemHealthStatus protectedItemHealthStatus; + + /* + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureVmWorkloadProtectedItemExtendedInfo extendedInfo; + + /* + * Health details of different KPIs + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /** + * Get the friendlyName property: Friendly name of the DB represented by this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the DB represented by this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the serverName property: Host/Cluster Name for instance or AG. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the parentName property: Parent name of the DB such as Instance or Availability Group. + * + * @return the parentName value. + */ + public String parentName() { + return this.parentName; + } + + /** + * Set the parentName property: Parent name of the DB such as Instance or Availability Group. + * + * @param parentName the parentName value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. + * + * @return the parentType value. + */ + public String parentType() { + return this.parentType; + } + + /** + * Set the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. + * + * @param parentType the parentType value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withParentType(String parentType) { + this.parentType = parentType; + return this; + } + + /** + * Get the protectionStatus property: Backup status of this backup item. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value. + */ + public LastBackupStatus lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the lastBackupErrorDetail property: Error details in last backup. + * + * @return the lastBackupErrorDetail value. + */ + public ErrorDetail lastBackupErrorDetail() { + return this.lastBackupErrorDetail; + } + + /** + * Set the lastBackupErrorDetail property: Error details in last backup. + * + * @param lastBackupErrorDetail the lastBackupErrorDetail value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + this.lastBackupErrorDetail = lastBackupErrorDetail; + return this; + } + + /** + * Get the protectedItemDataSourceId property: Data ID of the protected item. + * + * @return the protectedItemDataSourceId value. + */ + public String protectedItemDataSourceId() { + return this.protectedItemDataSourceId; + } + + /** + * Set the protectedItemDataSourceId property: Data ID of the protected item. + * + * @param protectedItemDataSourceId the protectedItemDataSourceId value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + this.protectedItemDataSourceId = protectedItemDataSourceId; + return this; + } + + /** + * Get the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat + * received. + * + * @return the protectedItemHealthStatus value. + */ + public ProtectedItemHealthStatus protectedItemHealthStatus() { + return this.protectedItemHealthStatus; + } + + /** + * Set the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat + * received. + * + * @param protectedItemHealthStatus the protectedItemHealthStatus value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectedItemHealthStatus( + ProtectedItemHealthStatus protectedItemHealthStatus) { + this.protectedItemHealthStatus = protectedItemHealthStatus; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this backup item. + * + * @return the extendedInfo value. + */ + public AzureVmWorkloadProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the kpisHealths property: Health details of different KPIs. + * + * @return the kpisHealths value. + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set the kpisHealths property: Health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set. + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (lastBackupErrorDetail() != null) { + lastBackupErrorDetail().validate(); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + if (kpisHealths() != null) { + kpisHealths() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..5c0d71812363b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information on Azure Workload for SQL specific backup item. */ +@Fluent +public final class AzureVmWorkloadProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadProtectedItemExtendedInfo.class); + + /* + * The oldest backup copy available for this backup item. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies available for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /* + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: The oldest backup copy available for this backup item. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: Number of backup copies available for this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set. + * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java new file mode 100644 index 0000000000000..293d2dc197e7e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM (Mercury) workload-specific backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureWorkload") +@Fluent +public final class AzureVmWorkloadProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadProtectionPolicy.class); + + /* + * Type of workload for the backup management + */ + @JsonProperty(value = "workLoadType") + private WorkloadType workLoadType; + + /* + * Common settings for the backup management + */ + @JsonProperty(value = "settings") + private Settings settings; + + /* + * List of sub-protection policies which includes schedule and retention + */ + @JsonProperty(value = "subProtectionPolicy") + private List subProtectionPolicy; + + /* + * Fix the policy inconsistency + */ + @JsonProperty(value = "makePolicyConsistent") + private Boolean makePolicyConsistent; + + /** + * Get the workLoadType property: Type of workload for the backup management. + * + * @return the workLoadType value. + */ + public WorkloadType workLoadType() { + return this.workLoadType; + } + + /** + * Set the workLoadType property: Type of workload for the backup management. + * + * @param workLoadType the workLoadType value to set. + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { + this.workLoadType = workLoadType; + return this; + } + + /** + * Get the settings property: Common settings for the backup management. + * + * @return the settings value. + */ + public Settings settings() { + return this.settings; + } + + /** + * Set the settings property: Common settings for the backup management. + * + * @param settings the settings value to set. + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withSettings(Settings settings) { + this.settings = settings; + return this; + } + + /** + * Get the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. + * + * @return the subProtectionPolicy value. + */ + public List subProtectionPolicy() { + return this.subProtectionPolicy; + } + + /** + * Set the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. + * + * @param subProtectionPolicy the subProtectionPolicy value to set. + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { + this.subProtectionPolicy = subProtectionPolicy; + return this; + } + + /** + * Get the makePolicyConsistent property: Fix the policy inconsistency. + * + * @return the makePolicyConsistent value. + */ + public Boolean makePolicyConsistent() { + return this.makePolicyConsistent; + } + + /** + * Set the makePolicyConsistent property: Fix the policy inconsistency. + * + * @param makePolicyConsistent the makePolicyConsistent value to set. + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withMakePolicyConsistent(Boolean makePolicyConsistent) { + this.makePolicyConsistent = makePolicyConsistent; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (settings() != null) { + settings().validate(); + } + if (subProtectionPolicy() != null) { + subProtectionPolicy().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java new file mode 100644 index 0000000000000..56d88f866b833 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure VM workload-specific protected item representing SAP ASE Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureVmWorkloadSAPAseDatabase") +@Immutable +public final class AzureVmWorkloadSapAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseDatabaseProtectedItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withParentType(String parentType) { + super.withParentType(parentType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + super.withLastBackupStatus(lastBackupStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + super.withLastBackupTime(lastBackupTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + super.withLastBackupErrorDetail(lastBackupErrorDetail); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + super.withProtectedItemDataSourceId(protectedItemDataSourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectedItemHealthStatus( + ProtectedItemHealthStatus protectedItemHealthStatus) { + super.withProtectedItemHealthStatus(protectedItemHealthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withExtendedInfo( + AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withKpisHealths( + Map kpisHealths) { + super.withKpisHealths(kpisHealths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withBackupManagementType( + BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withDeferredDeleteTimeInUtc( + OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withIsScheduledForDeferredDelete( + Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withDeferredDeleteTimeRemaining( + String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..3fae85ec33d39 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SAP ASE Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SAPAseDatabase") +@Immutable +public final class AzureVmWorkloadSapAseDatabaseWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseDatabaseWorkloadItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseDatabaseWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java new file mode 100644 index 0000000000000..073c1ba992bcf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SAP ASE System. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SAPAseSystem") +@Immutable +public final class AzureVmWorkloadSapAseSystemProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseSystemProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java new file mode 100644 index 0000000000000..a70107765b824 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SAP ASE System. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SAPAseSystem") +@Immutable +public final class AzureVmWorkloadSapAseSystemWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapAseSystemWorkloadItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapAseSystemWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java new file mode 100644 index 0000000000000..48f7399a79ccc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.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.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SAP HANA Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SAPHanaDatabase") +@Immutable +public final class AzureVmWorkloadSapHanaDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withPrebackupvalidation( + PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java new file mode 100644 index 0000000000000..d735fd1a1a340 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure VM workload-specific protected item representing SAP HANA Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureVmWorkloadSAPHanaDatabase") +@Immutable +public final class AzureVmWorkloadSapHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseProtectedItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withParentType(String parentType) { + super.withParentType(parentType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + super.withLastBackupStatus(lastBackupStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + super.withLastBackupTime(lastBackupTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + super.withLastBackupErrorDetail(lastBackupErrorDetail); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + super.withProtectedItemDataSourceId(protectedItemDataSourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectedItemHealthStatus( + ProtectedItemHealthStatus protectedItemHealthStatus) { + super.withProtectedItemHealthStatus(protectedItemHealthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withExtendedInfo( + AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withKpisHealths( + Map kpisHealths) { + super.withKpisHealths(kpisHealths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withBackupManagementType( + BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withDeferredDeleteTimeInUtc( + OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsScheduledForDeferredDelete( + Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withDeferredDeleteTimeRemaining( + String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..415f05bcb1b2d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SAP HANA Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SAPHanaDatabase") +@Immutable +public final class AzureVmWorkloadSapHanaDatabaseWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaDatabaseWorkloadItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaDatabaseWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java new file mode 100644 index 0000000000000..34b37f4a78e6b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SAP HANA System. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SAPHanaSystem") +@Immutable +public final class AzureVmWorkloadSapHanaSystemProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaSystemProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withPrebackupvalidation( + PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java new file mode 100644 index 0000000000000..ed88d8387ba3f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SAP HANA System. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SAPHanaSystem") +@Immutable +public final class AzureVmWorkloadSapHanaSystemWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSapHanaSystemWorkloadItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSapHanaSystemWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java new file mode 100644 index 0000000000000..c5ca597c91524 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.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.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SQL Availability Group. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SQLAvailabilityGroupContainer") +@Immutable +public final class AzureVmWorkloadSqlAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlAvailabilityGroupProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withSubprotectableitemcount( + Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withPrebackupvalidation( + PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlAvailabilityGroupProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java new file mode 100644 index 0000000000000..c44d77c423658 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SQL Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SQLDataBase") +@Immutable +public final class AzureVmWorkloadSqlDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java new file mode 100644 index 0000000000000..ab387db5ca6dd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Azure VM workload-specific protected item representing SQL Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureVmWorkloadSQLDatabase") +@Immutable +public final class AzureVmWorkloadSqlDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseProtectedItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withParentType(String parentType) { + super.withParentType(parentType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withProtectionStatus(String protectionStatus) { + super.withProtectionStatus(protectionStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + super.withLastBackupStatus(lastBackupStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + super.withLastBackupTime(lastBackupTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + super.withLastBackupErrorDetail(lastBackupErrorDetail); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + super.withProtectedItemDataSourceId(protectedItemDataSourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withProtectedItemHealthStatus( + ProtectedItemHealthStatus protectedItemHealthStatus) { + super.withProtectedItemHealthStatus(protectedItemHealthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withExtendedInfo( + AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withKpisHealths(Map kpisHealths) { + super.withKpisHealths(kpisHealths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withIsScheduledForDeferredDelete( + Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withIsDeferredDeleteScheduleUpcoming( + Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..2d03b59e6c7e8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SQL Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SQLDataBase") +@Immutable +public final class AzureVmWorkloadSqlDatabaseWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlDatabaseWorkloadItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlDatabaseWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java new file mode 100644 index 0000000000000..bc6c1c961fbd3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific protectable item representing SQL Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("SQLInstance") +@Immutable +public final class AzureVmWorkloadSqlInstanceProtectableItem extends AzureVmWorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlInstanceProtectableItem.class); + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withParentUniqueName(String parentUniqueName) { + super.withParentUniqueName(parentUniqueName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + super.withIsAutoProtected(isAutoProtected); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + super.withSubprotectableitemcount(subprotectableitemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { + super.withPrebackupvalidation(prebackupvalidation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java new file mode 100644 index 0000000000000..52eada22e8d1d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM workload-specific workload item representing SQL Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType") +@JsonTypeName("SQLInstance") +@Fluent +public final class AzureVmWorkloadSqlInstanceWorkloadItem extends AzureVmWorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureVmWorkloadSqlInstanceWorkloadItem.class); + + /* + * Data Directory Paths for default directories + */ + @JsonProperty(value = "dataDirectoryPaths") + private List dataDirectoryPaths; + + /** + * Get the dataDirectoryPaths property: Data Directory Paths for default directories. + * + * @return the dataDirectoryPaths value. + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + + /** + * Set the dataDirectoryPaths property: Data Directory Paths for default directories. + * + * @param dataDirectoryPaths the dataDirectoryPaths value to set. + * @return the AzureVmWorkloadSqlInstanceWorkloadItem object itself. + */ + public AzureVmWorkloadSqlInstanceWorkloadItem withDataDirectoryPaths(List dataDirectoryPaths) { + this.dataDirectoryPaths = dataDirectoryPaths; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withParentName(String parentName) { + super.withParentName(parentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withServerName(String serverName) { + super.withServerName(serverName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + super.withIsAutoProtectable(isAutoProtectable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + super.withSubinquireditemcount(subinquireditemcount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + super.withSubWorkloadItemCount(subWorkloadItemCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureVmWorkloadSqlInstanceWorkloadItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataDirectoryPaths() != null) { + dataDirectoryPaths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java new file mode 100644 index 0000000000000..58dae49bf9225 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure Recovery Services Vault specific protection intent item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType") +@JsonTypeName("AzureWorkloadAutoProtectionIntent") +@Immutable +public final class AzureWorkloadAutoProtectionIntent extends ProtectionIntent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadAutoProtectionIntent.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadAutoProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadAutoProtectionIntent withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadAutoProtectionIntent withItemId(String itemId) { + super.withItemId(itemId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadAutoProtectionIntent withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadAutoProtectionIntent withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java new file mode 100644 index 0000000000000..9e25119bab7ca --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** AzureWorkload workload-specific backup request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadBackupRequest") +@Fluent +public final class AzureWorkloadBackupRequest extends BackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadBackupRequest.class); + + /* + * Type of backup, viz. Full, Differential, Log or CopyOnlyFull + */ + @JsonProperty(value = "backupType") + private BackupType backupType; + + /* + * Bool for Compression setting + */ + @JsonProperty(value = "enableCompression") + private Boolean enableCompression; + + /* + * Backup copy will expire after the time specified (UTC). + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private OffsetDateTime recoveryPointExpiryTimeInUtc; + + /** + * Get the backupType property: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. + * + * @return the backupType value. + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Set the backupType property: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. + * + * @param backupType the backupType value to set. + * @return the AzureWorkloadBackupRequest object itself. + */ + public AzureWorkloadBackupRequest withBackupType(BackupType backupType) { + this.backupType = backupType; + return this; + } + + /** + * Get the enableCompression property: Bool for Compression setting. + * + * @return the enableCompression value. + */ + public Boolean enableCompression() { + return this.enableCompression; + } + + /** + * Set the enableCompression property: Bool for Compression setting. + * + * @param enableCompression the enableCompression value to set. + * @return the AzureWorkloadBackupRequest object itself. + */ + public AzureWorkloadBackupRequest withEnableCompression(Boolean enableCompression) { + this.enableCompression = enableCompression; + return this; + } + + /** + * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @return the recoveryPointExpiryTimeInUtc value. + */ + public OffsetDateTime recoveryPointExpiryTimeInUtc() { + return this.recoveryPointExpiryTimeInUtc; + } + + /** + * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. + * @return the AzureWorkloadBackupRequest object itself. + */ + public AzureWorkloadBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { + this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java new file mode 100644 index 0000000000000..0faa8b4ac3ddd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Container for the workloads running inside Azure Compute or Classic Compute. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "containerType", + defaultImpl = AzureWorkloadContainer.class) +@JsonTypeName("AzureWorkloadContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SQLAGWorkLoadContainer", value = AzureSqlagWorkloadContainerProtectionContainer.class), + @JsonSubTypes.Type(name = "VMAppContainer", value = AzureVMAppContainerProtectionContainer.class) +}) +@Fluent +public class AzureWorkloadContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadContainer.class); + + /* + * ARM ID of the virtual machine represented by this Azure Workload + * Container + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * Time stamp when this container was updated. + */ + @JsonProperty(value = "lastUpdatedTime") + private OffsetDateTime lastUpdatedTime; + + /* + * Additional details of a workload container. + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadContainerExtendedInfo extendedInfo; + + /* + * Workload type for which registration was sent. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /* + * Re-Do Operation + */ + @JsonProperty(value = "operationType") + private OperationType operationType; + + /** + * Get the sourceResourceId property: ARM ID of the virtual machine represented by this Azure Workload Container. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: ARM ID of the virtual machine represented by this Azure Workload Container. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the lastUpdatedTime property: Time stamp when this container was updated. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: Time stamp when this container was updated. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the extendedInfo property: Additional details of a workload container. + * + * @return the extendedInfo value. + */ + public AzureWorkloadContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional details of a workload container. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the workloadType property: Workload type for which registration was sent. + * + * @return the workloadType value. + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Workload type for which registration was sent. + * + * @param workloadType the workloadType value to set. + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the operationType property: Re-Do Operation. + * + * @return the operationType value. + */ + public OperationType operationType() { + return this.operationType; + } + + /** + * Set the operationType property: Re-Do Operation. + * + * @param operationType the operationType value to set. + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withOperationType(OperationType operationType) { + this.operationType = operationType; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java new file mode 100644 index 0000000000000..e25691e76dd0e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.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.recoveryservicesbackup.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; + +/** Extended information of the container. */ +@Fluent +public final class AzureWorkloadContainerExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadContainerExtendedInfo.class); + + /* + * Host Os Name in case of Stand Alone and Cluster Name in case of + * distributed container. + */ + @JsonProperty(value = "hostServerName") + private String hostServerName; + + /* + * Inquiry Status for the container. + */ + @JsonProperty(value = "inquiryInfo") + private InquiryInfo inquiryInfo; + + /* + * List of the nodes in case of distributed container. + */ + @JsonProperty(value = "nodesList") + private List nodesList; + + /** + * Get the hostServerName property: Host Os Name in case of Stand Alone and Cluster Name in case of distributed + * container. + * + * @return the hostServerName value. + */ + public String hostServerName() { + return this.hostServerName; + } + + /** + * Set the hostServerName property: Host Os Name in case of Stand Alone and Cluster Name in case of distributed + * container. + * + * @param hostServerName the hostServerName value to set. + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withHostServerName(String hostServerName) { + this.hostServerName = hostServerName; + return this; + } + + /** + * Get the inquiryInfo property: Inquiry Status for the container. + * + * @return the inquiryInfo value. + */ + public InquiryInfo inquiryInfo() { + return this.inquiryInfo; + } + + /** + * Set the inquiryInfo property: Inquiry Status for the container. + * + * @param inquiryInfo the inquiryInfo value to set. + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withInquiryInfo(InquiryInfo inquiryInfo) { + this.inquiryInfo = inquiryInfo; + return this; + } + + /** + * Get the nodesList property: List of the nodes in case of distributed container. + * + * @return the nodesList value. + */ + public List nodesList() { + return this.nodesList; + } + + /** + * Set the nodesList property: List of the nodes in case of distributed container. + * + * @param nodesList the nodesList value to set. + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withNodesList(List nodesList) { + this.nodesList = nodesList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inquiryInfo() != null) { + inquiryInfo().validate(); + } + if (nodesList() != null) { + nodesList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java new file mode 100644 index 0000000000000..ad50647c32d0c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure storage specific error information. */ +@Fluent +public final class AzureWorkloadErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadErrorInfo.class); + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /* + * Title: Typically, the entity that the error pertains to. + */ + @JsonProperty(value = "errorTitle") + private String errorTitle; + + /* + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /* + * Additional details for above error code. + */ + @JsonProperty(value = "additionalDetails") + private String additionalDetails; + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Set the errorString property: Localized error string. + * + * @param errorString the errorString value to set. + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get the errorTitle property: Title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value. + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Set the errorTitle property: Title: Typically, the entity that the error pertains to. + * + * @param errorTitle the errorTitle value to set. + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorTitle(String errorTitle) { + this.errorTitle = errorTitle; + return this; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: List of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set. + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Get the additionalDetails property: Additional details for above error code. + * + * @return the additionalDetails value. + */ + public String additionalDetails() { + return this.additionalDetails; + } + + /** + * Set the additionalDetails property: Additional details for above error code. + * + * @param additionalDetails the additionalDetails value to set. + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withAdditionalDetails(String additionalDetails) { + this.additionalDetails = additionalDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java new file mode 100644 index 0000000000000..dbc5ab8f5d696 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Azure storage specific job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("AzureWorkloadJob") +@Fluent +public final class AzureWorkloadJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadJob.class); + + /* + * Workload type of the job + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Additional information about the job. + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadJobExtendedInfo extendedInfo; + + /** + * Get the workloadType property: Workload type of the job. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Workload type of the job. + * + * @param workloadType the workloadType value to set. + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details on execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the extendedInfo property: Additional information about the job. + * + * @return the extendedInfo value. + */ + public AzureWorkloadJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information about the job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withExtendedInfo(AzureWorkloadJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java new file mode 100644 index 0000000000000..f22cc1dedc852 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure VM workload-specific additional information for job. */ +@Fluent +public final class AzureWorkloadJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadJobExtendedInfo.class); + + /* + * List of tasks for this job + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /* + * Job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set the tasksList property: List of tasks for this job. + * + * @param tasksList the tasksList value to set. + * @return the AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set the dynamicErrorMessage property: Non localized error message on job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set. + * @return the AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasksList() != null) { + tasksList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java new file mode 100644 index 0000000000000..fc6cd2320b7d8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure VM workload specific job task details. */ +@Fluent +public final class AzureWorkloadJobTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadJobTaskDetails.class); + + /* + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The task display name. + * + * @param taskId the taskId value to set. + * @return the AzureWorkloadJobTaskDetails object itself. + */ + public AzureWorkloadJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status. + * + * @param status the status value to set. + * @return the AzureWorkloadJobTaskDetails object itself. + */ + public AzureWorkloadJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java new file mode 100644 index 0000000000000..736fa7e319269 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadPointInTimeRecoveryPoint.class) +@JsonTypeName("AzureWorkloadPointInTimeRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint", + value = AzureWorkloadSapHanaPointInTimeRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadPointInTimeRecoveryPoint extends AzureWorkloadRecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadPointInTimeRecoveryPoint.class); + + /* + * List of log ranges + */ + @JsonProperty(value = "timeRanges") + private List timeRanges; + + /** + * Get the timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: List of log ranges. + * + * @param timeRanges the timeRanges value to set. + * @return the AzureWorkloadPointInTimeRecoveryPoint object itself. + */ + public AzureWorkloadPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { + super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPoint withType(RestorePointType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java new file mode 100644 index 0000000000000..ba705e72171d4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPointAutoGenerated.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class) +@JsonTypeName("AzureWorkloadPointInTimeRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint", + value = AzureWorkloadSAPHanaPointInTimeRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadPointInTimeRecoveryPointAutoGenerated extends AzureWorkloadRecoveryPointAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class); + + /* + * List of log ranges + */ + @JsonProperty(value = "timeRanges") + private List timeRanges; + + /** + * Get the timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: List of log ranges. + * + * @param timeRanges the timeRanges value to set. + * @return the AzureWorkloadPointInTimeRecoveryPointAutoGenerated object itself. + */ + public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..0ea80d73336c0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadPointInTimeRestoreRequest") +@Fluent +public final class AzureWorkloadPointInTimeRestoreRequest extends AzureWorkloadRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadPointInTimeRestoreRequest.class); + + /* + * PointInTime value + */ + @JsonProperty(value = "pointInTime") + private OffsetDateTime pointInTime; + + /** + * Get the pointInTime property: PointInTime value. + * + * @return the pointInTime value. + */ + public OffsetDateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set the pointInTime property: PointInTime value. + * + * @param pointInTime the pointInTime value to set. + * @return the AzureWorkloadPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java new file mode 100644 index 0000000000000..409df3c3b381a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Workload specific recovery point, specifically encapsulates full/diff recovery point. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadRecoveryPoint.class) +@JsonTypeName("AzureWorkloadRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadPointInTimeRecoveryPoint", + value = AzureWorkloadPointInTimeRecoveryPoint.class), + @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRecoveryPoint", value = AzureWorkloadSapHanaRecoveryPoint.class), + @JsonSubTypes.Type(name = "AzureWorkloadSQLRecoveryPoint", value = AzureWorkloadSqlRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadRecoveryPoint extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadRecoveryPoint.class); + + /* + * UTC time at which recovery point was created + */ + @JsonProperty(value = "recoveryPointTimeInUTC") + private OffsetDateTime recoveryPointTimeInUtc; + + /* + * Type of restore point + */ + @JsonProperty(value = "type") + private RestorePointType type; + + /* + * Recovery point tier information. + */ + @JsonProperty(value = "recoveryPointTierDetails") + private List recoveryPointTierDetails; + + /* + * Eligibility of RP to be moved to another tier + */ + @JsonProperty(value = "recoveryPointMoveReadinessInfo") + private Map recoveryPointMoveReadinessInfo; + + /** + * Get the recoveryPointTimeInUtc property: UTC time at which recovery point was created. + * + * @return the recoveryPointTimeInUtc value. + */ + public OffsetDateTime recoveryPointTimeInUtc() { + return this.recoveryPointTimeInUtc; + } + + /** + * Set the recoveryPointTimeInUtc property: UTC time at which recovery point was created. + * + * @param recoveryPointTimeInUtc the recoveryPointTimeInUtc value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + public AzureWorkloadRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { + this.recoveryPointTimeInUtc = recoveryPointTimeInUtc; + return this; + } + + /** + * Get the type property: Type of restore point. + * + * @return the type value. + */ + public RestorePointType type() { + return this.type; + } + + /** + * Set the type property: Type of restore point. + * + * @param type the type value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + public AzureWorkloadRecoveryPoint withType(RestorePointType type) { + this.type = type; + return this; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set the recoveryPointTierDetails property: Recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + public AzureWorkloadRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. + * @return the AzureWorkloadRecoveryPoint object itself. + */ + public AzureWorkloadRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointTierDetails() != null) { + recoveryPointTierDetails().forEach(e -> e.validate()); + } + if (recoveryPointMoveReadinessInfo() != null) { + recoveryPointMoveReadinessInfo() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java new file mode 100644 index 0000000000000..659c60460f93c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPointAutoGenerated.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Workload specific recovery point, specifically encapsulates full/diff recovery point. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadRecoveryPointAutoGenerated.class) +@JsonTypeName("AzureWorkloadRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadPointInTimeRecoveryPoint", + value = AzureWorkloadPointInTimeRecoveryPointAutoGenerated.class), + @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRecoveryPoint", value = AzureWorkloadSAPHanaRecoveryPoint.class), + @JsonSubTypes.Type(name = "AzureWorkloadSQLRecoveryPoint", value = AzureWorkloadSQLRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadRecoveryPointAutoGenerated extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadRecoveryPointAutoGenerated.class); + + /* + * UTC time at which recovery point was created + */ + @JsonProperty(value = "recoveryPointTimeInUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime recoveryPointTimeInUtc; + + /* + * Type of restore point + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private RestorePointType type; + + /* + * Recovery point tier information. + */ + @JsonProperty(value = "recoveryPointTierDetails") + private List recoveryPointTierDetails; + + /* + * Eligibility of RP to be moved to another tier + */ + @JsonProperty(value = "recoveryPointMoveReadinessInfo") + private Map recoveryPointMoveReadinessInfo; + + /** + * Get the recoveryPointTimeInUtc property: UTC time at which recovery point was created. + * + * @return the recoveryPointTimeInUtc value. + */ + public OffsetDateTime recoveryPointTimeInUtc() { + return this.recoveryPointTimeInUtc; + } + + /** + * Get the type property: Type of restore point. + * + * @return the type value. + */ + public RestorePointType type() { + return this.type; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set the recoveryPointTierDetails property: Recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. + * @return the AzureWorkloadRecoveryPointAutoGenerated object itself. + */ + public AzureWorkloadRecoveryPointAutoGenerated withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. + * @return the AzureWorkloadRecoveryPointAutoGenerated object itself. + */ + public AzureWorkloadRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointTierDetails() != null) { + recoveryPointTierDetails().forEach(e -> e.validate()); + } + if (recoveryPointMoveReadinessInfo() != null) { + recoveryPointMoveReadinessInfo() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java new file mode 100644 index 0000000000000..eed654ce963c1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** AzureWorkload-specific restore. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadRestoreRequest.class) +@JsonTypeName("AzureWorkloadRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadPointInTimeRestoreRequest", + value = AzureWorkloadPointInTimeRestoreRequest.class), + @JsonSubTypes.Type( + name = "AzureWorkloadSAPHanaPointInTimeRestoreRequest", + value = AzureWorkloadSapHanaPointInTimeRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRestoreRequest", value = AzureWorkloadSapHanaRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadSQLRestoreRequest", value = AzureWorkloadSqlRestoreRequest.class), + @JsonSubTypes.Type( + name = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest", + value = AzureWorkloadSapHanaRestoreWithRehydrateRequest.class) +}) +@Fluent +public class AzureWorkloadRestoreRequest extends RestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadRestoreRequest.class); + + /* + * Type of this recovery. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /* + * Fully qualified ARM ID of the VM on which workload that was running is + * being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * Workload specific property bag. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Details of target database + */ + @JsonProperty(value = "targetInfo") + private TargetRestoreInfo targetInfo; + + /* + * Defines whether the current recovery mode is file restore or database + * restore + */ + @JsonProperty(value = "recoveryMode") + private RecoveryMode recoveryMode; + + /** + * Get the recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being + * recovered. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being + * recovered. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the propertyBag property: Workload specific property bag. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Workload specific property bag. + * + * @param propertyBag the propertyBag value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the targetInfo property: Details of target database. + * + * @return the targetInfo value. + */ + public TargetRestoreInfo targetInfo() { + return this.targetInfo; + } + + /** + * Set the targetInfo property: Details of target database. + * + * @param targetInfo the targetInfo value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + this.targetInfo = targetInfo; + return this; + } + + /** + * Get the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. + * + * @return the recoveryMode value. + */ + public RecoveryMode recoveryMode() { + return this.recoveryMode; + } + + /** + * Set the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. + * + * @param recoveryMode the recoveryMode value to set. + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + this.recoveryMode = recoveryMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetInfo() != null) { + targetInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.java new file mode 100644 index 0000000000000..f683b147376a9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime in SAPHana. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRecoveryPoint") +@Immutable +public final class AzureWorkloadSAPHanaPointInTimeRecoveryPoint + extends AzureWorkloadPointInTimeRecoveryPointAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadSAPHanaPointInTimeRecoveryPoint.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + super.withTimeRanges(timeRanges); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaRecoveryPoint.java new file mode 100644 index 0000000000000..c60e4e432f15c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSAPHanaRecoveryPoint.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaRecoveryPoint") +@Immutable +public final class AzureWorkloadSAPHanaRecoveryPoint extends AzureWorkloadRecoveryPointAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSAPHanaRecoveryPoint.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSAPHanaRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSAPHanaRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java new file mode 100644 index 0000000000000..98a6a658202b4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLPointInTimeRecoveryPoint.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSQLPointInTimeRecoveryPoint") +@Fluent +public final class AzureWorkloadSQLPointInTimeRecoveryPoint extends AzureWorkloadSQLRecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSQLPointInTimeRecoveryPoint.class); + + /* + * List of log ranges + */ + @JsonProperty(value = "timeRanges") + private List timeRanges; + + /** + * Get the timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: List of log ranges. + * + * @param timeRanges the timeRanges value to set. + * @return the AzureWorkloadSQLPointInTimeRecoveryPoint object itself. + */ + public AzureWorkloadSQLPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSQLPointInTimeRecoveryPoint withExtendedInfo( + AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSQLPointInTimeRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSQLPointInTimeRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPoint.java new file mode 100644 index 0000000000000..01d30afb396f0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPoint.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadSQLRecoveryPoint.class) +@JsonTypeName("AzureWorkloadSQLRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSQLPointInTimeRecoveryPoint", + value = AzureWorkloadSQLPointInTimeRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadSQLRecoveryPoint extends AzureWorkloadRecoveryPointAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSQLRecoveryPoint.class); + + /* + * Extended Info that provides data directory details. Will be populated in + * two cases: + * When a specific recovery point is accessed using GetRecoveryPoint + * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo + * query filter + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo; + + /** + * Get the extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: When a specific recovery point is accessed using GetRecoveryPoint Or when ListRecoveryPoints is called for + * Log RP only with ExtendedInfo query filter. + * + * @return the extendedInfo value. + */ + public AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: When a specific recovery point is accessed using GetRecoveryPoint Or when ListRecoveryPoints is called for + * Log RP only with ExtendedInfo query filter. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureWorkloadSQLRecoveryPoint object itself. + */ + public AzureWorkloadSQLRecoveryPoint withExtendedInfo(AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSQLRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSQLRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPointExtendedInfo.java new file mode 100644 index 0000000000000..ca5209e3d7c1c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSQLRecoveryPointExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Extended info class details. */ +@Immutable +public final class AzureWorkloadSQLRecoveryPointExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSQLRecoveryPointExtendedInfo.class); + + /* + * UTC time at which data directory info was captured + */ + @JsonProperty(value = "dataDirectoryTimeInUTC", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime dataDirectoryTimeInUtc; + + /* + * List of data directory paths during restore operation. + */ + @JsonProperty(value = "dataDirectoryPaths", access = JsonProperty.Access.WRITE_ONLY) + private List dataDirectoryPaths; + + /** + * Get the dataDirectoryTimeInUtc property: UTC time at which data directory info was captured. + * + * @return the dataDirectoryTimeInUtc value. + */ + public OffsetDateTime dataDirectoryTimeInUtc() { + return this.dataDirectoryTimeInUtc; + } + + /** + * Get the dataDirectoryPaths property: List of data directory paths during restore operation. + * + * @return the dataDirectoryPaths value. + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDirectoryPaths() != null) { + dataDirectoryPaths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java new file mode 100644 index 0000000000000..4ace230d8253a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime in SAPHana. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRecoveryPoint") +@Immutable +public final class AzureWorkloadSapHanaPointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaPointInTimeRecoveryPoint.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + super.withTimeRanges(timeRanges); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRecoveryPoint withRecoveryPointTimeInUtc( + OffsetDateTime recoveryPointTimeInUtc) { + super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRecoveryPoint withType(RestorePointType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..f9e4693c78188 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadSapHanaPointInTimeRestoreRequest.class) +@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest", + value = AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.class) +}) +@Fluent +public class AzureWorkloadSapHanaPointInTimeRestoreRequest extends AzureWorkloadRestoreRequest { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaPointInTimeRestoreRequest.class); + + /* + * PointInTime value + */ + @JsonProperty(value = "pointInTime") + private OffsetDateTime pointInTime; + + /** + * Get the pointInTime property: PointInTime value. + * + * @return the pointInTime value. + */ + public OffsetDateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set the pointInTime property: PointInTime value. + * + * @param pointInTime the pointInTime value to set. + * @return the AzureWorkloadSapHanaPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSapHanaPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java new file mode 100644 index 0000000000000..03ace5b0f30f1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest") +@Fluent +public final class AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest + extends AzureWorkloadSapHanaPointInTimeRestoreRequest { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.class); + + /* + * RP Rehydration Info + */ + @JsonProperty(value = "recoveryPointRehydrationInfo") + private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; + + /** + * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @return the recoveryPointRehydrationInfo value. + */ + public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { + return this.recoveryPointRehydrationInfo; + } + + /** + * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. + * @return the AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest object itself. + */ + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryPointRehydrationInfo( + RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { + this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) { + super.withPointInTime(pointInTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointRehydrationInfo() != null) { + recoveryPointRehydrationInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java new file mode 100644 index 0000000000000..6e27f75870b27 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaRecoveryPoint") +@Immutable +public final class AzureWorkloadSapHanaRecoveryPoint extends AzureWorkloadRecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRecoveryPoint.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { + super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRecoveryPoint withType(RestorePointType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java new file mode 100644 index 0000000000000..ddb92c90dbeac --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** AzureWorkload SAP Hana-specific restore. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaRestoreRequest") +@Immutable +public final class AzureWorkloadSapHanaRestoreRequest extends AzureWorkloadRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRestoreRequest.class); + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java new file mode 100644 index 0000000000000..6093b51ecd3a5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.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.recoveryservicesbackup.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.Map; + +/** AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSAPHanaRestoreWithRehydrateRequest") +@Fluent +public final class AzureWorkloadSapHanaRestoreWithRehydrateRequest extends AzureWorkloadRestoreRequest { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadSapHanaRestoreWithRehydrateRequest.class); + + /* + * RP Rehydration Info + */ + @JsonProperty(value = "recoveryPointRehydrationInfo") + private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; + + /** + * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @return the recoveryPointRehydrationInfo value. + */ + public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { + return this.recoveryPointRehydrationInfo; + } + + /** + * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. + * @return the AzureWorkloadSapHanaRestoreWithRehydrateRequest object itself. + */ + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryPointRehydrationInfo( + RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { + this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointRehydrationInfo() != null) { + recoveryPointRehydrationInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java new file mode 100644 index 0000000000000..4381a2729bc9c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.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.recoveryservicesbackup.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; + +/** Azure Workload SQL Auto Protection intent item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType") +@JsonTypeName("AzureWorkloadSQLAutoProtectionIntent") +@Fluent +public final class AzureWorkloadSqlAutoProtectionIntent extends AzureRecoveryServiceVaultProtectionIntent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlAutoProtectionIntent.class); + + /* + * Workload item type of the item for which intent is to be set + */ + @JsonProperty(value = "workloadItemType") + private WorkloadItemType workloadItemType; + + /** + * Get the workloadItemType property: Workload item type of the item for which intent is to be set. + * + * @return the workloadItemType value. + */ + public WorkloadItemType workloadItemType() { + return this.workloadItemType; + } + + /** + * Set the workloadItemType property: Workload item type of the item for which intent is to be set. + * + * @param workloadItemType the workloadItemType value to set. + * @return the AzureWorkloadSqlAutoProtectionIntent object itself. + */ + public AzureWorkloadSqlAutoProtectionIntent withWorkloadItemType(WorkloadItemType workloadItemType) { + this.workloadItemType = workloadItemType; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlAutoProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlAutoProtectionIntent withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlAutoProtectionIntent withItemId(String itemId) { + super.withItemId(itemId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlAutoProtectionIntent withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlAutoProtectionIntent withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java new file mode 100644 index 0000000000000..cd631d27d7335 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Recovery point specific to PointInTime. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSQLPointInTimeRecoveryPoint") +@Fluent +public final class AzureWorkloadSqlPointInTimeRecoveryPoint extends AzureWorkloadSqlRecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlPointInTimeRecoveryPoint.class); + + /* + * List of log ranges + */ + @JsonProperty(value = "timeRanges") + private List timeRanges; + + /** + * Get the timeRanges property: List of log ranges. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: List of log ranges. + * + * @param timeRanges the timeRanges value to set. + * @return the AzureWorkloadSqlPointInTimeRecoveryPoint object itself. + */ + public AzureWorkloadSqlPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRecoveryPoint withExtendedInfo( + AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { + super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRecoveryPoint withType(RestorePointType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..e7fab2ebed2a9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadSqlPointInTimeRestoreRequest.class) +@JsonTypeName("AzureWorkloadSQLPointInTimeRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest", + value = AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.class) +}) +@Fluent +public class AzureWorkloadSqlPointInTimeRestoreRequest extends AzureWorkloadSqlRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlPointInTimeRestoreRequest.class); + + /* + * PointInTime value + */ + @JsonProperty(value = "pointInTime") + private OffsetDateTime pointInTime; + + /** + * Get the pointInTime property: PointInTime value. + * + * @return the pointInTime value. + */ + public OffsetDateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set the pointInTime property: PointInTime value. + * + * @param pointInTime the pointInTime value to set. + * @return the AzureWorkloadSqlPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSqlPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withShouldUseAlternateTargetLocation( + Boolean shouldUseAlternateTargetLocation) { + super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { + super.withIsNonRecoverable(isNonRecoverable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withAlternateDirectoryPaths( + List alternateDirectoryPaths) { + super.withAlternateDirectoryPaths(alternateDirectoryPaths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java new file mode 100644 index 0000000000000..0728ce4d2282e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** AzureWorkload SQL-specific restore with integrated rehydration of recovery point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest") +@Fluent +public final class AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest + extends AzureWorkloadSqlPointInTimeRestoreRequest { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.class); + + /* + * RP Rehydration Info + */ + @JsonProperty(value = "recoveryPointRehydrationInfo") + private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; + + /** + * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @return the recoveryPointRehydrationInfo value. + */ + public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { + return this.recoveryPointRehydrationInfo; + } + + /** + * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. + * @return the AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest object itself. + */ + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryPointRehydrationInfo( + RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { + this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) { + super.withPointInTime(pointInTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withShouldUseAlternateTargetLocation( + Boolean shouldUseAlternateTargetLocation) { + super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withIsNonRecoverable(Boolean isNonRecoverable) { + super.withIsNonRecoverable(isNonRecoverable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withAlternateDirectoryPaths( + List alternateDirectoryPaths) { + super.withAlternateDirectoryPaths(alternateDirectoryPaths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointRehydrationInfo() != null) { + recoveryPointRehydrationInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java new file mode 100644 index 0000000000000..f45110a318a60 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadSqlRecoveryPoint.class) +@JsonTypeName("AzureWorkloadSQLRecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSQLPointInTimeRecoveryPoint", + value = AzureWorkloadSqlPointInTimeRecoveryPoint.class) +}) +@Fluent +public class AzureWorkloadSqlRecoveryPoint extends AzureWorkloadRecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRecoveryPoint.class); + + /* + * Extended Info that provides data directory details. Will be populated in + * two cases: + * When a specific recovery point is accessed using GetRecoveryPoint + * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo + * query filter + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo; + + /** + * Get the extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: When a specific recovery point is accessed using GetRecoveryPoint Or when ListRecoveryPoints is called for + * Log RP only with ExtendedInfo query filter. + * + * @return the extendedInfo value. + */ + public AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended Info that provides data directory details. Will be populated in two + * cases: When a specific recovery point is accessed using GetRecoveryPoint Or when ListRecoveryPoints is called for + * Log RP only with ExtendedInfo query filter. + * + * @param extendedInfo the extendedInfo value to set. + * @return the AzureWorkloadSqlRecoveryPoint object itself. + */ + public AzureWorkloadSqlRecoveryPoint withExtendedInfo(AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { + super.withRecoveryPointTimeInUtc(recoveryPointTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRecoveryPoint withType(RestorePointType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + super.withRecoveryPointTierDetails(recoveryPointTierDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + super.withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java new file mode 100644 index 0000000000000..33689f620b696 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Extended info class details. */ +@Fluent +public final class AzureWorkloadSqlRecoveryPointExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRecoveryPointExtendedInfo.class); + + /* + * UTC time at which data directory info was captured + */ + @JsonProperty(value = "dataDirectoryTimeInUTC") + private OffsetDateTime dataDirectoryTimeInUtc; + + /* + * List of data directory paths during restore operation. + */ + @JsonProperty(value = "dataDirectoryPaths") + private List dataDirectoryPaths; + + /** + * Get the dataDirectoryTimeInUtc property: UTC time at which data directory info was captured. + * + * @return the dataDirectoryTimeInUtc value. + */ + public OffsetDateTime dataDirectoryTimeInUtc() { + return this.dataDirectoryTimeInUtc; + } + + /** + * Set the dataDirectoryTimeInUtc property: UTC time at which data directory info was captured. + * + * @param dataDirectoryTimeInUtc the dataDirectoryTimeInUtc value to set. + * @return the AzureWorkloadSqlRecoveryPointExtendedInfo object itself. + */ + public AzureWorkloadSqlRecoveryPointExtendedInfo withDataDirectoryTimeInUtc(OffsetDateTime dataDirectoryTimeInUtc) { + this.dataDirectoryTimeInUtc = dataDirectoryTimeInUtc; + return this; + } + + /** + * Get the dataDirectoryPaths property: List of data directory paths during restore operation. + * + * @return the dataDirectoryPaths value. + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + + /** + * Set the dataDirectoryPaths property: List of data directory paths during restore operation. + * + * @param dataDirectoryPaths the dataDirectoryPaths value to set. + * @return the AzureWorkloadSqlRecoveryPointExtendedInfo object itself. + */ + public AzureWorkloadSqlRecoveryPointExtendedInfo withDataDirectoryPaths(List dataDirectoryPaths) { + this.dataDirectoryPaths = dataDirectoryPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDirectoryPaths() != null) { + dataDirectoryPaths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java new file mode 100644 index 0000000000000..96d591f60a0b0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** AzureWorkload SQL -specific restore. Specifically for full/diff restore. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = AzureWorkloadSqlRestoreRequest.class) +@JsonTypeName("AzureWorkloadSQLRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureWorkloadSQLPointInTimeRestoreRequest", + value = AzureWorkloadSqlPointInTimeRestoreRequest.class), + @JsonSubTypes.Type( + name = "AzureWorkloadSQLRestoreWithRehydrateRequest", + value = AzureWorkloadSqlRestoreWithRehydrateRequest.class) +}) +@Fluent +public class AzureWorkloadSqlRestoreRequest extends AzureWorkloadRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRestoreRequest.class); + + /* + * Default option set to true. If this is set to false, alternate data + * directory must be provided + */ + @JsonProperty(value = "shouldUseAlternateTargetLocation") + private Boolean shouldUseAlternateTargetLocation; + + /* + * SQL specific property where user can chose to set no-recovery when + * restore operation is tried + */ + @JsonProperty(value = "isNonRecoverable") + private Boolean isNonRecoverable; + + /* + * Data directory details + */ + @JsonProperty(value = "alternateDirectoryPaths") + private List alternateDirectoryPaths; + + /** + * Get the shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate + * data directory must be provided. + * + * @return the shouldUseAlternateTargetLocation value. + */ + public Boolean shouldUseAlternateTargetLocation() { + return this.shouldUseAlternateTargetLocation; + } + + /** + * Set the shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate + * data directory must be provided. + * + * @param shouldUseAlternateTargetLocation the shouldUseAlternateTargetLocation value to set. + * @return the AzureWorkloadSqlRestoreRequest object itself. + */ + public AzureWorkloadSqlRestoreRequest withShouldUseAlternateTargetLocation( + Boolean shouldUseAlternateTargetLocation) { + this.shouldUseAlternateTargetLocation = shouldUseAlternateTargetLocation; + return this; + } + + /** + * Get the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore + * operation is tried. + * + * @return the isNonRecoverable value. + */ + public Boolean isNonRecoverable() { + return this.isNonRecoverable; + } + + /** + * Set the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore + * operation is tried. + * + * @param isNonRecoverable the isNonRecoverable value to set. + * @return the AzureWorkloadSqlRestoreRequest object itself. + */ + public AzureWorkloadSqlRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { + this.isNonRecoverable = isNonRecoverable; + return this; + } + + /** + * Get the alternateDirectoryPaths property: Data directory details. + * + * @return the alternateDirectoryPaths value. + */ + public List alternateDirectoryPaths() { + return this.alternateDirectoryPaths; + } + + /** + * Set the alternateDirectoryPaths property: Data directory details. + * + * @param alternateDirectoryPaths the alternateDirectoryPaths value to set. + * @return the AzureWorkloadSqlRestoreRequest object itself. + */ + public AzureWorkloadSqlRestoreRequest withAlternateDirectoryPaths( + List alternateDirectoryPaths) { + this.alternateDirectoryPaths = alternateDirectoryPaths; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (alternateDirectoryPaths() != null) { + alternateDirectoryPaths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java new file mode 100644 index 0000000000000..1c91ba913389a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** AzureWorkload SQL-specific restore with integrated rehydration of recovery point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("AzureWorkloadSQLRestoreWithRehydrateRequest") +@Fluent +public final class AzureWorkloadSqlRestoreWithRehydrateRequest extends AzureWorkloadSqlRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWorkloadSqlRestoreWithRehydrateRequest.class); + + /* + * RP Rehydration Info + */ + @JsonProperty(value = "recoveryPointRehydrationInfo") + private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; + + /** + * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @return the recoveryPointRehydrationInfo value. + */ + public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { + return this.recoveryPointRehydrationInfo; + } + + /** + * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. + * @return the AzureWorkloadSqlRestoreWithRehydrateRequest object itself. + */ + public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryPointRehydrationInfo( + RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { + this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withShouldUseAlternateTargetLocation( + Boolean shouldUseAlternateTargetLocation) { + super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withIsNonRecoverable(Boolean isNonRecoverable) { + super.withIsNonRecoverable(isNonRecoverable); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withAlternateDirectoryPaths( + List alternateDirectoryPaths) { + super.withAlternateDirectoryPaths(alternateDirectoryPaths); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { + super.withPropertyBag(propertyBag); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { + super.withTargetInfo(targetInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { + super.withRecoveryMode(recoveryMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointRehydrationInfo() != null) { + recoveryPointRehydrationInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.java new file mode 100644 index 0000000000000..fe9810598b4d4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobDetails.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupCrrJobDetails. */ +public interface BackupCrrJobDetails { + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + JobResource get(String azureRegion, CrrJobRequest parameters); + + /** + * Get CRR job details from target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters CRR Job request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cRR job details from target region. + */ + Response getWithResponse(String azureRegion, CrrJobRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.java new file mode 100644 index 0000000000000..7e4d01b491f9f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupCrrJobs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupCrrJobs. */ +public interface BackupCrrJobs { + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + PagedIterable list(String azureRegion, CrrJobRequest parameters); + + /** + * Gets the list of CRR jobs from the target region. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Backup CRR Job request. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of CRR jobs from the target region. + */ + PagedIterable list( + String azureRegion, CrrJobRequest parameters, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java new file mode 100644 index 0000000000000..324948a669f98 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** The base backup engine class. All workload specific backup engines derive from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "backupEngineType", + defaultImpl = BackupEngineBase.class) +@JsonTypeName("BackupEngineBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupServerEngine", value = AzureBackupServerEngine.class), + @JsonSubTypes.Type(name = "DpmBackupEngine", value = DpmBackupEngine.class) +}) +@Fluent +public class BackupEngineBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupEngineBase.class); + + /* + * Friendly name of the backup engine. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Type of backup management for the backup engine. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * Registration status of the backup engine with the Recovery Services + * Vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /* + * Status of the backup engine with the Recovery Services Vault. = + * {Active/Deleting/DeleteFailed} + */ + @JsonProperty(value = "backupEngineState") + private String backupEngineState; + + /* + * Backup status of the backup engine. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /* + * Flag indicating if the backup engine be registered, once already + * registered. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /* + * ID of the backup engine. + */ + @JsonProperty(value = "backupEngineId") + private String backupEngineId; + + /* + * Backup engine version + */ + @JsonProperty(value = "dpmVersion") + private String dpmVersion; + + /* + * Backup agent version + */ + @JsonProperty(value = "azureBackupAgentVersion") + private String azureBackupAgentVersion; + + /* + * To check if backup agent upgrade available + */ + @JsonProperty(value = "isAzureBackupAgentUpgradeAvailable") + private Boolean isAzureBackupAgentUpgradeAvailable; + + /* + * To check if backup engine upgrade available + */ + @JsonProperty(value = "isDpmUpgradeAvailable") + private Boolean isDpmUpgradeAvailable; + + /* + * Extended info of the backupengine + */ + @JsonProperty(value = "extendedInfo") + private BackupEngineExtendedInfo extendedInfo; + + /** + * Get the friendlyName property: Friendly name of the backup engine. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the backup engine. + * + * @param friendlyName the friendlyName value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backupManagementType property: Type of backup management for the backup engine. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the backup engine. + * + * @param backupManagementType the backupManagementType value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault. + * + * @return the registrationStatus value. + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault. + * + * @param registrationStatus the registrationStatus value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + + /** + * Get the backupEngineState property: Status of the backup engine with the Recovery Services Vault. = + * {Active/Deleting/DeleteFailed}. + * + * @return the backupEngineState value. + */ + public String backupEngineState() { + return this.backupEngineState; + } + + /** + * Set the backupEngineState property: Status of the backup engine with the Recovery Services Vault. = + * {Active/Deleting/DeleteFailed}. + * + * @param backupEngineState the backupEngineState value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupEngineState(String backupEngineState) { + this.backupEngineState = backupEngineState; + return this; + } + + /** + * Get the healthStatus property: Backup status of the backup engine. + * + * @return the healthStatus value. + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set the healthStatus property: Backup status of the backup engine. + * + * @param healthStatus the healthStatus value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the canReRegister property: Flag indicating if the backup engine be registered, once already registered. + * + * @return the canReRegister value. + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set the canReRegister property: Flag indicating if the backup engine be registered, once already registered. + * + * @param canReRegister the canReRegister value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get the backupEngineId property: ID of the backup engine. + * + * @return the backupEngineId value. + */ + public String backupEngineId() { + return this.backupEngineId; + } + + /** + * Set the backupEngineId property: ID of the backup engine. + * + * @param backupEngineId the backupEngineId value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupEngineId(String backupEngineId) { + this.backupEngineId = backupEngineId; + return this; + } + + /** + * Get the dpmVersion property: Backup engine version. + * + * @return the dpmVersion value. + */ + public String dpmVersion() { + return this.dpmVersion; + } + + /** + * Set the dpmVersion property: Backup engine version. + * + * @param dpmVersion the dpmVersion value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withDpmVersion(String dpmVersion) { + this.dpmVersion = dpmVersion; + return this; + } + + /** + * Get the azureBackupAgentVersion property: Backup agent version. + * + * @return the azureBackupAgentVersion value. + */ + public String azureBackupAgentVersion() { + return this.azureBackupAgentVersion; + } + + /** + * Set the azureBackupAgentVersion property: Backup agent version. + * + * @param azureBackupAgentVersion the azureBackupAgentVersion value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withAzureBackupAgentVersion(String azureBackupAgentVersion) { + this.azureBackupAgentVersion = azureBackupAgentVersion; + return this; + } + + /** + * Get the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available. + * + * @return the isAzureBackupAgentUpgradeAvailable value. + */ + public Boolean isAzureBackupAgentUpgradeAvailable() { + return this.isAzureBackupAgentUpgradeAvailable; + } + + /** + * Set the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available. + * + * @param isAzureBackupAgentUpgradeAvailable the isAzureBackupAgentUpgradeAvailable value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) { + this.isAzureBackupAgentUpgradeAvailable = isAzureBackupAgentUpgradeAvailable; + return this; + } + + /** + * Get the isDpmUpgradeAvailable property: To check if backup engine upgrade available. + * + * @return the isDpmUpgradeAvailable value. + */ + public Boolean isDpmUpgradeAvailable() { + return this.isDpmUpgradeAvailable; + } + + /** + * Set the isDpmUpgradeAvailable property: To check if backup engine upgrade available. + * + * @param isDpmUpgradeAvailable the isDpmUpgradeAvailable value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) { + this.isDpmUpgradeAvailable = isDpmUpgradeAvailable; + return this; + } + + /** + * Get the extendedInfo property: Extended info of the backupengine. + * + * @return the extendedInfo value. + */ + public BackupEngineExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended info of the backupengine. + * + * @param extendedInfo the extendedInfo value to set. + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withExtendedInfo(BackupEngineExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java new file mode 100644 index 0000000000000..2423acb0c0f94 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; +import java.util.Map; + +/** An immutable client-side representation of BackupEngineBaseResource. */ +public interface BackupEngineBaseResource { + /** + * 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 properties property: BackupEngineBaseResource properties. + * + * @return the properties value. + */ + BackupEngineBase properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner + * object. + * + * @return the inner object. + */ + BackupEngineBaseResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResourceList.java new file mode 100644 index 0000000000000..14beb3792b0a7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of BackupEngineBase resources. */ +@Fluent +public final class BackupEngineBaseResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupEngineBaseResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the BackupEngineBaseResourceList object itself. + */ + public BackupEngineBaseResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupEngineBaseResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java new file mode 100644 index 0000000000000..4852a3be0583d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information on backup engine. */ +@Fluent +public final class BackupEngineExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupEngineExtendedInfo.class); + + /* + * Database name of backup engine. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Number of protected items in the backup engine. + */ + @JsonProperty(value = "protectedItemsCount") + private Integer protectedItemsCount; + + /* + * Number of protected servers in the backup engine. + */ + @JsonProperty(value = "protectedServersCount") + private Integer protectedServersCount; + + /* + * Number of disks in the backup engine. + */ + @JsonProperty(value = "diskCount") + private Integer diskCount; + + /* + * Disk space used in the backup engine. + */ + @JsonProperty(value = "usedDiskSpace") + private Double usedDiskSpace; + + /* + * Disk space currently available in the backup engine. + */ + @JsonProperty(value = "availableDiskSpace") + private Double availableDiskSpace; + + /* + * Last refresh time in the backup engine. + */ + @JsonProperty(value = "refreshedAt") + private OffsetDateTime refreshedAt; + + /* + * Protected instances in the backup engine. + */ + @JsonProperty(value = "azureProtectedInstances") + private Integer azureProtectedInstances; + + /** + * Get the databaseName property: Database name of backup engine. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name of backup engine. + * + * @param databaseName the databaseName value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the protectedItemsCount property: Number of protected items in the backup engine. + * + * @return the protectedItemsCount value. + */ + public Integer protectedItemsCount() { + return this.protectedItemsCount; + } + + /** + * Set the protectedItemsCount property: Number of protected items in the backup engine. + * + * @param protectedItemsCount the protectedItemsCount value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withProtectedItemsCount(Integer protectedItemsCount) { + this.protectedItemsCount = protectedItemsCount; + return this; + } + + /** + * Get the protectedServersCount property: Number of protected servers in the backup engine. + * + * @return the protectedServersCount value. + */ + public Integer protectedServersCount() { + return this.protectedServersCount; + } + + /** + * Set the protectedServersCount property: Number of protected servers in the backup engine. + * + * @param protectedServersCount the protectedServersCount value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withProtectedServersCount(Integer protectedServersCount) { + this.protectedServersCount = protectedServersCount; + return this; + } + + /** + * Get the diskCount property: Number of disks in the backup engine. + * + * @return the diskCount value. + */ + public Integer diskCount() { + return this.diskCount; + } + + /** + * Set the diskCount property: Number of disks in the backup engine. + * + * @param diskCount the diskCount value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withDiskCount(Integer diskCount) { + this.diskCount = diskCount; + return this; + } + + /** + * Get the usedDiskSpace property: Disk space used in the backup engine. + * + * @return the usedDiskSpace value. + */ + public Double usedDiskSpace() { + return this.usedDiskSpace; + } + + /** + * Set the usedDiskSpace property: Disk space used in the backup engine. + * + * @param usedDiskSpace the usedDiskSpace value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withUsedDiskSpace(Double usedDiskSpace) { + this.usedDiskSpace = usedDiskSpace; + return this; + } + + /** + * Get the availableDiskSpace property: Disk space currently available in the backup engine. + * + * @return the availableDiskSpace value. + */ + public Double availableDiskSpace() { + return this.availableDiskSpace; + } + + /** + * Set the availableDiskSpace property: Disk space currently available in the backup engine. + * + * @param availableDiskSpace the availableDiskSpace value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withAvailableDiskSpace(Double availableDiskSpace) { + this.availableDiskSpace = availableDiskSpace; + return this; + } + + /** + * Get the refreshedAt property: Last refresh time in the backup engine. + * + * @return the refreshedAt value. + */ + public OffsetDateTime refreshedAt() { + return this.refreshedAt; + } + + /** + * Set the refreshedAt property: Last refresh time in the backup engine. + * + * @param refreshedAt the refreshedAt value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withRefreshedAt(OffsetDateTime refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + * Get the azureProtectedInstances property: Protected instances in the backup engine. + * + * @return the azureProtectedInstances value. + */ + public Integer azureProtectedInstances() { + return this.azureProtectedInstances; + } + + /** + * Set the azureProtectedInstances property: Protected instances in the backup engine. + * + * @param azureProtectedInstances the azureProtectedInstances value to set. + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withAzureProtectedInstances(Integer azureProtectedInstances) { + this.azureProtectedInstances = azureProtectedInstances; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java new file mode 100644 index 0000000000000..49cb16946d3dd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupEngineType. */ +public final class BackupEngineType extends ExpandableStringEnum { + /** Static value Invalid for BackupEngineType. */ + public static final BackupEngineType INVALID = fromString("Invalid"); + + /** Static value DpmBackupEngine for BackupEngineType. */ + public static final BackupEngineType DPM_BACKUP_ENGINE = fromString("DpmBackupEngine"); + + /** Static value AzureBackupServerEngine for BackupEngineType. */ + public static final BackupEngineType AZURE_BACKUP_SERVER_ENGINE = fromString("AzureBackupServerEngine"); + + /** + * Creates or finds a BackupEngineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupEngineType. + */ + @JsonCreator + public static BackupEngineType fromString(String name) { + return fromString(name, BackupEngineType.class); + } + + /** @return known BackupEngineType values. */ + public static Collection values() { + return values(BackupEngineType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java new file mode 100644 index 0000000000000..a6696184c32af --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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 BackupEngines. */ +public interface BackupEngines { + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of BackupEngineBase resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + BackupEngineBaseResource get(String vaultName, String resourceGroupName, String backupEngineName); + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the base backup engine class. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String backupEngineName, + String filter, + String skipToken, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java new file mode 100644 index 0000000000000..1161b5a903e80 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupItemType. */ +public final class BackupItemType extends ExpandableStringEnum { + /** Static value Invalid for BackupItemType. */ + public static final BackupItemType INVALID = fromString("Invalid"); + + /** Static value VM for BackupItemType. */ + public static final BackupItemType VM = fromString("VM"); + + /** Static value FileFolder for BackupItemType. */ + public static final BackupItemType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for BackupItemType. */ + public static final BackupItemType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for BackupItemType. */ + public static final BackupItemType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for BackupItemType. */ + public static final BackupItemType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for BackupItemType. */ + public static final BackupItemType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for BackupItemType. */ + public static final BackupItemType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for BackupItemType. */ + public static final BackupItemType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for BackupItemType. */ + public static final BackupItemType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for BackupItemType. */ + public static final BackupItemType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for BackupItemType. */ + public static final BackupItemType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for BackupItemType. */ + public static final BackupItemType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for BackupItemType. */ + public static final BackupItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for BackupItemType. */ + public static final BackupItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a BackupItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupItemType. + */ + @JsonCreator + public static BackupItemType fromString(String name) { + return fromString(name, BackupItemType.class); + } + + /** @return known BackupItemType values. */ + public static Collection values() { + return values(BackupItemType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java new file mode 100644 index 0000000000000..7ef9bf58a8743 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupJobs. */ +public interface BackupJobs { + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Job resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java new file mode 100644 index 0000000000000..ec159c2a7778d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupManagementType. */ +public final class BackupManagementType extends ExpandableStringEnum { + /** Static value Invalid for BackupManagementType. */ + public static final BackupManagementType INVALID = fromString("Invalid"); + + /** Static value AzureIaasVM for BackupManagementType. */ + public static final BackupManagementType AZURE_IAAS_VM = fromString("AzureIaasVM"); + + /** Static value MAB for BackupManagementType. */ + public static final BackupManagementType MAB = fromString("MAB"); + + /** Static value DPM for BackupManagementType. */ + public static final BackupManagementType DPM = fromString("DPM"); + + /** Static value AzureBackupServer for BackupManagementType. */ + public static final BackupManagementType AZURE_BACKUP_SERVER = fromString("AzureBackupServer"); + + /** Static value AzureSql for BackupManagementType. */ + public static final BackupManagementType AZURE_SQL = fromString("AzureSql"); + + /** Static value AzureStorage for BackupManagementType. */ + public static final BackupManagementType AZURE_STORAGE = fromString("AzureStorage"); + + /** Static value AzureWorkload for BackupManagementType. */ + public static final BackupManagementType AZURE_WORKLOAD = fromString("AzureWorkload"); + + /** Static value DefaultBackup for BackupManagementType. */ + public static final BackupManagementType DEFAULT_BACKUP = fromString("DefaultBackup"); + + /** + * Creates or finds a BackupManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupManagementType. + */ + @JsonCreator + public static BackupManagementType fromString(String name) { + return fromString(name, BackupManagementType.class); + } + + /** @return known BackupManagementType values. */ + public static Collection values() { + return values(BackupManagementType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java new file mode 100644 index 0000000000000..579074fd184ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of BackupManagementUsage. */ +public interface BackupManagementUsage { + /** + * Gets the unit property: Unit of the usage. + * + * @return the unit value. + */ + UsagesUnit unit(); + + /** + * Gets the quotaPeriod property: Quota period of usage. + * + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * Gets the nextResetTime property: Next reset time of usage. + * + * @return the nextResetTime value. + */ + OffsetDateTime nextResetTime(); + + /** + * Gets the currentValue property: Current value of usage. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the limit property: Limit of usage. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the name property: Name of usage. + * + * @return the name value. + */ + NameInfo name(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner object. + * + * @return the inner object. + */ + BackupManagementUsageInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsageList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsageList.java new file mode 100644 index 0000000000000..6fb159170e8c2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsageList.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Backup management usage for vault. */ +@Fluent +public final class BackupManagementUsageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupManagementUsageList.class); + + /* + * The list of backup management usages for the given vault. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of backup management usages for the given vault. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of backup management usages for the given vault. + * + * @param value the value value to set. + * @return the BackupManagementUsageList object itself. + */ + public BackupManagementUsageList withValue(List value) { + this.value = value; + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java new file mode 100644 index 0000000000000..dc19643a08ff0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupOperationResults. */ +public interface BackupOperationResults { + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String vaultName, String resourceGroupName, String operationId); + + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. + * On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID + * is part of the Location header of the operation response. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse(String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java new file mode 100644 index 0000000000000..5890c6c7a6ad1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupOperationStatuses. */ +public interface BackupOperationStatuses { + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + OperationStatus get(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations + * create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java new file mode 100644 index 0000000000000..c34056fbdf608 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupPolicies. */ +public interface BackupPolicies { + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch + * scoped results. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionPolicy resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java new file mode 100644 index 0000000000000..c1e1f005d1464 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupProtectableItems. */ +public interface BackupProtectableItems { + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadProtectableItem resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java new file mode 100644 index 0000000000000..0c54b8a9f17b0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupProtectedItems. */ +public interface BackupProtectedItems { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.java new file mode 100644 index 0000000000000..f939a3ca121d7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsCrrs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupProtectedItemsCrrs. */ +public interface BackupProtectedItemsCrrs { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectedItem resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java new file mode 100644 index 0000000000000..9f78c38c5ab6e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupProtectionContainers. */ +public interface BackupProtectionContainers { + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionContainer resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java new file mode 100644 index 0000000000000..a040944992553 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupProtectionIntents. */ +public interface BackupProtectionIntents { + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectionIntent resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java new file mode 100644 index 0000000000000..7aeadc30f8a41 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for backup request. Workload-specific backup requests are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = BackupRequest.class) +@JsonTypeName("BackupRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareBackupRequest", value = AzureFileShareBackupRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadBackupRequest", value = AzureWorkloadBackupRequest.class), + @JsonSubTypes.Type(name = "IaasVMBackupRequest", value = IaasVMBackupRequest.class) +}) +@Immutable +public class BackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java new file mode 100644 index 0000000000000..4d0f3411c8ded --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for backup request. Workload-specific backup requests are derived from this class. */ +@Fluent +public final class BackupRequestResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupRequestResource.class); + + /* + * BackupRequestResource properties + */ + @JsonProperty(value = "properties") + private BackupRequest properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: BackupRequestResource properties. + * + * @return the properties value. + */ + public BackupRequest properties() { + return this.properties; + } + + /** + * Set the properties property: BackupRequestResource properties. + * + * @param properties the properties value to set. + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withProperties(BackupRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupRequestResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupRequestResource withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java new file mode 100644 index 0000000000000..40388e474959f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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 resource storage details. */ +@Fluent +public final class BackupResourceConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceConfig.class); + + /* + * Storage type + */ + @JsonProperty(value = "storageModelType") + private StorageType storageModelType; + + /* + * Storage type. + */ + @JsonProperty(value = "storageType") + private StorageType storageType; + + /* + * Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + */ + @JsonProperty(value = "storageTypeState") + private StorageTypeState storageTypeState; + + /* + * Opt in details of Cross Region Restore feature. + */ + @JsonProperty(value = "crossRegionRestoreFlag") + private Boolean crossRegionRestoreFlag; + + /** + * Get the storageModelType property: Storage type. + * + * @return the storageModelType value. + */ + public StorageType storageModelType() { + return this.storageModelType; + } + + /** + * Set the storageModelType property: Storage type. + * + * @param storageModelType the storageModelType value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageModelType(StorageType storageModelType) { + this.storageModelType = storageModelType; + return this; + } + + /** + * Get the storageType property: Storage type. + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type. + * + * @param storageType the storageType value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @return the storageTypeState value. + */ + public StorageTypeState storageTypeState() { + return this.storageTypeState; + } + + /** + * Set the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @param storageTypeState the storageTypeState value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withStorageTypeState(StorageTypeState storageTypeState) { + this.storageTypeState = storageTypeState; + return this; + } + + /** + * Get the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. + * + * @return the crossRegionRestoreFlag value. + */ + public Boolean crossRegionRestoreFlag() { + return this.crossRegionRestoreFlag; + } + + /** + * Set the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. + * + * @param crossRegionRestoreFlag the crossRegionRestoreFlag value to set. + * @return the BackupResourceConfig object itself. + */ + public BackupResourceConfig withCrossRegionRestoreFlag(Boolean crossRegionRestoreFlag) { + this.crossRegionRestoreFlag = crossRegionRestoreFlag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java new file mode 100644 index 0000000000000..dd6deca8dd153 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; +import java.util.Map; + +/** An immutable client-side representation of BackupResourceConfigResource. */ +public interface BackupResourceConfigResource { + /** + * 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 properties property: BackupResourceConfigResource properties. + * + * @return the properties value. + */ + BackupResourceConfig properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner + * object. + * + * @return the inner object. + */ + BackupResourceConfigResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java new file mode 100644 index 0000000000000..790dc86dbc1e5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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 BackupResourceEncryptionConfig model. */ +@Fluent +public final class BackupResourceEncryptionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceEncryptionConfig.class); + + /* + * Encryption At Rest Type + */ + @JsonProperty(value = "encryptionAtRestType") + private EncryptionAtRestType encryptionAtRestType; + + /* + * Key Vault Key URI + */ + @JsonProperty(value = "keyUri") + private String keyUri; + + /* + * Key Vault Subscription Id + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * The lastUpdateStatus property. + */ + @JsonProperty(value = "lastUpdateStatus") + private LastUpdateStatus lastUpdateStatus; + + /* + * The infrastructureEncryptionState property. + */ + @JsonProperty(value = "infrastructureEncryptionState") + private InfrastructureEncryptionState infrastructureEncryptionState; + + /** + * Get the encryptionAtRestType property: Encryption At Rest Type. + * + * @return the encryptionAtRestType value. + */ + public EncryptionAtRestType encryptionAtRestType() { + return this.encryptionAtRestType; + } + + /** + * Set the encryptionAtRestType property: Encryption At Rest Type. + * + * @param encryptionAtRestType the encryptionAtRestType value to set. + * @return the BackupResourceEncryptionConfig object itself. + */ + public BackupResourceEncryptionConfig withEncryptionAtRestType(EncryptionAtRestType encryptionAtRestType) { + this.encryptionAtRestType = encryptionAtRestType; + return this; + } + + /** + * Get the keyUri property: Key Vault Key URI. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: Key Vault Key URI. + * + * @param keyUri the keyUri value to set. + * @return the BackupResourceEncryptionConfig object itself. + */ + public BackupResourceEncryptionConfig withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Get the subscriptionId property: Key Vault Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Key Vault Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the BackupResourceEncryptionConfig object itself. + */ + public BackupResourceEncryptionConfig withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the lastUpdateStatus property: The lastUpdateStatus property. + * + * @return the lastUpdateStatus value. + */ + public LastUpdateStatus lastUpdateStatus() { + return this.lastUpdateStatus; + } + + /** + * Set the lastUpdateStatus property: The lastUpdateStatus property. + * + * @param lastUpdateStatus the lastUpdateStatus value to set. + * @return the BackupResourceEncryptionConfig object itself. + */ + public BackupResourceEncryptionConfig withLastUpdateStatus(LastUpdateStatus lastUpdateStatus) { + this.lastUpdateStatus = lastUpdateStatus; + return this; + } + + /** + * Get the infrastructureEncryptionState property: The infrastructureEncryptionState property. + * + * @return the infrastructureEncryptionState value. + */ + public InfrastructureEncryptionState infrastructureEncryptionState() { + return this.infrastructureEncryptionState; + } + + /** + * Set the infrastructureEncryptionState property: The infrastructureEncryptionState property. + * + * @param infrastructureEncryptionState the infrastructureEncryptionState value to set. + * @return the BackupResourceEncryptionConfig object itself. + */ + public BackupResourceEncryptionConfig withInfrastructureEncryptionState( + InfrastructureEncryptionState infrastructureEncryptionState) { + this.infrastructureEncryptionState = infrastructureEncryptionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java new file mode 100644 index 0000000000000..b246f71403ce5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; +import java.util.Map; + +/** An immutable client-side representation of BackupResourceEncryptionConfigResource. */ +public interface BackupResourceEncryptionConfigResource { + /** + * 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 properties property: BackupResourceEncryptionConfigResource properties. + * + * @return the properties value. + */ + BackupResourceEncryptionConfig properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner + * object. + * + * @return the inner object. + */ + BackupResourceEncryptionConfigResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java new file mode 100644 index 0000000000000..ed743352a46fd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigResourceInner; + +/** Resource collection API of BackupResourceEncryptionConfigs. */ +public interface BackupResourceEncryptionConfigs { + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + BackupResourceEncryptionConfigResource get(String vaultName, String resourceGroupName); + + /** + * Fetches Vault Encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, Context context); + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResourceInner parameters); + + /** + * Updates Vault encryption config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault encryption input config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String vaultName, + String resourceGroupName, + BackupResourceEncryptionConfigResourceInner parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.java new file mode 100644 index 0000000000000..a6a663346f249 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; + +/** Resource collection API of BackupResourceStorageConfigs. */ +public interface BackupResourceStorageConfigs { + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + BackupResourceConfigResource get(String vaultName, String resourceGroupName); + + /** + * Fetches resource storage config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + Response getWithResponse(String vaultName, String resourceGroupName, Context context); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + BackupResourceConfigResource update( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resource storage details. + */ + Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); + + /** + * Updates vault storage model type. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Vault storage config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response patchWithResponse( + String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java new file mode 100644 index 0000000000000..3dc0a5ffef0fb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Backup resource vault config details. */ +@Fluent +public final class BackupResourceVaultConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupResourceVaultConfig.class); + + /* + * Storage type. + */ + @JsonProperty(value = "storageModelType") + private StorageType storageModelType; + + /* + * Storage type. + */ + @JsonProperty(value = "storageType") + private StorageType storageType; + + /* + * Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + */ + @JsonProperty(value = "storageTypeState") + private StorageTypeState storageTypeState; + + /* + * Enabled or Disabled. + */ + @JsonProperty(value = "enhancedSecurityState") + private EnhancedSecurityState enhancedSecurityState; + + /* + * Soft Delete feature state + */ + @JsonProperty(value = "softDeleteFeatureState") + private SoftDeleteFeatureState softDeleteFeatureState; + + /** + * Get the storageModelType property: Storage type. + * + * @return the storageModelType value. + */ + public StorageType storageModelType() { + return this.storageModelType; + } + + /** + * Set the storageModelType property: Storage type. + * + * @param storageModelType the storageModelType value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withStorageModelType(StorageType storageModelType) { + this.storageModelType = storageModelType; + return this; + } + + /** + * Get the storageType property: Storage type. + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type. + * + * @param storageType the storageType value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @return the storageTypeState value. + */ + public StorageTypeState storageTypeState() { + return this.storageTypeState; + } + + /** + * Set the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. + * + * @param storageTypeState the storageTypeState value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withStorageTypeState(StorageTypeState storageTypeState) { + this.storageTypeState = storageTypeState; + return this; + } + + /** + * Get the enhancedSecurityState property: Enabled or Disabled. + * + * @return the enhancedSecurityState value. + */ + public EnhancedSecurityState enhancedSecurityState() { + return this.enhancedSecurityState; + } + + /** + * Set the enhancedSecurityState property: Enabled or Disabled. + * + * @param enhancedSecurityState the enhancedSecurityState value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withEnhancedSecurityState(EnhancedSecurityState enhancedSecurityState) { + this.enhancedSecurityState = enhancedSecurityState; + return this; + } + + /** + * Get the softDeleteFeatureState property: Soft Delete feature state. + * + * @return the softDeleteFeatureState value. + */ + public SoftDeleteFeatureState softDeleteFeatureState() { + return this.softDeleteFeatureState; + } + + /** + * Set the softDeleteFeatureState property: Soft Delete feature state. + * + * @param softDeleteFeatureState the softDeleteFeatureState value to set. + * @return the BackupResourceVaultConfig object itself. + */ + public BackupResourceVaultConfig withSoftDeleteFeatureState(SoftDeleteFeatureState softDeleteFeatureState) { + this.softDeleteFeatureState = softDeleteFeatureState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java new file mode 100644 index 0000000000000..6d03e2874d099 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; +import java.util.Map; + +/** An immutable client-side representation of BackupResourceVaultConfigResource. */ +public interface BackupResourceVaultConfigResource { + /** + * 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 properties property: BackupResourceVaultConfigResource properties. + * + * @return the properties value. + */ + BackupResourceVaultConfig properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner object. + * + * @return the inner object. + */ + BackupResourceVaultConfigResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java new file mode 100644 index 0000000000000..d3479e71011e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; + +/** Resource collection API of BackupResourceVaultConfigs. */ +public interface BackupResourceVaultConfigs { + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + BackupResourceVaultConfigResource get(String vaultName, String resourceGroupName); + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, Context context); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + BackupResourceVaultConfigResource update( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + Response updateWithResponse( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, Context context); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + BackupResourceVaultConfigResource put( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup resource vault config details. + */ + Response putWithResponse( + String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java new file mode 100644 index 0000000000000..1bc08e3af138e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupStatus. */ +public interface BackupStatus { + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + BackupStatusResponse get(String azureRegion, BackupStatusRequest parameters); + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Container Backup Status Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container backup status. + */ + Response getWithResponse(String azureRegion, BackupStatusRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java new file mode 100644 index 0000000000000..69917dc7076b6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.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.recoveryservicesbackup.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; + +/** BackupStatus request. */ +@Fluent +public final class BackupStatusRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupStatusRequest.class); + + /* + * Container Type - VM, SQLPaaS, DPM, AzureFileShare... + */ + @JsonProperty(value = "resourceType") + private DataSourceType resourceType; + + /* + * Entire ARM resource id of the resource + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Protectable Item Logical Name + */ + @JsonProperty(value = "poLogicalName") + private String poLogicalName; + + /** + * Get the resourceType property: Container Type - VM, SQLPaaS, DPM, AzureFileShare... + * + * @return the resourceType value. + */ + public DataSourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Container Type - VM, SQLPaaS, DPM, AzureFileShare... + * + * @param resourceType the resourceType value to set. + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withResourceType(DataSourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceId property: Entire ARM resource id of the resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Entire ARM resource id of the resource. + * + * @param resourceId the resourceId value to set. + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the poLogicalName property: Protectable Item Logical Name. + * + * @return the poLogicalName value. + */ + public String poLogicalName() { + return this.poLogicalName; + } + + /** + * Set the poLogicalName property: Protectable Item Logical Name. + * + * @param poLogicalName the poLogicalName value to set. + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withPoLogicalName(String poLogicalName) { + this.poLogicalName = poLogicalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java new file mode 100644 index 0000000000000..c760cfeb32d36 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; + +/** An immutable client-side representation of BackupStatusResponse. */ +public interface BackupStatusResponse { + /** + * Gets the protectionStatus property: Specifies whether the container is registered or not. + * + * @return the protectionStatus value. + */ + ProtectionStatus protectionStatus(); + + /** + * Gets the vaultId property: Specifies the arm resource id of the vault. + * + * @return the vaultId value. + */ + String vaultId(); + + /** + * Gets the fabricName property: Specifies the fabric name - Azure or AD. + * + * @return the fabricName value. + */ + FabricName fabricName(); + + /** + * Gets the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;csname;vmname. + * + * @return the containerName value. + */ + String containerName(); + + /** + * Gets the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;csname;vmname. + * + * @return the protectedItemName value. + */ + String protectedItemName(); + + /** + * Gets the errorCode property: ErrorCode in case of intent failed. + * + * @return the errorCode value. + */ + String errorCode(); + + /** + * Gets the errorMessage property: ErrorMessage in case of intent failed. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the policyName property: Specifies the policy name which is used for protection. + * + * @return the policyName value. + */ + String policyName(); + + /** + * Gets the registrationStatus property: Container registration status. + * + * @return the registrationStatus value. + */ + String registrationStatus(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner object. + * + * @return the inner object. + */ + BackupStatusResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java new file mode 100644 index 0000000000000..84e199cd1336d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupType. */ +public final class BackupType extends ExpandableStringEnum { + /** Static value Invalid for BackupType. */ + public static final BackupType INVALID = fromString("Invalid"); + + /** Static value Full for BackupType. */ + public static final BackupType FULL = fromString("Full"); + + /** Static value Differential for BackupType. */ + public static final BackupType DIFFERENTIAL = fromString("Differential"); + + /** Static value Log for BackupType. */ + public static final BackupType LOG = fromString("Log"); + + /** Static value CopyOnlyFull for BackupType. */ + public static final BackupType COPY_ONLY_FULL = fromString("CopyOnlyFull"); + + /** Static value Incremental for BackupType. */ + public static final BackupType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a BackupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupType. + */ + @JsonCreator + public static BackupType fromString(String name) { + return fromString(name, BackupType.class); + } + + /** @return known BackupType values. */ + public static Collection values() { + return values(BackupType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java new file mode 100644 index 0000000000000..23185ecf4b6cd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupUsageSummaries. */ +public interface BackupUsageSummaries { + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + PagedIterable list(String vaultName, String resourceGroupName); + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup management usage for vault. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java new file mode 100644 index 0000000000000..afd152262c7e7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BackupWorkloadItems. */ +public interface BackupWorkloadItems { + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the + * pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of WorkloadItem resources. + */ + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + String skipToken, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java new file mode 100644 index 0000000000000..c3732e79533e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Backups. */ +public interface Backups { + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters); + + /** + * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the + * operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item for which backup needs to be triggered. + * @param parameters resource backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response triggerWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + BackupRequestResource parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java new file mode 100644 index 0000000000000..b57e79300eb0c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.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.recoveryservicesbackup.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; + +/** BEK is bitlocker encryption key. */ +@Fluent +public final class BekDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BekDetails.class); + + /* + * Secret is BEK. + */ + @JsonProperty(value = "secretUrl") + private String secretUrl; + + /* + * ID of the Key Vault where this Secret is stored. + */ + @JsonProperty(value = "secretVaultId") + private String secretVaultId; + + /* + * BEK data. + */ + @JsonProperty(value = "secretData") + private String secretData; + + /** + * Get the secretUrl property: Secret is BEK. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: Secret is BEK. + * + * @param secretUrl the secretUrl value to set. + * @return the BekDetails object itself. + */ + public BekDetails withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Get the secretVaultId property: ID of the Key Vault where this Secret is stored. + * + * @return the secretVaultId value. + */ + public String secretVaultId() { + return this.secretVaultId; + } + + /** + * Set the secretVaultId property: ID of the Key Vault where this Secret is stored. + * + * @param secretVaultId the secretVaultId value to set. + * @return the BekDetails object itself. + */ + public BekDetails withSecretVaultId(String secretVaultId) { + this.secretVaultId = secretVaultId; + return this; + } + + /** + * Get the secretData property: BEK data. + * + * @return the secretData value. + */ + public String secretData() { + return this.secretData; + } + + /** + * Set the secretData property: BEK data. + * + * @param secretData the secretData value to set. + * @return the BekDetails object itself. + */ + public BekDetails withSecretData(String secretData) { + this.secretData = secretData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java new file mode 100644 index 0000000000000..a954f9ff5d6f8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BmsPrepareDataMoveOperationResults. */ +public interface BmsPrepareDataMoveOperationResults { + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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 result response for Vault Storage Config. + */ + VaultStorageConfigOperationResultResponse get(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches Operation Result for Prepare Data Move. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 result response for Vault Storage Config. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java new file mode 100644 index 0000000000000..40ff45113ad89 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information of an operation. */ +@Fluent +public final class ClientDiscoveryDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryDisplay.class); + + /* + * Name of the provider for display purposes + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * ResourceType for which this Operation can be performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operations Name itself. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation having details of what operation is about. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Name of the provider for display purposes. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Name of the provider for display purposes. + * + * @param provider the provider value to set. + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: ResourceType for which this Operation can be performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: ResourceType for which this Operation can be performed. + * + * @param resource the resource value to set. + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operations Name itself. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operations Name itself. + * + * @param operation the operation value to set. + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation having details of what operation is about. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation having details of what operation is about. + * + * @param description the description value to set. + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java new file mode 100644 index 0000000000000..94b111b9a063e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.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.recoveryservicesbackup.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; + +/** Class to represent shoebox log specification in json client discovery. */ +@Fluent +public final class ClientDiscoveryForLogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForLogSpecification.class); + + /* + * Name for shoebox log specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * blob duration of shoebox log specification + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name for shoebox log specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name for shoebox log specification. + * + * @param name the name value to set. + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized display name. + * + * @param displayName the displayName value to set. + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: blob duration of shoebox log specification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: blob duration of shoebox log specification. + * + * @param blobDuration the blobDuration value to set. + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java new file mode 100644 index 0000000000000..3f83c947dd351 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.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.recoveryservicesbackup.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; + +/** Class to represent shoebox properties in json client discovery. */ +@Fluent +public final class ClientDiscoveryForProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForProperties.class); + + /* + * Operation properties. + */ + @JsonProperty(value = "serviceSpecification") + private ClientDiscoveryForServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Operation properties. + * + * @return the serviceSpecification value. + */ + public ClientDiscoveryForServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Operation properties. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the ClientDiscoveryForProperties object itself. + */ + public ClientDiscoveryForProperties withServiceSpecification( + ClientDiscoveryForServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java new file mode 100644 index 0000000000000..fe0004e7cafe6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.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.recoveryservicesbackup.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; + +/** Class to represent shoebox service specification in json client discovery. */ +@Fluent +public final class ClientDiscoveryForServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryForServiceSpecification.class); + + /* + * List of log specifications of this operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the logSpecifications property: List of log specifications of this operation. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: List of log specifications of this operation. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ClientDiscoveryForServiceSpecification object itself. + */ + public ClientDiscoveryForServiceSpecification withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryResponse.java new file mode 100644 index 0000000000000..0859041283b7d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryResponse.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Operations List response which contains list of available APIs. */ +@Fluent +public final class ClientDiscoveryResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryResponse.class); + + /* + * List of available operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next chunk of Response. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of available operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of available operations. + * + * @param value the value value to set. + * @return the ClientDiscoveryResponse object itself. + */ + public ClientDiscoveryResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next chunk of Response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next chunk of Response. + * + * @param nextLink the nextLink value to set. + * @return the ClientDiscoveryResponse object itself. + */ + public ClientDiscoveryResponse 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java new file mode 100644 index 0000000000000..7057d805bac07 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; + +/** An immutable client-side representation of ClientDiscoveryValueForSingleApi. */ +public interface ClientDiscoveryValueForSingleApi { + /** + * Gets the name property: Name of the Operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Contains the localized display information for this particular operation. + * + * @return the display value. + */ + ClientDiscoveryDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation;governs the display of the operation in the RBAC + * UX and the audit logs UX. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: ShoeBox properties for the given operation. + * + * @return the properties value. + */ + ClientDiscoveryForProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner object. + * + * @return the inner object. + */ + ClientDiscoveryValueForSingleApiInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java new file mode 100644 index 0000000000000..860ade5756dd7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Client script details for file / folder restore. */ +@Fluent +public final class ClientScriptForConnect { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientScriptForConnect.class); + + /* + * File content of the client script for file / folder restore. + */ + @JsonProperty(value = "scriptContent") + private String scriptContent; + + /* + * File extension of the client script for file / folder restore - .ps1 , + * .sh , etc. + */ + @JsonProperty(value = "scriptExtension") + private String scriptExtension; + + /* + * OS type - Windows, Linux etc. for which this file / folder restore + * client script works. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * URL of Executable from where to source the content. If this is not null + * then ScriptContent should not be used + */ + @JsonProperty(value = "url") + private String url; + + /* + * Mandatory suffix that should be added to the name of script that is + * given for download to user. + * If its null or empty then , ignore it. + */ + @JsonProperty(value = "scriptNameSuffix") + private String scriptNameSuffix; + + /** + * Get the scriptContent property: File content of the client script for file / folder restore. + * + * @return the scriptContent value. + */ + public String scriptContent() { + return this.scriptContent; + } + + /** + * Set the scriptContent property: File content of the client script for file / folder restore. + * + * @param scriptContent the scriptContent value to set. + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptContent(String scriptContent) { + this.scriptContent = scriptContent; + return this; + } + + /** + * Get the scriptExtension property: File extension of the client script for file / folder restore - .ps1 , .sh , + * etc. + * + * @return the scriptExtension value. + */ + public String scriptExtension() { + return this.scriptExtension; + } + + /** + * Set the scriptExtension property: File extension of the client script for file / folder restore - .ps1 , .sh , + * etc. + * + * @param scriptExtension the scriptExtension value to set. + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptExtension(String scriptExtension) { + this.scriptExtension = scriptExtension; + return this; + } + + /** + * Get the osType property: OS type - Windows, Linux etc. for which this file / folder restore client script works. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: OS type - Windows, Linux etc. for which this file / folder restore client script works. + * + * @param osType the osType value to set. + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the url property: URL of Executable from where to source the content. If this is not null then ScriptContent + * should not be used. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: URL of Executable from where to source the content. If this is not null then ScriptContent + * should not be used. + * + * @param url the url value to set. + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the scriptNameSuffix property: Mandatory suffix that should be added to the name of script that is given for + * download to user. If its null or empty then , ignore it. + * + * @return the scriptNameSuffix value. + */ + public String scriptNameSuffix() { + return this.scriptNameSuffix; + } + + /** + * Set the scriptNameSuffix property: Mandatory suffix that should be added to the name of script that is given for + * download to user. If its null or empty then , ignore it. + * + * @param scriptNameSuffix the scriptNameSuffix value to set. + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptNameSuffix(String scriptNameSuffix) { + this.scriptNameSuffix = scriptNameSuffix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java new file mode 100644 index 0000000000000..eef5cc32f807e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.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.recoveryservicesbackup.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; + +/** Container identity information. */ +@Fluent +public final class ContainerIdentityInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerIdentityInfo.class); + + /* + * Unique name of the container + */ + @JsonProperty(value = "uniqueName") + private String uniqueName; + + /* + * Protection container identity - AAD Tenant + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /* + * Protection container identity - AAD Service Principal + */ + @JsonProperty(value = "servicePrincipalClientId") + private String servicePrincipalClientId; + + /* + * Protection container identity - Audience + */ + @JsonProperty(value = "audience") + private String audience; + + /** + * Get the uniqueName property: Unique name of the container. + * + * @return the uniqueName value. + */ + public String uniqueName() { + return this.uniqueName; + } + + /** + * Set the uniqueName property: Unique name of the container. + * + * @param uniqueName the uniqueName value to set. + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withUniqueName(String uniqueName) { + this.uniqueName = uniqueName; + return this; + } + + /** + * Get the aadTenantId property: Protection container identity - AAD Tenant. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: Protection container identity - AAD Tenant. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the servicePrincipalClientId property: Protection container identity - AAD Service Principal. + * + * @return the servicePrincipalClientId value. + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set the servicePrincipalClientId property: Protection container identity - AAD Service Principal. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set. + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get the audience property: Protection container identity - Audience. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: Protection container identity - Audience. + * + * @param audience the audience value to set. + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerType.java new file mode 100644 index 0000000000000..d4cafbdc24b74 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerType. */ +public final class ContainerType extends ExpandableStringEnum { + /** Static value Invalid for ContainerType. */ + public static final ContainerType INVALID = fromString("Invalid"); + + /** Static value Unknown for ContainerType. */ + public static final ContainerType UNKNOWN = fromString("Unknown"); + + /** Static value IaasVMContainer for ContainerType. */ + public static final ContainerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); + + /** Static value IaasVMServiceContainer for ContainerType. */ + public static final ContainerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); + + /** Static value DPMContainer for ContainerType. */ + public static final ContainerType DPMCONTAINER = fromString("DPMContainer"); + + /** Static value AzureBackupServerContainer for ContainerType. */ + public static final ContainerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); + + /** Static value MABContainer for ContainerType. */ + public static final ContainerType MABCONTAINER = fromString("MABContainer"); + + /** Static value Cluster for ContainerType. */ + public static final ContainerType CLUSTER = fromString("Cluster"); + + /** Static value AzureSqlContainer for ContainerType. */ + public static final ContainerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); + + /** Static value Windows for ContainerType. */ + public static final ContainerType WINDOWS = fromString("Windows"); + + /** Static value VCenter for ContainerType. */ + public static final ContainerType VCENTER = fromString("VCenter"); + + /** Static value VMAppContainer for ContainerType. */ + public static final ContainerType VMAPP_CONTAINER = fromString("VMAppContainer"); + + /** Static value SQLAGWorkLoadContainer for ContainerType. */ + public static final ContainerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); + + /** Static value StorageContainer for ContainerType. */ + public static final ContainerType STORAGE_CONTAINER = fromString("StorageContainer"); + + /** Static value GenericContainer for ContainerType. */ + public static final ContainerType GENERIC_CONTAINER = fromString("GenericContainer"); + + /** + * Creates or finds a ContainerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerType. + */ + @JsonCreator + public static ContainerType fromString(String name) { + return fromString(name, ContainerType.class); + } + + /** @return known ContainerType values. */ + public static Collection values() { + return values(ContainerType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java new file mode 100644 index 0000000000000..08bbba1661add --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CopyOptions. */ +public final class CopyOptions extends ExpandableStringEnum { + /** Static value Invalid for CopyOptions. */ + public static final CopyOptions INVALID = fromString("Invalid"); + + /** Static value CreateCopy for CopyOptions. */ + public static final CopyOptions CREATE_COPY = fromString("CreateCopy"); + + /** Static value Skip for CopyOptions. */ + public static final CopyOptions SKIP = fromString("Skip"); + + /** Static value Overwrite for CopyOptions. */ + public static final CopyOptions OVERWRITE = fromString("Overwrite"); + + /** Static value FailOnConflict for CopyOptions. */ + public static final CopyOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** + * Creates or finds a CopyOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyOptions. + */ + @JsonCreator + public static CopyOptions fromString(String name) { + return fromString(name, CopyOptions.class); + } + + /** @return known CopyOptions values. */ + public static Collection values() { + return values(CopyOptions.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java new file mode 100644 index 0000000000000..5d9291fa8d3df --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreateMode. */ +public final class CreateMode extends ExpandableStringEnum { + /** Static value Invalid for CreateMode. */ + public static final CreateMode INVALID = fromString("Invalid"); + + /** Static value Default for CreateMode. */ + public static final CreateMode DEFAULT = fromString("Default"); + + /** Static value Recover for CreateMode. */ + public static final CreateMode RECOVER = fromString("Recover"); + + /** + * Creates or finds a CreateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateMode. + */ + @JsonCreator + public static CreateMode fromString(String name) { + return fromString(name, CreateMode.class); + } + + /** @return known CreateMode values. */ + public static Collection values() { + return values(CreateMode.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java new file mode 100644 index 0000000000000..4b1fc9f568b92 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestoreRequest.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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 CrossRegionRestoreRequest model. */ +@Fluent +public final class CrossRegionRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrossRegionRestoreRequest.class); + + /* + * Access details for cross region restore + */ + @JsonProperty(value = "crossRegionRestoreAccessDetails") + private CrrAccessToken crossRegionRestoreAccessDetails; + + /* + * Request object for triggering restore + */ + @JsonProperty(value = "restoreRequest") + private RestoreRequest restoreRequest; + + /** + * Get the crossRegionRestoreAccessDetails property: Access details for cross region restore. + * + * @return the crossRegionRestoreAccessDetails value. + */ + public CrrAccessToken crossRegionRestoreAccessDetails() { + return this.crossRegionRestoreAccessDetails; + } + + /** + * Set the crossRegionRestoreAccessDetails property: Access details for cross region restore. + * + * @param crossRegionRestoreAccessDetails the crossRegionRestoreAccessDetails value to set. + * @return the CrossRegionRestoreRequest object itself. + */ + public CrossRegionRestoreRequest withCrossRegionRestoreAccessDetails( + CrrAccessToken crossRegionRestoreAccessDetails) { + this.crossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails; + return this; + } + + /** + * Get the restoreRequest property: Request object for triggering restore. + * + * @return the restoreRequest value. + */ + public RestoreRequest restoreRequest() { + return this.restoreRequest; + } + + /** + * Set the restoreRequest property: Request object for triggering restore. + * + * @param restoreRequest the restoreRequest value to set. + * @return the CrossRegionRestoreRequest object itself. + */ + public CrossRegionRestoreRequest withRestoreRequest(RestoreRequest restoreRequest) { + this.restoreRequest = restoreRequest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (crossRegionRestoreAccessDetails() != null) { + crossRegionRestoreAccessDetails().validate(); + } + if (restoreRequest() != null) { + restoreRequest().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java new file mode 100644 index 0000000000000..315b1860ad81d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossRegionRestores.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** Resource collection API of CrossRegionRestores. */ +public interface CrossRegionRestores { + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String azureRegion, CrossRegionRestoreRequest parameters); + + /** + * Restores the specified backed up data in a different region as compared to where the data is backed up. + * + * @param azureRegion Azure region to hit Api. + * @param parameters resource cross region restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String azureRegion, CrossRegionRestoreRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java new file mode 100644 index 0000000000000..cd189fdcaba04 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessToken.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** The CrrAccessToken model. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = CrrAccessToken.class) +@JsonTypeName("CrrAccessToken") +@JsonSubTypes({@JsonSubTypes.Type(name = "WorkloadCrrAccessToken", value = WorkloadCrrAccessToken.class)}) +@Fluent +public class CrrAccessToken { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrAccessToken.class); + + /* + * Access token used for authentication + */ + @JsonProperty(value = "accessTokenString") + private String accessTokenString; + + /* + * Subscription Id of the source vault + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * Resource Group name of the source vault + */ + @JsonProperty(value = "resourceGroupName") + private String resourceGroupName; + + /* + * Resource Name of the source vault + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * Resource Id of the source vault + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Protected item container id + */ + @JsonProperty(value = "protectionContainerId") + private Long protectionContainerId; + + /* + * Recovery Point Id + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Recovery Point Time + */ + @JsonProperty(value = "recoveryPointTime") + private String recoveryPointTime; + + /* + * Container Unique name + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * Container Type + */ + @JsonProperty(value = "containerType") + private String containerType; + + /* + * Backup Management Type + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /* + * Datasource Type + */ + @JsonProperty(value = "datasourceType") + private String datasourceType; + + /* + * Datasource Friendly Name + */ + @JsonProperty(value = "datasourceName") + private String datasourceName; + + /* + * Datasource Id + */ + @JsonProperty(value = "datasourceId") + private String datasourceId; + + /* + * Datasource Container Unique Name + */ + @JsonProperty(value = "datasourceContainerName") + private String datasourceContainerName; + + /* + * CoordinatorServiceStampId to be used by BCM in restore call + */ + @JsonProperty(value = "coordinatorServiceStampId") + private String coordinatorServiceStampId; + + /* + * CoordinatorServiceStampUri to be used by BCM in restore call + */ + @JsonProperty(value = "coordinatorServiceStampUri") + private String coordinatorServiceStampUri; + + /* + * ProtectionServiceStampId to be used by BCM in restore call + */ + @JsonProperty(value = "protectionServiceStampId") + private String protectionServiceStampId; + + /* + * ProtectionServiceStampUri to be used by BCM in restore call + */ + @JsonProperty(value = "protectionServiceStampUri") + private String protectionServiceStampUri; + + /* + * Extended Information about the token like FileSpec etc. + */ + @JsonProperty(value = "tokenExtendedInformation") + private String tokenExtendedInformation; + + /* + * Recovery point Tier Information + */ + @JsonProperty(value = "rpTierInformation") + private Map rpTierInformation; + + /* + * Recovery point information: Original SA option + */ + @JsonProperty(value = "rpOriginalSAOption") + private Boolean rpOriginalSAOption; + + /* + * Recovery point information: Managed virtual machine + */ + @JsonProperty(value = "rpIsManagedVirtualMachine") + private Boolean rpIsManagedVirtualMachine; + + /* + * Recovery point information: VM size description + */ + @JsonProperty(value = "rpVMSizeDescription") + private String rpVMSizeDescription; + + /* + * Active region name of BMS Stamp + */ + @JsonProperty(value = "bMSActiveRegion") + private String bMSActiveRegion; + + /** + * Get the accessTokenString property: Access token used for authentication. + * + * @return the accessTokenString value. + */ + public String accessTokenString() { + return this.accessTokenString; + } + + /** + * Set the accessTokenString property: Access token used for authentication. + * + * @param accessTokenString the accessTokenString value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withAccessTokenString(String accessTokenString) { + this.accessTokenString = accessTokenString; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id of the source vault. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id of the source vault. + * + * @param subscriptionId the subscriptionId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroupName property: Resource Group name of the source vault. + * + * @return the resourceGroupName value. + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Set the resourceGroupName property: Resource Group name of the source vault. + * + * @param resourceGroupName the resourceGroupName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceGroupName(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + /** + * Get the resourceName property: Resource Name of the source vault. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: Resource Name of the source vault. + * + * @param resourceName the resourceName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceId property: Resource Id of the source vault. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of the source vault. + * + * @param resourceId the resourceId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the protectionContainerId property: Protected item container id. + * + * @return the protectionContainerId value. + */ + public Long protectionContainerId() { + return this.protectionContainerId; + } + + /** + * Set the protectionContainerId property: Protected item container id. + * + * @param protectionContainerId the protectionContainerId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionContainerId(Long protectionContainerId) { + this.protectionContainerId = protectionContainerId; + return this; + } + + /** + * Get the recoveryPointId property: Recovery Point Id. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: Recovery Point Id. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the recoveryPointTime property: Recovery Point Time. + * + * @return the recoveryPointTime value. + */ + public String recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Recovery Point Time. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRecoveryPointTime(String recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the containerName property: Container Unique name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container Unique name. + * + * @param containerName the containerName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerType property: Container Type. + * + * @return the containerType value. + */ + public String containerType() { + return this.containerType; + } + + /** + * Set the containerType property: Container Type. + * + * @param containerType the containerType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withContainerType(String containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the backupManagementType property: Backup Management Type. + * + * @return the backupManagementType value. + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Backup Management Type. + * + * @param backupManagementType the backupManagementType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the datasourceType property: Datasource Type. + * + * @return the datasourceType value. + */ + public String datasourceType() { + return this.datasourceType; + } + + /** + * Set the datasourceType property: Datasource Type. + * + * @param datasourceType the datasourceType value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceType(String datasourceType) { + this.datasourceType = datasourceType; + return this; + } + + /** + * Get the datasourceName property: Datasource Friendly Name. + * + * @return the datasourceName value. + */ + public String datasourceName() { + return this.datasourceName; + } + + /** + * Set the datasourceName property: Datasource Friendly Name. + * + * @param datasourceName the datasourceName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceName(String datasourceName) { + this.datasourceName = datasourceName; + return this; + } + + /** + * Get the datasourceId property: Datasource Id. + * + * @return the datasourceId value. + */ + public String datasourceId() { + return this.datasourceId; + } + + /** + * Set the datasourceId property: Datasource Id. + * + * @param datasourceId the datasourceId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceId(String datasourceId) { + this.datasourceId = datasourceId; + return this; + } + + /** + * Get the datasourceContainerName property: Datasource Container Unique Name. + * + * @return the datasourceContainerName value. + */ + public String datasourceContainerName() { + return this.datasourceContainerName; + } + + /** + * Set the datasourceContainerName property: Datasource Container Unique Name. + * + * @param datasourceContainerName the datasourceContainerName value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withDatasourceContainerName(String datasourceContainerName) { + this.datasourceContainerName = datasourceContainerName; + return this; + } + + /** + * Get the coordinatorServiceStampId property: CoordinatorServiceStampId to be used by BCM in restore call. + * + * @return the coordinatorServiceStampId value. + */ + public String coordinatorServiceStampId() { + return this.coordinatorServiceStampId; + } + + /** + * Set the coordinatorServiceStampId property: CoordinatorServiceStampId to be used by BCM in restore call. + * + * @param coordinatorServiceStampId the coordinatorServiceStampId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withCoordinatorServiceStampId(String coordinatorServiceStampId) { + this.coordinatorServiceStampId = coordinatorServiceStampId; + return this; + } + + /** + * Get the coordinatorServiceStampUri property: CoordinatorServiceStampUri to be used by BCM in restore call. + * + * @return the coordinatorServiceStampUri value. + */ + public String coordinatorServiceStampUri() { + return this.coordinatorServiceStampUri; + } + + /** + * Set the coordinatorServiceStampUri property: CoordinatorServiceStampUri to be used by BCM in restore call. + * + * @param coordinatorServiceStampUri the coordinatorServiceStampUri value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withCoordinatorServiceStampUri(String coordinatorServiceStampUri) { + this.coordinatorServiceStampUri = coordinatorServiceStampUri; + return this; + } + + /** + * Get the protectionServiceStampId property: ProtectionServiceStampId to be used by BCM in restore call. + * + * @return the protectionServiceStampId value. + */ + public String protectionServiceStampId() { + return this.protectionServiceStampId; + } + + /** + * Set the protectionServiceStampId property: ProtectionServiceStampId to be used by BCM in restore call. + * + * @param protectionServiceStampId the protectionServiceStampId value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionServiceStampId(String protectionServiceStampId) { + this.protectionServiceStampId = protectionServiceStampId; + return this; + } + + /** + * Get the protectionServiceStampUri property: ProtectionServiceStampUri to be used by BCM in restore call. + * + * @return the protectionServiceStampUri value. + */ + public String protectionServiceStampUri() { + return this.protectionServiceStampUri; + } + + /** + * Set the protectionServiceStampUri property: ProtectionServiceStampUri to be used by BCM in restore call. + * + * @param protectionServiceStampUri the protectionServiceStampUri value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withProtectionServiceStampUri(String protectionServiceStampUri) { + this.protectionServiceStampUri = protectionServiceStampUri; + return this; + } + + /** + * Get the tokenExtendedInformation property: Extended Information about the token like FileSpec etc. + * + * @return the tokenExtendedInformation value. + */ + public String tokenExtendedInformation() { + return this.tokenExtendedInformation; + } + + /** + * Set the tokenExtendedInformation property: Extended Information about the token like FileSpec etc. + * + * @param tokenExtendedInformation the tokenExtendedInformation value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withTokenExtendedInformation(String tokenExtendedInformation) { + this.tokenExtendedInformation = tokenExtendedInformation; + return this; + } + + /** + * Get the rpTierInformation property: Recovery point Tier Information. + * + * @return the rpTierInformation value. + */ + public Map rpTierInformation() { + return this.rpTierInformation; + } + + /** + * Set the rpTierInformation property: Recovery point Tier Information. + * + * @param rpTierInformation the rpTierInformation value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpTierInformation(Map rpTierInformation) { + this.rpTierInformation = rpTierInformation; + return this; + } + + /** + * Get the rpOriginalSAOption property: Recovery point information: Original SA option. + * + * @return the rpOriginalSAOption value. + */ + public Boolean rpOriginalSAOption() { + return this.rpOriginalSAOption; + } + + /** + * Set the rpOriginalSAOption property: Recovery point information: Original SA option. + * + * @param rpOriginalSAOption the rpOriginalSAOption value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpOriginalSAOption(Boolean rpOriginalSAOption) { + this.rpOriginalSAOption = rpOriginalSAOption; + return this; + } + + /** + * Get the rpIsManagedVirtualMachine property: Recovery point information: Managed virtual machine. + * + * @return the rpIsManagedVirtualMachine value. + */ + public Boolean rpIsManagedVirtualMachine() { + return this.rpIsManagedVirtualMachine; + } + + /** + * Set the rpIsManagedVirtualMachine property: Recovery point information: Managed virtual machine. + * + * @param rpIsManagedVirtualMachine the rpIsManagedVirtualMachine value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpIsManagedVirtualMachine(Boolean rpIsManagedVirtualMachine) { + this.rpIsManagedVirtualMachine = rpIsManagedVirtualMachine; + return this; + } + + /** + * Get the rpVMSizeDescription property: Recovery point information: VM size description. + * + * @return the rpVMSizeDescription value. + */ + public String rpVMSizeDescription() { + return this.rpVMSizeDescription; + } + + /** + * Set the rpVMSizeDescription property: Recovery point information: VM size description. + * + * @param rpVMSizeDescription the rpVMSizeDescription value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withRpVMSizeDescription(String rpVMSizeDescription) { + this.rpVMSizeDescription = rpVMSizeDescription; + return this; + } + + /** + * Get the bMSActiveRegion property: Active region name of BMS Stamp. + * + * @return the bMSActiveRegion value. + */ + public String bMSActiveRegion() { + return this.bMSActiveRegion; + } + + /** + * Set the bMSActiveRegion property: Active region name of BMS Stamp. + * + * @param bMSActiveRegion the bMSActiveRegion value to set. + * @return the CrrAccessToken object itself. + */ + public CrrAccessToken withBMSActiveRegion(String bMSActiveRegion) { + this.bMSActiveRegion = bMSActiveRegion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.java new file mode 100644 index 0000000000000..d81f692bc000b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrAccessTokenResource.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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner; +import java.util.Map; + +/** An immutable client-side representation of CrrAccessTokenResource. */ +public interface CrrAccessTokenResource { + /** + * 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 properties property: CrrAccessTokenResource properties. + * + * @return the properties value. + */ + CrrAccessToken properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrrAccessTokenResourceInner object. + * + * @return the inner object. + */ + CrrAccessTokenResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.java new file mode 100644 index 0000000000000..2d988f5b7f535 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrJobRequest.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.recoveryservicesbackup.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; + +/** Request object for fetching CRR jobs. */ +@Fluent +public final class CrrJobRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrrJobRequest.class); + + /* + * Entire ARM resource id of the resource + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Job Name of the job to be fetched + */ + @JsonProperty(value = "jobName") + private String jobName; + + /** + * Get the resourceId property: Entire ARM resource id of the resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Entire ARM resource id of the resource. + * + * @param resourceId the resourceId value to set. + * @return the CrrJobRequest object itself. + */ + public CrrJobRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the jobName property: Job Name of the job to be fetched. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the jobName property: Job Name of the job to be fetched. + * + * @param jobName the jobName value to set. + * @return the CrrJobRequest object itself. + */ + public CrrJobRequest withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.java new file mode 100644 index 0000000000000..ba733f011f4cc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CrrOperationResults. */ +public interface CrrOperationResults { + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + void get(String azureRegion, String operationId); + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse(String azureRegion, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.java new file mode 100644 index 0000000000000..dbd96228b00f8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrrOperationStatus.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CrrOperationStatus. */ +public interface CrrOperationStatus { + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId 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. + */ + OperationStatus get(String azureRegion, String operationId); + + /** + * @param azureRegion Azure region to hit Api. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getWithResponse(String azureRegion, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java new file mode 100644 index 0000000000000..d1c3797a87da9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.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.recoveryservicesbackup.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; + +/** Daily retention format. */ +@Fluent +public final class DailyRetentionFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DailyRetentionFormat.class); + + /* + * List of days of the month. + */ + @JsonProperty(value = "daysOfTheMonth") + private List daysOfTheMonth; + + /** + * Get the daysOfTheMonth property: List of days of the month. + * + * @return the daysOfTheMonth value. + */ + public List daysOfTheMonth() { + return this.daysOfTheMonth; + } + + /** + * Set the daysOfTheMonth property: List of days of the month. + * + * @param daysOfTheMonth the daysOfTheMonth value to set. + * @return the DailyRetentionFormat object itself. + */ + public DailyRetentionFormat withDaysOfTheMonth(List daysOfTheMonth) { + this.daysOfTheMonth = daysOfTheMonth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (daysOfTheMonth() != null) { + daysOfTheMonth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java new file mode 100644 index 0000000000000..53e842e9e7649 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Daily retention schedule. */ +@Fluent +public final class DailyRetentionSchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DailyRetentionSchedule.class); + + /* + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /* + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the retentionTimes property: Retention times of retention policy. + * + * @return the retentionTimes value. + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set the retentionTimes property: Retention times of retention policy. + * + * @param retentionTimes the retentionTimes value to set. + * @return the DailyRetentionSchedule object itself. + */ + public DailyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get the retentionDuration property: Retention duration of retention Policy. + * + * @return the retentionDuration value. + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retentionDuration property: Retention duration of retention Policy. + * + * @param retentionDuration the retentionDuration value to set. + * @return the DailyRetentionSchedule object itself. + */ + public DailyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionDuration() != null) { + retentionDuration().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java new file mode 100644 index 0000000000000..399b9c0fc505e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataMoveLevel. */ +public final class DataMoveLevel extends ExpandableStringEnum { + /** Static value Invalid for DataMoveLevel. */ + public static final DataMoveLevel INVALID = fromString("Invalid"); + + /** Static value Vault for DataMoveLevel. */ + public static final DataMoveLevel VAULT = fromString("Vault"); + + /** Static value Container for DataMoveLevel. */ + public static final DataMoveLevel CONTAINER = fromString("Container"); + + /** + * Creates or finds a DataMoveLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataMoveLevel. + */ + @JsonCreator + public static DataMoveLevel fromString(String name) { + return fromString(name, DataMoveLevel.class); + } + + /** @return known DataMoveLevel values. */ + public static Collection values() { + return values(DataMoveLevel.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java new file mode 100644 index 0000000000000..d0aa1476ea926 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataSourceType. */ +public final class DataSourceType extends ExpandableStringEnum { + /** Static value Invalid for DataSourceType. */ + public static final DataSourceType INVALID = fromString("Invalid"); + + /** Static value VM for DataSourceType. */ + public static final DataSourceType VM = fromString("VM"); + + /** Static value FileFolder for DataSourceType. */ + public static final DataSourceType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for DataSourceType. */ + public static final DataSourceType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for DataSourceType. */ + public static final DataSourceType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for DataSourceType. */ + public static final DataSourceType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for DataSourceType. */ + public static final DataSourceType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for DataSourceType. */ + public static final DataSourceType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for DataSourceType. */ + public static final DataSourceType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for DataSourceType. */ + public static final DataSourceType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for DataSourceType. */ + public static final DataSourceType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for DataSourceType. */ + public static final DataSourceType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for DataSourceType. */ + public static final DataSourceType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for DataSourceType. */ + public static final DataSourceType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for DataSourceType. */ + public static final DataSourceType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a DataSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataSourceType. + */ + @JsonCreator + public static DataSourceType fromString(String name) { + return fromString(name, DataSourceType.class); + } + + /** @return known DataSourceType values. */ + public static Collection values() { + return values(DataSourceType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java new file mode 100644 index 0000000000000..6ac6d34dfe120 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.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.recoveryservicesbackup.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; + +/** Day of the week. */ +@Fluent +public final class Day { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Day.class); + + /* + * Date of the month + */ + @JsonProperty(value = "date") + private Integer date; + + /* + * Whether Date is last date of month + */ + @JsonProperty(value = "isLast") + private Boolean isLast; + + /** + * Get the date property: Date of the month. + * + * @return the date value. + */ + public Integer date() { + return this.date; + } + + /** + * Set the date property: Date of the month. + * + * @param date the date value to set. + * @return the Day object itself. + */ + public Day withDate(Integer date) { + this.date = date; + return this; + } + + /** + * Get the isLast property: Whether Date is last date of month. + * + * @return the isLast value. + */ + public Boolean isLast() { + return this.isLast; + } + + /** + * Set the isLast property: Whether Date is last date of month. + * + * @param isLast the isLast value to set. + * @return the Day object itself. + */ + public Day withIsLast(Boolean isLast) { + this.isLast = isLast; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java new file mode 100644 index 0000000000000..e8409b315280f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DayOfWeek. */ +public enum DayOfWeek { + /** Enum value Sunday. */ + SUNDAY("Sunday"), + + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"); + + /** The actual serialized value for a DayOfWeek instance. */ + private final String value; + + DayOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DayOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DayOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DayOfWeek fromString(String value) { + DayOfWeek[] items = DayOfWeek.values(); + for (DayOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java new file mode 100644 index 0000000000000..f0d1a5e8faa35 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DiskExclusionProperties model. */ +@Fluent +public final class DiskExclusionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskExclusionProperties.class); + + /* + * List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + */ + @JsonProperty(value = "diskLunList") + private List diskLunList; + + /* + * Flag to indicate whether DiskLunList is to be included/ excluded from + * backup. + */ + @JsonProperty(value = "isInclusionList") + private Boolean isInclusionList; + + /** + * Get the diskLunList property: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + * + * @return the diskLunList value. + */ + public List diskLunList() { + return this.diskLunList; + } + + /** + * Set the diskLunList property: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + * + * @param diskLunList the diskLunList value to set. + * @return the DiskExclusionProperties object itself. + */ + public DiskExclusionProperties withDiskLunList(List diskLunList) { + this.diskLunList = diskLunList; + return this; + } + + /** + * Get the isInclusionList property: Flag to indicate whether DiskLunList is to be included/ excluded from backup. + * + * @return the isInclusionList value. + */ + public Boolean isInclusionList() { + return this.isInclusionList; + } + + /** + * Set the isInclusionList property: Flag to indicate whether DiskLunList is to be included/ excluded from backup. + * + * @param isInclusionList the isInclusionList value to set. + * @return the DiskExclusionProperties object itself. + */ + public DiskExclusionProperties withIsInclusionList(Boolean isInclusionList) { + this.isInclusionList = isInclusionList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java new file mode 100644 index 0000000000000..8997cfaec0795 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.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.recoveryservicesbackup.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; + +/** Disk information. */ +@Fluent +public final class DiskInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInformation.class); + + /* + * The lun property. + */ + @JsonProperty(value = "lun") + private Integer lun; + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the lun property: The lun property. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * Set the lun property: The lun property. + * + * @param lun the lun value to set. + * @return the DiskInformation object itself. + */ + public DiskInformation withLun(Integer lun) { + this.lun = lun; + return this; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the DiskInformation object itself. + */ + public DiskInformation 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java new file mode 100644 index 0000000000000..3e36c87a3a898 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** This is used to represent the various nodes of the distributed container. */ +@Fluent +public final class DistributedNodesInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DistributedNodesInfo.class); + + /* + * Name of the node under a distributed container. + */ + @JsonProperty(value = "nodeName") + private String nodeName; + + /* + * Status of this Node. + * Failed | Succeeded + */ + @JsonProperty(value = "status") + private String status; + + /* + * Error Details if the Status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /** + * Get the nodeName property: Name of the node under a distributed container. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the nodeName property: Name of the node under a distributed container. + * + * @param nodeName the nodeName value to set. + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the status property: Status of this Node. Failed | Succeeded. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of this Node. Failed | Succeeded. + * + * @param status the status value to set. + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the errorDetail property: Error Details if the Status is non-success. + * + * @return the errorDetail value. + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set the errorDetail property: Error Details if the Status is non-success. + * + * @param errorDetail the errorDetail value to set. + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorDetail() != null) { + errorDetail().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java new file mode 100644 index 0000000000000..830fe1202c431 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Data Protection Manager (DPM) specific backup engine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") +@JsonTypeName("DpmBackupEngine") +@Immutable +public final class DpmBackupEngine extends BackupEngineBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmBackupEngine.class); + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withBackupEngineState(String backupEngineState) { + super.withBackupEngineState(backupEngineState); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withCanReRegister(Boolean canReRegister) { + super.withCanReRegister(canReRegister); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withBackupEngineId(String backupEngineId) { + super.withBackupEngineId(backupEngineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withDpmVersion(String dpmVersion) { + super.withDpmVersion(dpmVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withAzureBackupAgentVersion(String azureBackupAgentVersion) { + super.withAzureBackupAgentVersion(azureBackupAgentVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) { + super.withIsAzureBackupAgentUpgradeAvailable(isAzureBackupAgentUpgradeAvailable); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) { + super.withIsDpmUpgradeAvailable(isDpmUpgradeAvailable); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmBackupEngine withExtendedInfo(BackupEngineExtendedInfo extendedInfo) { + super.withExtendedInfo(extendedInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java new file mode 100644 index 0000000000000..ece5718bf7401 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** DPM workload-specific protection container. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "containerType", + defaultImpl = DpmContainer.class) +@JsonTypeName("DPMContainer") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureBackupServerContainer", value = AzureBackupServerContainer.class)}) +@Fluent +public class DpmContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmContainer.class); + + /* + * Specifies whether the container is re-registrable. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /* + * ID of container. + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * Number of protected items in the BackupEngine + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /* + * Backup engine Agent version + */ + @JsonProperty(value = "dpmAgentVersion") + private String dpmAgentVersion; + + /* + * List of BackupEngines protecting the container + */ + @JsonProperty(value = "dpmServers") + private List dpmServers; + + /* + * To check if upgrade available + */ + @JsonProperty(value = "upgradeAvailable") + private Boolean upgradeAvailable; + + /* + * Protection status of the container. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /* + * Extended Info of the container. + */ + @JsonProperty(value = "extendedInfo") + private DpmContainerExtendedInfo extendedInfo; + + /** + * Get the canReRegister property: Specifies whether the container is re-registrable. + * + * @return the canReRegister value. + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set the canReRegister property: Specifies whether the container is re-registrable. + * + * @param canReRegister the canReRegister value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get the containerId property: ID of container. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: ID of container. + * + * @param containerId the containerId value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the protectedItemCount property: Number of protected items in the BackupEngine. + * + * @return the protectedItemCount value. + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of protected items in the BackupEngine. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the dpmAgentVersion property: Backup engine Agent version. + * + * @return the dpmAgentVersion value. + */ + public String dpmAgentVersion() { + return this.dpmAgentVersion; + } + + /** + * Set the dpmAgentVersion property: Backup engine Agent version. + * + * @param dpmAgentVersion the dpmAgentVersion value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withDpmAgentVersion(String dpmAgentVersion) { + this.dpmAgentVersion = dpmAgentVersion; + return this; + } + + /** + * Get the dpmServers property: List of BackupEngines protecting the container. + * + * @return the dpmServers value. + */ + public List dpmServers() { + return this.dpmServers; + } + + /** + * Set the dpmServers property: List of BackupEngines protecting the container. + * + * @param dpmServers the dpmServers value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withDpmServers(List dpmServers) { + this.dpmServers = dpmServers; + return this; + } + + /** + * Get the upgradeAvailable property: To check if upgrade available. + * + * @return the upgradeAvailable value. + */ + public Boolean upgradeAvailable() { + return this.upgradeAvailable; + } + + /** + * Set the upgradeAvailable property: To check if upgrade available. + * + * @param upgradeAvailable the upgradeAvailable value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withUpgradeAvailable(Boolean upgradeAvailable) { + this.upgradeAvailable = upgradeAvailable; + return this; + } + + /** + * Get the protectionStatus property: Protection status of the container. + * + * @return the protectionStatus value. + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the protectionStatus property: Protection status of the container. + * + * @param protectionStatus the protectionStatus value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the extendedInfo property: Extended Info of the container. + * + * @return the extendedInfo value. + */ + public DpmContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended Info of the container. + * + * @param extendedInfo the extendedInfo value to set. + * @return the DpmContainer object itself. + */ + public DpmContainer withExtendedInfo(DpmContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java new file mode 100644 index 0000000000000..4df3eb82a6063 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information of the DPMContainer. */ +@Fluent +public final class DpmContainerExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmContainerExtendedInfo.class); + + /* + * Last refresh time of the DPMContainer. + */ + @JsonProperty(value = "lastRefreshedAt") + private OffsetDateTime lastRefreshedAt; + + /** + * Get the lastRefreshedAt property: Last refresh time of the DPMContainer. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the lastRefreshedAt property: Last refresh time of the DPMContainer. + * + * @param lastRefreshedAt the lastRefreshedAt value to set. + * @return the DpmContainerExtendedInfo object itself. + */ + public DpmContainerExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java new file mode 100644 index 0000000000000..2b2d3ae06e757 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** DPM workload-specific error information. */ +@Fluent +public final class DpmErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmErrorInfo.class); + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Set the errorString property: Localized error string. + * + * @param errorString the errorString value to set. + * @return the DpmErrorInfo object itself. + */ + public DpmErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: List of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set. + * @return the DpmErrorInfo object itself. + */ + public DpmErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java new file mode 100644 index 0000000000000..2ba81be219812 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** DPM workload-specific job object. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("DpmJob") +@Fluent +public final class DpmJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmJob.class); + + /* + * Time elapsed for job. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * DPM server name managing the backup item or backup job. + */ + @JsonProperty(value = "dpmServerName") + private String dpmServerName; + + /* + * Name of cluster/server protecting current backup item, if any. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * Type of container. + */ + @JsonProperty(value = "containerType") + private String containerType; + + /* + * Type of backup item. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * The state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * The errors. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Additional information for this job. + */ + @JsonProperty(value = "extendedInfo") + private DpmJobExtendedInfo extendedInfo; + + /** + * Get the duration property: Time elapsed for job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed for job. + * + * @param duration the duration value to set. + * @return the DpmJob object itself. + */ + public DpmJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the dpmServerName property: DPM server name managing the backup item or backup job. + * + * @return the dpmServerName value. + */ + public String dpmServerName() { + return this.dpmServerName; + } + + /** + * Set the dpmServerName property: DPM server name managing the backup item or backup job. + * + * @param dpmServerName the dpmServerName value to set. + * @return the DpmJob object itself. + */ + public DpmJob withDpmServerName(String dpmServerName) { + this.dpmServerName = dpmServerName; + return this; + } + + /** + * Get the containerName property: Name of cluster/server protecting current backup item, if any. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Name of cluster/server protecting current backup item, if any. + * + * @param containerName the containerName value to set. + * @return the DpmJob object itself. + */ + public DpmJob withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerType property: Type of container. + * + * @return the containerType value. + */ + public String containerType() { + return this.containerType; + } + + /** + * Set the containerType property: Type of container. + * + * @param containerType the containerType value to set. + * @return the DpmJob object itself. + */ + public DpmJob withContainerType(String containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the workloadType property: Type of backup item. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Type of backup item. + * + * @param workloadType the workloadType value to set. + * @return the DpmJob object itself. + */ + public DpmJob withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the actionsInfo property: The state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: The state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the DpmJob object itself. + */ + public DpmJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errorDetails property: The errors. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: The errors. + * + * @param errorDetails the errorDetails value to set. + * @return the DpmJob object itself. + */ + public DpmJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this job. + * + * @return the extendedInfo value. + */ + public DpmJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the DpmJob object itself. + */ + public DpmJob withExtendedInfo(DpmJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java new file mode 100644 index 0000000000000..9c7f88af76e6e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Additional information on the DPM workload-specific job. */ +@Fluent +public final class DpmJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmJobExtendedInfo.class); + + /* + * List of tasks associated with this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /* + * The job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Non localized error message on job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get the tasksList property: List of tasks associated with this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set the tasksList property: List of tasks associated with this job. + * + * @param tasksList the tasksList value to set. + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the propertyBag property: The job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: The job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message on job execution. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set the dynamicErrorMessage property: Non localized error message on job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set. + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasksList() != null) { + tasksList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java new file mode 100644 index 0000000000000..7644d20aa44fa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** DPM workload-specific job task details. */ +@Fluent +public final class DpmJobTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmJobTaskDetails.class); + + /* + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Time elapsed for task. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The task display name. + * + * @param taskId the taskId value to set. + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed for task. + * + * @param duration the duration value to set. + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status. + * + * @param status the status value to set. + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java new file mode 100644 index 0000000000000..89b3a598d9ae6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Additional information on Backup engine specific backup item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("DPMProtectedItem") +@Fluent +public final class DpmProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmProtectedItem.class); + + /* + * Friendly name of the managed item + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Backup Management server protecting this backup item + */ + @JsonProperty(value = "backupEngineName") + private String backupEngineName; + + /* + * Protection state of the backup engine + */ + @JsonProperty(value = "protectionState") + private ProtectedItemState protectionState; + + /* + * Extended info of the backup item. + */ + @JsonProperty(value = "extendedInfo") + private DpmProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendlyName property: Friendly name of the managed item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the managed item. + * + * @param friendlyName the friendlyName value to set. + * @return the DpmProtectedItem object itself. + */ + public DpmProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backupEngineName property: Backup Management server protecting this backup item. + * + * @return the backupEngineName value. + */ + public String backupEngineName() { + return this.backupEngineName; + } + + /** + * Set the backupEngineName property: Backup Management server protecting this backup item. + * + * @param backupEngineName the backupEngineName value to set. + * @return the DpmProtectedItem object itself. + */ + public DpmProtectedItem withBackupEngineName(String backupEngineName) { + this.backupEngineName = backupEngineName; + return this; + } + + /** + * Get the protectionState property: Protection state of the backup engine. + * + * @return the protectionState value. + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Protection state of the backup engine. + * + * @param protectionState the protectionState value to set. + * @return the DpmProtectedItem object itself. + */ + public DpmProtectedItem withProtectionState(ProtectedItemState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the extendedInfo property: Extended info of the backup item. + * + * @return the extendedInfo value. + */ + public DpmProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Extended info of the backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the DpmProtectedItem object itself. + */ + public DpmProtectedItem withExtendedInfo(DpmProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public DpmProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..ad750f90a100a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Additional information of DPM Protected item. */ +@Fluent +public final class DpmProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DpmProtectedItemExtendedInfo.class); + + /* + * Attribute to provide information on various DBs. + */ + @JsonProperty(value = "protectableObjectLoadPath") + private Map protectableObjectLoadPath; + + /* + * To check if backup item is disk protected. + */ + @JsonProperty(value = "protected") + private Boolean protectedProperty; + + /* + * To check if backup item is cloud protected. + */ + @JsonProperty(value = "isPresentOnCloud") + private Boolean isPresentOnCloud; + + /* + * Last backup status information on backup item. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /* + * Last refresh time on backup item. + */ + @JsonProperty(value = "lastRefreshedAt") + private OffsetDateTime lastRefreshedAt; + + /* + * Oldest cloud recovery point time. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * cloud recovery point count. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /* + * Oldest disk recovery point time. + */ + @JsonProperty(value = "onPremiseOldestRecoveryPoint") + private OffsetDateTime onPremiseOldestRecoveryPoint; + + /* + * latest disk recovery point time. + */ + @JsonProperty(value = "onPremiseLatestRecoveryPoint") + private OffsetDateTime onPremiseLatestRecoveryPoint; + + /* + * disk recovery point count. + */ + @JsonProperty(value = "onPremiseRecoveryPointCount") + private Integer onPremiseRecoveryPointCount; + + /* + * To check if backup item is collocated. + */ + @JsonProperty(value = "isCollocated") + private Boolean isCollocated; + + /* + * Protection group name of the backup item. + */ + @JsonProperty(value = "protectionGroupName") + private String protectionGroupName; + + /* + * Used Disk storage in bytes. + */ + @JsonProperty(value = "diskStorageUsedInBytes") + private String diskStorageUsedInBytes; + + /* + * total Disk storage in bytes. + */ + @JsonProperty(value = "totalDiskStorageSizeInBytes") + private String totalDiskStorageSizeInBytes; + + /** + * Get the protectableObjectLoadPath property: Attribute to provide information on various DBs. + * + * @return the protectableObjectLoadPath value. + */ + public Map protectableObjectLoadPath() { + return this.protectableObjectLoadPath; + } + + /** + * Set the protectableObjectLoadPath property: Attribute to provide information on various DBs. + * + * @param protectableObjectLoadPath the protectableObjectLoadPath value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withProtectableObjectLoadPath(Map protectableObjectLoadPath) { + this.protectableObjectLoadPath = protectableObjectLoadPath; + return this; + } + + /** + * Get the protectedProperty property: To check if backup item is disk protected. + * + * @return the protectedProperty value. + */ + public Boolean protectedProperty() { + return this.protectedProperty; + } + + /** + * Set the protectedProperty property: To check if backup item is disk protected. + * + * @param protectedProperty the protectedProperty value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withProtectedProperty(Boolean protectedProperty) { + this.protectedProperty = protectedProperty; + return this; + } + + /** + * Get the isPresentOnCloud property: To check if backup item is cloud protected. + * + * @return the isPresentOnCloud value. + */ + public Boolean isPresentOnCloud() { + return this.isPresentOnCloud; + } + + /** + * Set the isPresentOnCloud property: To check if backup item is cloud protected. + * + * @param isPresentOnCloud the isPresentOnCloud value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withIsPresentOnCloud(Boolean isPresentOnCloud) { + this.isPresentOnCloud = isPresentOnCloud; + return this; + } + + /** + * Get the lastBackupStatus property: Last backup status information on backup item. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Last backup status information on backup item. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastRefreshedAt property: Last refresh time on backup item. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the lastRefreshedAt property: Last refresh time on backup item. + * + * @param lastRefreshedAt the lastRefreshedAt value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get the oldestRecoveryPoint property: Oldest cloud recovery point time. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: Oldest cloud recovery point time. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: cloud recovery point count. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: cloud recovery point count. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the onPremiseOldestRecoveryPoint property: Oldest disk recovery point time. + * + * @return the onPremiseOldestRecoveryPoint value. + */ + public OffsetDateTime onPremiseOldestRecoveryPoint() { + return this.onPremiseOldestRecoveryPoint; + } + + /** + * Set the onPremiseOldestRecoveryPoint property: Oldest disk recovery point time. + * + * @param onPremiseOldestRecoveryPoint the onPremiseOldestRecoveryPoint value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withOnPremiseOldestRecoveryPoint(OffsetDateTime onPremiseOldestRecoveryPoint) { + this.onPremiseOldestRecoveryPoint = onPremiseOldestRecoveryPoint; + return this; + } + + /** + * Get the onPremiseLatestRecoveryPoint property: latest disk recovery point time. + * + * @return the onPremiseLatestRecoveryPoint value. + */ + public OffsetDateTime onPremiseLatestRecoveryPoint() { + return this.onPremiseLatestRecoveryPoint; + } + + /** + * Set the onPremiseLatestRecoveryPoint property: latest disk recovery point time. + * + * @param onPremiseLatestRecoveryPoint the onPremiseLatestRecoveryPoint value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withOnPremiseLatestRecoveryPoint(OffsetDateTime onPremiseLatestRecoveryPoint) { + this.onPremiseLatestRecoveryPoint = onPremiseLatestRecoveryPoint; + return this; + } + + /** + * Get the onPremiseRecoveryPointCount property: disk recovery point count. + * + * @return the onPremiseRecoveryPointCount value. + */ + public Integer onPremiseRecoveryPointCount() { + return this.onPremiseRecoveryPointCount; + } + + /** + * Set the onPremiseRecoveryPointCount property: disk recovery point count. + * + * @param onPremiseRecoveryPointCount the onPremiseRecoveryPointCount value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withOnPremiseRecoveryPointCount(Integer onPremiseRecoveryPointCount) { + this.onPremiseRecoveryPointCount = onPremiseRecoveryPointCount; + return this; + } + + /** + * Get the isCollocated property: To check if backup item is collocated. + * + * @return the isCollocated value. + */ + public Boolean isCollocated() { + return this.isCollocated; + } + + /** + * Set the isCollocated property: To check if backup item is collocated. + * + * @param isCollocated the isCollocated value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withIsCollocated(Boolean isCollocated) { + this.isCollocated = isCollocated; + return this; + } + + /** + * Get the protectionGroupName property: Protection group name of the backup item. + * + * @return the protectionGroupName value. + */ + public String protectionGroupName() { + return this.protectionGroupName; + } + + /** + * Set the protectionGroupName property: Protection group name of the backup item. + * + * @param protectionGroupName the protectionGroupName value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withProtectionGroupName(String protectionGroupName) { + this.protectionGroupName = protectionGroupName; + return this; + } + + /** + * Get the diskStorageUsedInBytes property: Used Disk storage in bytes. + * + * @return the diskStorageUsedInBytes value. + */ + public String diskStorageUsedInBytes() { + return this.diskStorageUsedInBytes; + } + + /** + * Set the diskStorageUsedInBytes property: Used Disk storage in bytes. + * + * @param diskStorageUsedInBytes the diskStorageUsedInBytes value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withDiskStorageUsedInBytes(String diskStorageUsedInBytes) { + this.diskStorageUsedInBytes = diskStorageUsedInBytes; + return this; + } + + /** + * Get the totalDiskStorageSizeInBytes property: total Disk storage in bytes. + * + * @return the totalDiskStorageSizeInBytes value. + */ + public String totalDiskStorageSizeInBytes() { + return this.totalDiskStorageSizeInBytes; + } + + /** + * Set the totalDiskStorageSizeInBytes property: total Disk storage in bytes. + * + * @param totalDiskStorageSizeInBytes the totalDiskStorageSizeInBytes value to set. + * @return the DpmProtectedItemExtendedInfo object itself. + */ + public DpmProtectedItemExtendedInfo withTotalDiskStorageSizeInBytes(String totalDiskStorageSizeInBytes) { + this.totalDiskStorageSizeInBytes = totalDiskStorageSizeInBytes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java new file mode 100644 index 0000000000000..ae4b9ff0c215e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionAtRestType. */ +public final class EncryptionAtRestType extends ExpandableStringEnum { + /** Static value Invalid for EncryptionAtRestType. */ + public static final EncryptionAtRestType INVALID = fromString("Invalid"); + + /** Static value MicrosoftManaged for EncryptionAtRestType. */ + public static final EncryptionAtRestType MICROSOFT_MANAGED = fromString("MicrosoftManaged"); + + /** Static value CustomerManaged for EncryptionAtRestType. */ + public static final EncryptionAtRestType CUSTOMER_MANAGED = fromString("CustomerManaged"); + + /** + * Creates or finds a EncryptionAtRestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionAtRestType. + */ + @JsonCreator + public static EncryptionAtRestType fromString(String name) { + return fromString(name, EncryptionAtRestType.class); + } + + /** @return known EncryptionAtRestType values. */ + public static Collection values() { + return values(EncryptionAtRestType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java new file mode 100644 index 0000000000000..45faa932eba80 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Details needed if the VM was encrypted at the time of backup. */ +@Fluent +public final class EncryptionDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionDetails.class); + + /* + * Identifies whether this backup copy represents an encrypted VM at the + * time of backup. + */ + @JsonProperty(value = "encryptionEnabled") + private Boolean encryptionEnabled; + + /* + * Key Url. + */ + @JsonProperty(value = "kekUrl") + private String kekUrl; + + /* + * Secret Url. + */ + @JsonProperty(value = "secretKeyUrl") + private String secretKeyUrl; + + /* + * ID of Key Vault where KEK is stored. + */ + @JsonProperty(value = "kekVaultId") + private String kekVaultId; + + /* + * ID of Key Vault where Secret is stored. + */ + @JsonProperty(value = "secretKeyVaultId") + private String secretKeyVaultId; + + /** + * Get the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of + * backup. + * + * @return the encryptionEnabled value. + */ + public Boolean encryptionEnabled() { + return this.encryptionEnabled; + } + + /** + * Set the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of + * backup. + * + * @param encryptionEnabled the encryptionEnabled value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withEncryptionEnabled(Boolean encryptionEnabled) { + this.encryptionEnabled = encryptionEnabled; + return this; + } + + /** + * Get the kekUrl property: Key Url. + * + * @return the kekUrl value. + */ + public String kekUrl() { + return this.kekUrl; + } + + /** + * Set the kekUrl property: Key Url. + * + * @param kekUrl the kekUrl value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekUrl(String kekUrl) { + this.kekUrl = kekUrl; + return this; + } + + /** + * Get the secretKeyUrl property: Secret Url. + * + * @return the secretKeyUrl value. + */ + public String secretKeyUrl() { + return this.secretKeyUrl; + } + + /** + * Set the secretKeyUrl property: Secret Url. + * + * @param secretKeyUrl the secretKeyUrl value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyUrl(String secretKeyUrl) { + this.secretKeyUrl = secretKeyUrl; + return this; + } + + /** + * Get the kekVaultId property: ID of Key Vault where KEK is stored. + * + * @return the kekVaultId value. + */ + public String kekVaultId() { + return this.kekVaultId; + } + + /** + * Set the kekVaultId property: ID of Key Vault where KEK is stored. + * + * @param kekVaultId the kekVaultId value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekVaultId(String kekVaultId) { + this.kekVaultId = kekVaultId; + return this; + } + + /** + * Get the secretKeyVaultId property: ID of Key Vault where Secret is stored. + * + * @return the secretKeyVaultId value. + */ + public String secretKeyVaultId() { + return this.secretKeyVaultId; + } + + /** + * Set the secretKeyVaultId property: ID of Key Vault where Secret is stored. + * + * @param secretKeyVaultId the secretKeyVaultId value to set. + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyVaultId(String secretKeyVaultId) { + this.secretKeyVaultId = secretKeyVaultId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java new file mode 100644 index 0000000000000..4ecadc588372f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnhancedSecurityState. */ +public final class EnhancedSecurityState extends ExpandableStringEnum { + /** Static value Invalid for EnhancedSecurityState. */ + public static final EnhancedSecurityState INVALID = fromString("Invalid"); + + /** Static value Enabled for EnhancedSecurityState. */ + public static final EnhancedSecurityState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnhancedSecurityState. */ + public static final EnhancedSecurityState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnhancedSecurityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnhancedSecurityState. + */ + @JsonCreator + public static EnhancedSecurityState fromString(String name) { + return fromString(name, EnhancedSecurityState.class); + } + + /** @return known EnhancedSecurityState values. */ + public static Collection values() { + return values(EnhancedSecurityState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorAdditionalInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..4d2f2f7c35d7b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorAdditionalInfo.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); + + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java new file mode 100644 index 0000000000000..f1a4b44e76d4d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Error Detail class which encapsulates Code, Message and Recommendations. */ +@Immutable +public final class ErrorDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorDetail.class); + + /* + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Error Message related to the Code. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * List of recommendation strings. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error Message related to the Code. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the recommendations property: List of recommendation strings. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java new file mode 100644 index 0000000000000..7ad2f4d6fdd64 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** This class is used to send blob details after exporting jobs. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("ExportJobsOperationResultInfo") +@Fluent +public final class ExportJobsOperationResultInfo extends OperationResultInfoBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsOperationResultInfo.class); + + /* + * URL of the blob into which the serialized string of list of jobs is + * exported. + */ + @JsonProperty(value = "blobUrl") + private String blobUrl; + + /* + * SAS key to access the blob. It expires in 15 mins. + */ + @JsonProperty(value = "blobSasKey") + private String blobSasKey; + + /* + * URL of the blob into which the ExcelFile is uploaded. + */ + @JsonProperty(value = "excelFileBlobUrl") + private String excelFileBlobUrl; + + /* + * SAS key to access the blob. It expires in 15 mins. + */ + @JsonProperty(value = "excelFileBlobSasKey") + private String excelFileBlobSasKey; + + /** + * Get the blobUrl property: URL of the blob into which the serialized string of list of jobs is exported. + * + * @return the blobUrl value. + */ + public String blobUrl() { + return this.blobUrl; + } + + /** + * Set the blobUrl property: URL of the blob into which the serialized string of list of jobs is exported. + * + * @param blobUrl the blobUrl value to set. + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobUrl(String blobUrl) { + this.blobUrl = blobUrl; + return this; + } + + /** + * Get the blobSasKey property: SAS key to access the blob. It expires in 15 mins. + * + * @return the blobSasKey value. + */ + public String blobSasKey() { + return this.blobSasKey; + } + + /** + * Set the blobSasKey property: SAS key to access the blob. It expires in 15 mins. + * + * @param blobSasKey the blobSasKey value to set. + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobSasKey(String blobSasKey) { + this.blobSasKey = blobSasKey; + return this; + } + + /** + * Get the excelFileBlobUrl property: URL of the blob into which the ExcelFile is uploaded. + * + * @return the excelFileBlobUrl value. + */ + public String excelFileBlobUrl() { + return this.excelFileBlobUrl; + } + + /** + * Set the excelFileBlobUrl property: URL of the blob into which the ExcelFile is uploaded. + * + * @param excelFileBlobUrl the excelFileBlobUrl value to set. + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withExcelFileBlobUrl(String excelFileBlobUrl) { + this.excelFileBlobUrl = excelFileBlobUrl; + return this; + } + + /** + * Get the excelFileBlobSasKey property: SAS key to access the blob. It expires in 15 mins. + * + * @return the excelFileBlobSasKey value. + */ + public String excelFileBlobSasKey() { + return this.excelFileBlobSasKey; + } + + /** + * Set the excelFileBlobSasKey property: SAS key to access the blob. It expires in 15 mins. + * + * @param excelFileBlobSasKey the excelFileBlobSasKey value to set. + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withExcelFileBlobSasKey(String excelFileBlobSasKey) { + this.excelFileBlobSasKey = excelFileBlobSasKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java new file mode 100644 index 0000000000000..aaec3ff502967 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExportJobsOperationResults. */ +public interface ExportJobsOperationResults { + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + OperationResultInfoBaseResource get(String vaultName, String resourceGroupName, String operationId); + + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized + * format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents the export job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the operation result of operation triggered by Export Jobs API. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java new file mode 100644 index 0000000000000..5d643c8694793 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.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.recoveryservicesbackup.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; + +/** Extended Properties for Azure IaasVM Backup. */ +@Fluent +public final class ExtendedProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedProperties.class); + + /* + * Extended Properties for Disk Exclusion. + */ + @JsonProperty(value = "diskExclusionProperties") + private DiskExclusionProperties diskExclusionProperties; + + /** + * Get the diskExclusionProperties property: Extended Properties for Disk Exclusion. + * + * @return the diskExclusionProperties value. + */ + public DiskExclusionProperties diskExclusionProperties() { + return this.diskExclusionProperties; + } + + /** + * Set the diskExclusionProperties property: Extended Properties for Disk Exclusion. + * + * @param diskExclusionProperties the diskExclusionProperties value to set. + * @return the ExtendedProperties object itself. + */ + public ExtendedProperties withDiskExclusionProperties(DiskExclusionProperties diskExclusionProperties) { + this.diskExclusionProperties = diskExclusionProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskExclusionProperties() != null) { + diskExclusionProperties().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java new file mode 100644 index 0000000000000..2f857eea1b5d5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FabricName. */ +public final class FabricName extends ExpandableStringEnum { + /** Static value Invalid for FabricName. */ + public static final FabricName INVALID = fromString("Invalid"); + + /** Static value Azure for FabricName. */ + public static final FabricName AZURE = fromString("Azure"); + + /** + * Creates or finds a FabricName from its string representation. + * + * @param name a name to look for. + * @return the corresponding FabricName. + */ + @JsonCreator + public static FabricName fromString(String name) { + return fromString(name, FabricName.class); + } + + /** @return known FabricName values. */ + public static Collection values() { + return values(FabricName.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java new file mode 100644 index 0000000000000..95933f269c0c6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for feature request. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "featureType", + defaultImpl = FeatureSupportRequest.class) +@JsonTypeName("FeatureSupportRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupGoals", value = AzureBackupGoalFeatureSupportRequest.class), + @JsonSubTypes.Type(name = "AzureVMResourceBackup", value = AzureVMResourceFeatureSupportRequest.class) +}) +@Immutable +public class FeatureSupportRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureSupportRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java new file mode 100644 index 0000000000000..b811ca8553855 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FeatureSupports. */ +public interface FeatureSupports { + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + AzureVMResourceFeatureSupportResponse validate(String azureRegion, FeatureSupportRequest parameters); + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Feature support request object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for feature support requests for Azure IaasVm. + */ + Response validateWithResponse( + String azureRegion, FeatureSupportRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java new file mode 100644 index 0000000000000..2033998a34d01 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Base class for generic container of backup items. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("GenericContainer") +@Fluent +public final class GenericContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericContainer.class); + + /* + * Name of the container's fabric + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /* + * Extended information (not returned in List container API calls) + */ + @JsonProperty(value = "extendedInformation") + private GenericContainerExtendedInfo extendedInformation; + + /** + * Get the fabricName property: Name of the container's fabric. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: Name of the container's fabric. + * + * @param fabricName the fabricName value to set. + * @return the GenericContainer object itself. + */ + public GenericContainer withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get the extendedInformation property: Extended information (not returned in List container API calls). + * + * @return the extendedInformation value. + */ + public GenericContainerExtendedInfo extendedInformation() { + return this.extendedInformation; + } + + /** + * Set the extendedInformation property: Extended information (not returned in List container API calls). + * + * @param extendedInformation the extendedInformation value to set. + * @return the GenericContainer object itself. + */ + public GenericContainer withExtendedInformation(GenericContainerExtendedInfo extendedInformation) { + this.extendedInformation = extendedInformation; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInformation() != null) { + extendedInformation().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java new file mode 100644 index 0000000000000..8dd2d4f050f7b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Container extended information. */ +@Fluent +public final class GenericContainerExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericContainerExtendedInfo.class); + + /* + * Public key of container cert + */ + @JsonProperty(value = "rawCertData") + private String rawCertData; + + /* + * Container identity information + */ + @JsonProperty(value = "containerIdentityInfo") + private ContainerIdentityInfo containerIdentityInfo; + + /* + * Azure Backup Service Endpoints for the container + */ + @JsonProperty(value = "serviceEndpoints") + private Map serviceEndpoints; + + /** + * Get the rawCertData property: Public key of container cert. + * + * @return the rawCertData value. + */ + public String rawCertData() { + return this.rawCertData; + } + + /** + * Set the rawCertData property: Public key of container cert. + * + * @param rawCertData the rawCertData value to set. + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withRawCertData(String rawCertData) { + this.rawCertData = rawCertData; + return this; + } + + /** + * Get the containerIdentityInfo property: Container identity information. + * + * @return the containerIdentityInfo value. + */ + public ContainerIdentityInfo containerIdentityInfo() { + return this.containerIdentityInfo; + } + + /** + * Set the containerIdentityInfo property: Container identity information. + * + * @param containerIdentityInfo the containerIdentityInfo value to set. + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withContainerIdentityInfo(ContainerIdentityInfo containerIdentityInfo) { + this.containerIdentityInfo = containerIdentityInfo; + return this; + } + + /** + * Get the serviceEndpoints property: Azure Backup Service Endpoints for the container. + * + * @return the serviceEndpoints value. + */ + public Map serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set the serviceEndpoints property: Azure Backup Service Endpoints for the container. + * + * @param serviceEndpoints the serviceEndpoints value to set. + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withServiceEndpoints(Map serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerIdentityInfo() != null) { + containerIdentityInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java new file mode 100644 index 0000000000000..8908c58972f5c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Base class for backup items. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("GenericProtectedItem") +@Fluent +public final class GenericProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericProtectedItem.class); + + /* + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /* + * Data Plane Service ID of the protected item. + */ + @JsonProperty(value = "protectedItemId") + private Long protectedItemId; + + /* + * Loosely coupled (type, value) associations (example - parent of a + * protected item) + */ + @JsonProperty(value = "sourceAssociations") + private Map sourceAssociations; + + /* + * Name of this backup item's fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Get the friendlyName property: Friendly name of the container. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the container. + * + * @param friendlyName the friendlyName value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value. + */ + public String policyState() { + return this.policyState; + } + + /** + * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the protectedItemId property: Data Plane Service ID of the protected item. + * + * @return the protectedItemId value. + */ + public Long protectedItemId() { + return this.protectedItemId; + } + + /** + * Set the protectedItemId property: Data Plane Service ID of the protected item. + * + * @param protectedItemId the protectedItemId value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withProtectedItemId(Long protectedItemId) { + this.protectedItemId = protectedItemId; + return this; + } + + /** + * Get the sourceAssociations property: Loosely coupled (type, value) associations (example - parent of a protected + * item). + * + * @return the sourceAssociations value. + */ + public Map sourceAssociations() { + return this.sourceAssociations; + } + + /** + * Set the sourceAssociations property: Loosely coupled (type, value) associations (example - parent of a protected + * item). + * + * @param sourceAssociations the sourceAssociations value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withSourceAssociations(Map sourceAssociations) { + this.sourceAssociations = sourceAssociations; + return this; + } + + /** + * Get the fabricName property: Name of this backup item's fabric. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: Name of this backup item's fabric. + * + * @param fabricName the fabricName value to set. + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java new file mode 100644 index 0000000000000..57a08f07f8981 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Azure VM (Mercury) workload-specific backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("GenericProtectionPolicy") +@Fluent +public final class GenericProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericProtectionPolicy.class); + + /* + * List of sub-protection policies which includes schedule and retention + */ + @JsonProperty(value = "subProtectionPolicy") + private List subProtectionPolicy; + + /* + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Name of this policy's fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Get the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. + * + * @return the subProtectionPolicy value. + */ + public List subProtectionPolicy() { + return this.subProtectionPolicy; + } + + /** + * Set the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. + * + * @param subProtectionPolicy the subProtectionPolicy value to set. + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { + this.subProtectionPolicy = subProtectionPolicy; + return this; + } + + /** + * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set. + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the fabricName property: Name of this policy's fabric. + * + * @return the fabricName value. + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set the fabricName property: Name of this policy's fabric. + * + * @param fabricName the fabricName value to set. + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (subProtectionPolicy() != null) { + subProtectionPolicy().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java new file mode 100644 index 0000000000000..ff4d666dddf4a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Generic backup copy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("GenericRecoveryPoint") +@Fluent +public final class GenericRecoveryPoint extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenericRecoveryPoint.class); + + /* + * Friendly name of the backup copy. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime") + private OffsetDateTime recoveryPointTime; + + /* + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo") + private String recoveryPointAdditionalInfo; + + /** + * Get the friendlyName property: Friendly name of the backup copy. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the backup copy. + * + * @param friendlyName the friendlyName value to set. + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the recoveryPointType property: Type of the backup copy. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: Type of the backup copy. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Time at which this backup copy was created. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value. + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Set the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @param recoveryPointAdditionalInfo the recoveryPointAdditionalInfo value to set. + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointAdditionalInfo(String recoveryPointAdditionalInfo) { + this.recoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.java new file mode 100644 index 0000000000000..aa97373f077ae --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthState.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthState. */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Passed for HealthState. */ + public static final HealthState PASSED = fromString("Passed"); + + /** Static value ActionRequired for HealthState. */ + public static final HealthState ACTION_REQUIRED = fromString("ActionRequired"); + + /** Static value ActionSuggested for HealthState. */ + public static final HealthState ACTION_SUGGESTED = fromString("ActionSuggested"); + + /** Static value Invalid for HealthState. */ + public static final HealthState INVALID = fromString("Invalid"); + + /** + * Creates or finds a HealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthState. + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** @return known HealthState values. */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java new file mode 100644 index 0000000000000..28b450ac0b821 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HealthStatus. */ +public final class HealthStatus extends ExpandableStringEnum { + /** Static value Passed for HealthStatus. */ + public static final HealthStatus PASSED = fromString("Passed"); + + /** Static value ActionRequired for HealthStatus. */ + public static final HealthStatus ACTION_REQUIRED = fromString("ActionRequired"); + + /** Static value ActionSuggested for HealthStatus. */ + public static final HealthStatus ACTION_SUGGESTED = fromString("ActionSuggested"); + + /** Static value Invalid for HealthStatus. */ + public static final HealthStatus INVALID = fromString("Invalid"); + + /** + * Creates or finds a HealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthStatus. + */ + @JsonCreator + public static HealthStatus fromString(String name) { + return fromString(name, HealthStatus.class); + } + + /** @return known HealthStatus values. */ + public static Collection values() { + return values(HealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java new file mode 100644 index 0000000000000..3f6d81c6b1f62 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HttpStatusCode. */ +public enum HttpStatusCode { + /** Enum value Continue. */ + CONTINUE("Continue"), + + /** Enum value SwitchingProtocols. */ + SWITCHING_PROTOCOLS("SwitchingProtocols"), + + /** Enum value OK. */ + OK("OK"), + + /** Enum value Created. */ + CREATED("Created"), + + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value NonAuthoritativeInformation. */ + NON_AUTHORITATIVE_INFORMATION("NonAuthoritativeInformation"), + + /** Enum value NoContent. */ + NO_CONTENT("NoContent"), + + /** Enum value ResetContent. */ + RESET_CONTENT("ResetContent"), + + /** Enum value PartialContent. */ + PARTIAL_CONTENT("PartialContent"), + + /** Enum value MultipleChoices. */ + MULTIPLE_CHOICES("MultipleChoices"), + + /** Enum value Ambiguous. */ + AMBIGUOUS("Ambiguous"), + + /** Enum value MovedPermanently. */ + MOVED_PERMANENTLY("MovedPermanently"), + + /** Enum value Moved. */ + MOVED("Moved"), + + /** Enum value Found. */ + FOUND("Found"), + + /** Enum value Redirect. */ + REDIRECT("Redirect"), + + /** Enum value SeeOther. */ + SEE_OTHER("SeeOther"), + + /** Enum value RedirectMethod. */ + REDIRECT_METHOD("RedirectMethod"), + + /** Enum value NotModified. */ + NOT_MODIFIED("NotModified"), + + /** Enum value UseProxy. */ + USE_PROXY("UseProxy"), + + /** Enum value Unused. */ + UNUSED("Unused"), + + /** Enum value TemporaryRedirect. */ + TEMPORARY_REDIRECT("TemporaryRedirect"), + + /** Enum value RedirectKeepVerb. */ + REDIRECT_KEEP_VERB("RedirectKeepVerb"), + + /** Enum value BadRequest. */ + BAD_REQUEST("BadRequest"), + + /** Enum value Unauthorized. */ + UNAUTHORIZED("Unauthorized"), + + /** Enum value PaymentRequired. */ + PAYMENT_REQUIRED("PaymentRequired"), + + /** Enum value Forbidden. */ + FORBIDDEN("Forbidden"), + + /** Enum value NotFound. */ + NOT_FOUND("NotFound"), + + /** Enum value MethodNotAllowed. */ + METHOD_NOT_ALLOWED("MethodNotAllowed"), + + /** Enum value NotAcceptable. */ + NOT_ACCEPTABLE("NotAcceptable"), + + /** Enum value ProxyAuthenticationRequired. */ + PROXY_AUTHENTICATION_REQUIRED("ProxyAuthenticationRequired"), + + /** Enum value RequestTimeout. */ + REQUEST_TIMEOUT("RequestTimeout"), + + /** Enum value Conflict. */ + CONFLICT("Conflict"), + + /** Enum value Gone. */ + GONE("Gone"), + + /** Enum value LengthRequired. */ + LENGTH_REQUIRED("LengthRequired"), + + /** Enum value PreconditionFailed. */ + PRECONDITION_FAILED("PreconditionFailed"), + + /** Enum value RequestEntityTooLarge. */ + REQUEST_ENTITY_TOO_LARGE("RequestEntityTooLarge"), + + /** Enum value RequestUriTooLong. */ + REQUEST_URI_TOO_LONG("RequestUriTooLong"), + + /** Enum value UnsupportedMediaType. */ + UNSUPPORTED_MEDIA_TYPE("UnsupportedMediaType"), + + /** Enum value RequestedRangeNotSatisfiable. */ + REQUESTED_RANGE_NOT_SATISFIABLE("RequestedRangeNotSatisfiable"), + + /** Enum value ExpectationFailed. */ + EXPECTATION_FAILED("ExpectationFailed"), + + /** Enum value UpgradeRequired. */ + UPGRADE_REQUIRED("UpgradeRequired"), + + /** Enum value InternalServerError. */ + INTERNAL_SERVER_ERROR("InternalServerError"), + + /** Enum value NotImplemented. */ + NOT_IMPLEMENTED("NotImplemented"), + + /** Enum value BadGateway. */ + BAD_GATEWAY("BadGateway"), + + /** Enum value ServiceUnavailable. */ + SERVICE_UNAVAILABLE("ServiceUnavailable"), + + /** Enum value GatewayTimeout. */ + GATEWAY_TIMEOUT("GatewayTimeout"), + + /** Enum value HttpVersionNotSupported. */ + HTTP_VERSION_NOT_SUPPORTED("HttpVersionNotSupported"); + + /** The actual serialized value for a HttpStatusCode instance. */ + private final String value; + + HttpStatusCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpStatusCode instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpStatusCode object, or null if unable to parse. + */ + @JsonCreator + public static HttpStatusCode fromString(String value) { + HttpStatusCode[] items = HttpStatusCode.values(); + for (HttpStatusCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java new file mode 100644 index 0000000000000..98968a7dc590d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific container. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "containerType", + defaultImpl = IaaSvmContainer.class) +@JsonTypeName("IaaSVMContainer") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "Microsoft.ClassicCompute/virtualMachines", + value = AzureIaaSClassicComputeVMContainer.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMContainer.class) +}) +@Fluent +public class IaaSvmContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaaSvmContainer.class); + + /* + * Fully qualified ARM url of the virtual machine represented by this Azure + * IaaS VM container. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /* + * Specifies whether the container represents a Classic or an Azure + * Resource Manager VM. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /* + * Resource group name of Recovery Services Vault. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get the virtualMachineId property: Fully qualified ARM url of the virtual machine represented by this Azure IaaS + * VM container. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the virtualMachineId property: Fully qualified ARM url of the virtual machine represented by this Azure IaaS + * VM container. + * + * @param virtualMachineId the virtualMachineId value to set. + * @return the IaaSvmContainer object itself. + */ + public IaaSvmContainer withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource + * Manager VM. + * + * @return the virtualMachineVersion value. + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource + * Manager VM. + * + * @param virtualMachineVersion the virtualMachineVersion value to set. + * @return the IaaSvmContainer object itself. + */ + public IaaSvmContainer withVirtualMachineVersion(String virtualMachineVersion) { + this.virtualMachineVersion = virtualMachineVersion; + return this; + } + + /** + * Get the resourceGroup property: Resource group name of Recovery Services Vault. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Resource group name of Recovery Services Vault. + * + * @param resourceGroup the resourceGroup value to set. + * @return the IaaSvmContainer object itself. + */ + public IaaSvmContainer withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmProtectableItem.java new file mode 100644 index 0000000000000..fbaa4e9726f5a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmProtectableItem.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific backup item. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectableItemType", + defaultImpl = IaaSvmProtectableItem.class) +@JsonTypeName("IaaSVMProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "Microsoft.ClassicCompute/virtualMachines", + value = AzureIaaSClassicComputeVMProtectableItem.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectableItem.class) +}) +@Fluent +public class IaaSvmProtectableItem extends WorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaaSvmProtectableItem.class); + + /* + * Fully qualified ARM ID of the virtual machine. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine. + * + * @param virtualMachineId the virtualMachineId value to set. + * @return the IaaSvmProtectableItem object itself. + */ + public IaaSvmProtectableItem withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmProtectableItem withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmProtectableItem withWorkloadType(String workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmProtectableItem withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaaSvmProtectableItem withProtectionState(ProtectionStatus protectionState) { + super.withProtectionState(protectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java new file mode 100644 index 0000000000000..046f36abb1691 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** IaaS VM workload-specific backup request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMBackupRequest") +@Fluent +public final class IaasVMBackupRequest extends BackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMBackupRequest.class); + + /* + * Backup copy will expire after the time specified (UTC). + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private OffsetDateTime recoveryPointExpiryTimeInUtc; + + /** + * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @return the recoveryPointExpiryTimeInUtc value. + */ + public OffsetDateTime recoveryPointExpiryTimeInUtc() { + return this.recoveryPointExpiryTimeInUtc; + } + + /** + * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). + * + * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. + * @return the IaasVMBackupRequest object itself. + */ + public IaasVMBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { + this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java new file mode 100644 index 0000000000000..dd851ac1717f0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** IaaS VM workload specific backup copy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMRecoveryPoint") +@Fluent +public final class IaasVMRecoveryPoint extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMRecoveryPoint.class); + + /* + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime") + private OffsetDateTime recoveryPointTime; + + /* + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo") + private String recoveryPointAdditionalInfo; + + /* + * Storage type of the VM whose backup copy is created. + */ + @JsonProperty(value = "sourceVMStorageType") + private String sourceVMStorageType; + + /* + * Identifies whether the VM was encrypted when the backup copy is created. + */ + @JsonProperty(value = "isSourceVMEncrypted") + private Boolean isSourceVMEncrypted; + + /* + * Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + */ + @JsonProperty(value = "keyAndSecret") + private KeyAndSecretDetails keyAndSecret; + + /* + * Is the session to recover items from this backup copy still active. + */ + @JsonProperty(value = "isInstantIlrSessionActive") + private Boolean isInstantIlrSessionActive; + + /* + * Recovery point tier information. + */ + @JsonProperty(value = "recoveryPointTierDetails") + private List recoveryPointTierDetails; + + /* + * Whether VM is with Managed Disks + */ + @JsonProperty(value = "isManagedVirtualMachine") + private Boolean isManagedVirtualMachine; + + /* + * Virtual Machine Size + */ + @JsonProperty(value = "virtualMachineSize") + private String virtualMachineSize; + + /* + * Original Storage Account Option + */ + @JsonProperty(value = "originalStorageAccountOption") + private Boolean originalStorageAccountOption; + + /* + * OS type + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * Disk configuration + */ + @JsonProperty(value = "recoveryPointDiskConfiguration") + private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; + + /* + * Identifies the zone of the VM at the time of backup. Applicable only for + * zone-pinned Vms + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Eligibility of RP to be moved to another tier + */ + @JsonProperty(value = "recoveryPointMoveReadinessInfo") + private Map recoveryPointMoveReadinessInfo; + + /** + * Get the recoveryPointType property: Type of the backup copy. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set the recoveryPointType property: Type of the backup copy. + * + * @param recoveryPointType the recoveryPointType value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the recoveryPointTime property: Time at which this backup copy was created. + * + * @param recoveryPointTime the recoveryPointTime value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointTime(OffsetDateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value. + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Set the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @param recoveryPointAdditionalInfo the recoveryPointAdditionalInfo value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointAdditionalInfo(String recoveryPointAdditionalInfo) { + this.recoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + return this; + } + + /** + * Get the sourceVMStorageType property: Storage type of the VM whose backup copy is created. + * + * @return the sourceVMStorageType value. + */ + public String sourceVMStorageType() { + return this.sourceVMStorageType; + } + + /** + * Set the sourceVMStorageType property: Storage type of the VM whose backup copy is created. + * + * @param sourceVMStorageType the sourceVMStorageType value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withSourceVMStorageType(String sourceVMStorageType) { + this.sourceVMStorageType = sourceVMStorageType; + return this; + } + + /** + * Get the isSourceVMEncrypted property: Identifies whether the VM was encrypted when the backup copy is created. + * + * @return the isSourceVMEncrypted value. + */ + public Boolean isSourceVMEncrypted() { + return this.isSourceVMEncrypted; + } + + /** + * Set the isSourceVMEncrypted property: Identifies whether the VM was encrypted when the backup copy is created. + * + * @param isSourceVMEncrypted the isSourceVMEncrypted value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsSourceVMEncrypted(Boolean isSourceVMEncrypted) { + this.isSourceVMEncrypted = isSourceVMEncrypted; + return this; + } + + /** + * Get the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + * + * @return the keyAndSecret value. + */ + public KeyAndSecretDetails keyAndSecret() { + return this.keyAndSecret; + } + + /** + * Set the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + * + * @param keyAndSecret the keyAndSecret value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withKeyAndSecret(KeyAndSecretDetails keyAndSecret) { + this.keyAndSecret = keyAndSecret; + return this; + } + + /** + * Get the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. + * + * @return the isInstantIlrSessionActive value. + */ + public Boolean isInstantIlrSessionActive() { + return this.isInstantIlrSessionActive; + } + + /** + * Set the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. + * + * @param isInstantIlrSessionActive the isInstantIlrSessionActive value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsInstantIlrSessionActive(Boolean isInstantIlrSessionActive) { + this.isInstantIlrSessionActive = isInstantIlrSessionActive; + return this; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set the recoveryPointTierDetails property: Recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get the isManagedVirtualMachine property: Whether VM is with Managed Disks. + * + * @return the isManagedVirtualMachine value. + */ + public Boolean isManagedVirtualMachine() { + return this.isManagedVirtualMachine; + } + + /** + * Set the isManagedVirtualMachine property: Whether VM is with Managed Disks. + * + * @param isManagedVirtualMachine the isManagedVirtualMachine value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsManagedVirtualMachine(Boolean isManagedVirtualMachine) { + this.isManagedVirtualMachine = isManagedVirtualMachine; + return this; + } + + /** + * Get the virtualMachineSize property: Virtual Machine Size. + * + * @return the virtualMachineSize value. + */ + public String virtualMachineSize() { + return this.virtualMachineSize; + } + + /** + * Set the virtualMachineSize property: Virtual Machine Size. + * + * @param virtualMachineSize the virtualMachineSize value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withVirtualMachineSize(String virtualMachineSize) { + this.virtualMachineSize = virtualMachineSize; + return this; + } + + /** + * Get the originalStorageAccountOption property: Original Storage Account Option. + * + * @return the originalStorageAccountOption value. + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set the originalStorageAccountOption property: Original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get the osType property: OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: OS type. + * + * @param osType the osType value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the recoveryPointDiskConfiguration property: Disk configuration. + * + * @return the recoveryPointDiskConfiguration value. + */ + public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { + return this.recoveryPointDiskConfiguration; + } + + /** + * Set the recoveryPointDiskConfiguration property: Disk configuration. + * + * @param recoveryPointDiskConfiguration the recoveryPointDiskConfiguration value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointDiskConfiguration( + RecoveryPointDiskConfiguration recoveryPointDiskConfiguration) { + this.recoveryPointDiskConfiguration = recoveryPointDiskConfiguration; + return this; + } + + /** + * Get the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. + * + * @param zones the zones value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyAndSecret() != null) { + keyAndSecret().validate(); + } + if (recoveryPointTierDetails() != null) { + recoveryPointTierDetails().forEach(e -> e.validate()); + } + if (recoveryPointDiskConfiguration() != null) { + recoveryPointDiskConfiguration().validate(); + } + if (recoveryPointMoveReadinessInfo() != null) { + recoveryPointMoveReadinessInfo() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java new file mode 100644 index 0000000000000..e7209bd5ba5c4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPointAutoGenerated.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** IaaS VM workload specific backup copy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMRecoveryPoint") +@Fluent +public final class IaasVMRecoveryPointAutoGenerated extends RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMRecoveryPointAutoGenerated.class); + + /* + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointType; + + /* + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime recoveryPointTime; + + /* + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointAdditionalInfo; + + /* + * Storage type of the VM whose backup copy is created. + */ + @JsonProperty(value = "sourceVMStorageType", access = JsonProperty.Access.WRITE_ONLY) + private String sourceVMStorageType; + + /* + * Identifies whether the VM was encrypted when the backup copy is created. + */ + @JsonProperty(value = "isSourceVMEncrypted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isSourceVMEncrypted; + + /* + * Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + */ + @JsonProperty(value = "keyAndSecret") + private KeyAndSecretDetails keyAndSecret; + + /* + * Is the session to recover items from this backup copy still active. + */ + @JsonProperty(value = "isInstantIlrSessionActive") + private Boolean isInstantIlrSessionActive; + + /* + * Recovery point tier information. + */ + @JsonProperty(value = "recoveryPointTierDetails") + private List recoveryPointTierDetails; + + /* + * Whether VM is with Managed Disks + */ + @JsonProperty(value = "isManagedVirtualMachine") + private Boolean isManagedVirtualMachine; + + /* + * Virtual Machine Size + */ + @JsonProperty(value = "virtualMachineSize") + private String virtualMachineSize; + + /* + * Original Storage Account Option + */ + @JsonProperty(value = "originalStorageAccountOption") + private Boolean originalStorageAccountOption; + + /* + * OS type + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * Disk configuration + */ + @JsonProperty(value = "recoveryPointDiskConfiguration") + private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; + + /* + * Identifies the zone of the VM at the time of backup. Applicable only for + * zone-pinned Vms + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Eligibility of RP to be moved to another tier + */ + @JsonProperty(value = "recoveryPointMoveReadinessInfo") + private Map recoveryPointMoveReadinessInfo; + + /** + * Get the recoveryPointType property: Type of the backup copy. + * + * @return the recoveryPointType value. + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get the recoveryPointTime property: Time at which this backup copy was created. + * + * @return the recoveryPointTime value. + */ + public OffsetDateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value. + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Get the sourceVMStorageType property: Storage type of the VM whose backup copy is created. + * + * @return the sourceVMStorageType value. + */ + public String sourceVMStorageType() { + return this.sourceVMStorageType; + } + + /** + * Get the isSourceVMEncrypted property: Identifies whether the VM was encrypted when the backup copy is created. + * + * @return the isSourceVMEncrypted value. + */ + public Boolean isSourceVMEncrypted() { + return this.isSourceVMEncrypted; + } + + /** + * Get the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + * + * @return the keyAndSecret value. + */ + public KeyAndSecretDetails keyAndSecret() { + return this.keyAndSecret; + } + + /** + * Set the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + * + * @param keyAndSecret the keyAndSecret value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withKeyAndSecret(KeyAndSecretDetails keyAndSecret) { + this.keyAndSecret = keyAndSecret; + return this; + } + + /** + * Get the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. + * + * @return the isInstantIlrSessionActive value. + */ + public Boolean isInstantIlrSessionActive() { + return this.isInstantIlrSessionActive; + } + + /** + * Set the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. + * + * @param isInstantIlrSessionActive the isInstantIlrSessionActive value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withIsInstantIlrSessionActive(Boolean isInstantIlrSessionActive) { + this.isInstantIlrSessionActive = isInstantIlrSessionActive; + return this; + } + + /** + * Get the recoveryPointTierDetails property: Recovery point tier information. + * + * @return the recoveryPointTierDetails value. + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set the recoveryPointTierDetails property: Recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withRecoveryPointTierDetails( + List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get the isManagedVirtualMachine property: Whether VM is with Managed Disks. + * + * @return the isManagedVirtualMachine value. + */ + public Boolean isManagedVirtualMachine() { + return this.isManagedVirtualMachine; + } + + /** + * Set the isManagedVirtualMachine property: Whether VM is with Managed Disks. + * + * @param isManagedVirtualMachine the isManagedVirtualMachine value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withIsManagedVirtualMachine(Boolean isManagedVirtualMachine) { + this.isManagedVirtualMachine = isManagedVirtualMachine; + return this; + } + + /** + * Get the virtualMachineSize property: Virtual Machine Size. + * + * @return the virtualMachineSize value. + */ + public String virtualMachineSize() { + return this.virtualMachineSize; + } + + /** + * Set the virtualMachineSize property: Virtual Machine Size. + * + * @param virtualMachineSize the virtualMachineSize value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withVirtualMachineSize(String virtualMachineSize) { + this.virtualMachineSize = virtualMachineSize; + return this; + } + + /** + * Get the originalStorageAccountOption property: Original Storage Account Option. + * + * @return the originalStorageAccountOption value. + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set the originalStorageAccountOption property: Original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get the osType property: OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: OS type. + * + * @param osType the osType value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the recoveryPointDiskConfiguration property: Disk configuration. + * + * @return the recoveryPointDiskConfiguration value. + */ + public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { + return this.recoveryPointDiskConfiguration; + } + + /** + * Set the recoveryPointDiskConfiguration property: Disk configuration. + * + * @param recoveryPointDiskConfiguration the recoveryPointDiskConfiguration value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withRecoveryPointDiskConfiguration( + RecoveryPointDiskConfiguration recoveryPointDiskConfiguration) { + this.recoveryPointDiskConfiguration = recoveryPointDiskConfiguration; + return this; + } + + /** + * Get the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. + * + * @param zones the zones value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @return the recoveryPointMoveReadinessInfo value. + */ + public Map recoveryPointMoveReadinessInfo() { + return this.recoveryPointMoveReadinessInfo; + } + + /** + * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. + * + * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. + * @return the IaasVMRecoveryPointAutoGenerated object itself. + */ + public IaasVMRecoveryPointAutoGenerated withRecoveryPointMoveReadinessInfo( + Map recoveryPointMoveReadinessInfo) { + this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyAndSecret() != null) { + keyAndSecret().validate(); + } + if (recoveryPointTierDetails() != null) { + recoveryPointTierDetails().forEach(e -> e.validate()); + } + if (recoveryPointDiskConfiguration() != null) { + recoveryPointDiskConfiguration().validate(); + } + if (recoveryPointMoveReadinessInfo() != null) { + recoveryPointMoveReadinessInfo() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java new file mode 100644 index 0000000000000..0aaa92b8d7bf9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** IaaS VM workload-specific restore. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = IaasVMRestoreRequest.class) +@JsonTypeName("IaasVMRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaasVMRestoreWithRehydrationRequest", value = IaasVMRestoreWithRehydrationRequest.class) +}) +@Fluent +public class IaasVMRestoreRequest extends RestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMRestoreRequest.class); + + /* + * ID of the backup copy to be recovered. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Type of this recovery. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /* + * Fully qualified ARM ID of the VM which is being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * This is the complete ARM Id of the VM that will be created. + * For e.g. + * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + */ + @JsonProperty(value = "targetVirtualMachineId") + private String targetVirtualMachineId; + + /* + * This is the ARM Id of the resource group that you want to create for + * this Virtual machine and other artifacts. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg} + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /* + * Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * This is the virtual network Id of the vnet that will be attached to the + * virtual machine. + * User will be validated for join action permissions in the linked access. + */ + @JsonProperty(value = "virtualNetworkId") + private String virtualNetworkId; + + /* + * Subnet ID, is the subnet ID associated with the to be restored VM. For + * Classic VMs it would be + * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it + * would be ARM resource ID used to represent + * the subnet. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /* + * Fully qualified ARM ID of the domain name to be associated to the VM + * being restored. This applies only to Classic + * Virtual Machines. + */ + @JsonProperty(value = "targetDomainNameId") + private String targetDomainNameId; + + /* + * Region in which the virtual machine is restored. + */ + @JsonProperty(value = "region") + private String region; + + /* + * Affinity group associated to VM to be restored. Used only for Classic + * Compute Virtual Machines. + */ + @JsonProperty(value = "affinityGroup") + private String affinityGroup; + + /* + * Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same + * cloud service as it was at the time of backup. + */ + @JsonProperty(value = "createNewCloudService") + private Boolean createNewCloudService; + + /* + * Original Storage Account Option + */ + @JsonProperty(value = "originalStorageAccountOption") + private Boolean originalStorageAccountOption; + + /* + * Details needed if the VM was encrypted at the time of backup. + */ + @JsonProperty(value = "encryptionDetails") + private EncryptionDetails encryptionDetails; + + /* + * List of Disk LUNs for partial restore + */ + @JsonProperty(value = "restoreDiskLunList") + private List restoreDiskLunList; + + /* + * Flag to denote of an Unmanaged disk VM should be restored with Managed + * disks. + */ + @JsonProperty(value = "restoreWithManagedDisks") + private Boolean restoreWithManagedDisks; + + /* + * DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest + * during restore with customer managed key. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * Target zone where the VM and its disks should be restored. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the recoveryPointId property: ID of the backup copy to be recovered. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: ID of the backup copy to be recovered. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the recoveryType property: Type of this recovery. + * + * @return the recoveryType value. + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the recoveryType property: Type of this recovery. + * + * @param recoveryType the recoveryType value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. For e.g. + * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @return the targetVirtualMachineId value. + */ + public String targetVirtualMachineId() { + return this.targetVirtualMachineId; + } + + /** + * Set the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. For e.g. + * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @param targetVirtualMachineId the targetVirtualMachineId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + this.targetVirtualMachineId = targetVirtualMachineId; + return this; + } + + /** + * Get the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this + * Virtual machine and other artifacts. For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + * + * @return the targetResourceGroupId value. + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this + * Virtual machine and other artifacts. For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + * + * @param targetResourceGroupId the targetResourceGroupId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + * + * @param storageAccountId the storageAccountId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the + * virtual machine. User will be validated for join action permissions in the linked access. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.virtualNetworkId; + } + + /** + * Set the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the + * virtual machine. User will be validated for join action permissions in the linked access. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withVirtualNetworkId(String virtualNetworkId) { + this.virtualNetworkId = virtualNetworkId; + return this; + } + + /** + * Get the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it + * would be {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to + * represent the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it + * would be {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to + * represent the subnet. + * + * @param subnetId the subnetId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being + * restored. This applies only to Classic Virtual Machines. + * + * @return the targetDomainNameId value. + */ + public String targetDomainNameId() { + return this.targetDomainNameId; + } + + /** + * Set the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being + * restored. This applies only to Classic Virtual Machines. + * + * @param targetDomainNameId the targetDomainNameId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetDomainNameId(String targetDomainNameId) { + this.targetDomainNameId = targetDomainNameId; + return this; + } + + /** + * Get the region property: Region in which the virtual machine is restored. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region in which the virtual machine is restored. + * + * @param region the region value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute + * Virtual Machines. + * + * @return the affinityGroup value. + */ + public String affinityGroup() { + return this.affinityGroup; + } + + /** + * Set the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute + * Virtual Machines. + * + * @param affinityGroup the affinityGroup value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withAffinityGroup(String affinityGroup) { + this.affinityGroup = affinityGroup; + return this; + } + + /** + * Get the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same cloud service as it was at the time of backup. + * + * @return the createNewCloudService value. + */ + public Boolean createNewCloudService() { + return this.createNewCloudService; + } + + /** + * Set the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same cloud service as it was at the time of backup. + * + * @param createNewCloudService the createNewCloudService value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withCreateNewCloudService(Boolean createNewCloudService) { + this.createNewCloudService = createNewCloudService; + return this; + } + + /** + * Get the originalStorageAccountOption property: Original Storage Account Option. + * + * @return the originalStorageAccountOption value. + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set the originalStorageAccountOption property: Original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. + * + * @return the encryptionDetails value. + */ + public EncryptionDetails encryptionDetails() { + return this.encryptionDetails; + } + + /** + * Set the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. + * + * @param encryptionDetails the encryptionDetails value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { + this.encryptionDetails = encryptionDetails; + return this; + } + + /** + * Get the restoreDiskLunList property: List of Disk LUNs for partial restore. + * + * @return the restoreDiskLunList value. + */ + public List restoreDiskLunList() { + return this.restoreDiskLunList; + } + + /** + * Set the restoreDiskLunList property: List of Disk LUNs for partial restore. + * + * @param restoreDiskLunList the restoreDiskLunList value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRestoreDiskLunList(List restoreDiskLunList) { + this.restoreDiskLunList = restoreDiskLunList; + return this; + } + + /** + * Get the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed + * disks. + * + * @return the restoreWithManagedDisks value. + */ + public Boolean restoreWithManagedDisks() { + return this.restoreWithManagedDisks; + } + + /** + * Set the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed + * disks. + * + * @param restoreWithManagedDisks the restoreWithManagedDisks value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRestoreWithManagedDisks(Boolean restoreWithManagedDisks) { + this.restoreWithManagedDisks = restoreWithManagedDisks; + return this; + } + + /** + * Get the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest + * during restore with customer managed key. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest + * during restore with customer managed key. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the zones property: Target zone where the VM and its disks should be restored. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Target zone where the VM and its disks should be restored. + * + * @param zones the zones value to set. + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (encryptionDetails() != null) { + encryptionDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java new file mode 100644 index 0000000000000..96468215adb5a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** IaaS VM workload-specific restore with integrated rehydration of recovery point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMRestoreWithRehydrationRequest") +@Fluent +public final class IaasVMRestoreWithRehydrationRequest extends IaasVMRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVMRestoreWithRehydrationRequest.class); + + /* + * RP Rehydration Info + */ + @JsonProperty(value = "recoveryPointRehydrationInfo") + private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; + + /** + * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @return the recoveryPointRehydrationInfo value. + */ + public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { + return this.recoveryPointRehydrationInfo; + } + + /** + * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. + * + * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. + * @return the IaasVMRestoreWithRehydrationRequest object itself. + */ + public IaasVMRestoreWithRehydrationRequest withRecoveryPointRehydrationInfo( + RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { + this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withRecoveryPointId(String recoveryPointId) { + super.withRecoveryPointId(recoveryPointId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withRecoveryType(RecoveryType recoveryType) { + super.withRecoveryType(recoveryType); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + super.withTargetVirtualMachineId(targetVirtualMachineId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withTargetResourceGroupId(String targetResourceGroupId) { + super.withTargetResourceGroupId(targetResourceGroupId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withStorageAccountId(String storageAccountId) { + super.withStorageAccountId(storageAccountId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withVirtualNetworkId(String virtualNetworkId) { + super.withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withSubnetId(String subnetId) { + super.withSubnetId(subnetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withTargetDomainNameId(String targetDomainNameId) { + super.withTargetDomainNameId(targetDomainNameId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withRegion(String region) { + super.withRegion(region); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withAffinityGroup(String affinityGroup) { + super.withAffinityGroup(affinityGroup); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withCreateNewCloudService(Boolean createNewCloudService) { + super.withCreateNewCloudService(createNewCloudService); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + super.withOriginalStorageAccountOption(originalStorageAccountOption); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { + super.withEncryptionDetails(encryptionDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withRestoreDiskLunList(List restoreDiskLunList) { + super.withRestoreDiskLunList(restoreDiskLunList); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withRestoreWithManagedDisks(Boolean restoreWithManagedDisks) { + super.withRestoreWithManagedDisks(restoreWithManagedDisks); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withDiskEncryptionSetId(String diskEncryptionSetId) { + super.withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public IaasVMRestoreWithRehydrationRequest withZones(List zones) { + super.withZones(zones); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryPointRehydrationInfo() != null) { + recoveryPointRehydrationInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java new file mode 100644 index 0000000000000..c2e2ea74a07f2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Restore files/folders from a backup copy of IaaS VM. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMILRRegistrationRequest") +@Fluent +public final class IaasVmilrRegistrationRequest extends IlrRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IaasVmilrRegistrationRequest.class); + + /* + * ID of the IaaS VM backup copy from where the files/folders have to be + * restored. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /* + * Fully qualified ARM ID of the virtual machine whose the files / folders + * have to be restored. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /* + * iSCSI initiator name. + */ + @JsonProperty(value = "initiatorName") + private String initiatorName; + + /* + * Whether to renew existing registration with the iSCSI server. + */ + @JsonProperty(value = "renewExistingRegistration") + private Boolean renewExistingRegistration; + + /** + * Get the recoveryPointId property: ID of the IaaS VM backup copy from where the files/folders have to be restored. + * + * @return the recoveryPointId value. + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the recoveryPointId property: ID of the IaaS VM backup copy from where the files/folders have to be restored. + * + * @param recoveryPointId the recoveryPointId value to set. + * @return the IaasVmilrRegistrationRequest object itself. + */ + public IaasVmilrRegistrationRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine whose the files / folders have + * to be restored. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine whose the files / folders have + * to be restored. + * + * @param virtualMachineId the virtualMachineId value to set. + * @return the IaasVmilrRegistrationRequest object itself. + */ + public IaasVmilrRegistrationRequest withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get the initiatorName property: iSCSI initiator name. + * + * @return the initiatorName value. + */ + public String initiatorName() { + return this.initiatorName; + } + + /** + * Set the initiatorName property: iSCSI initiator name. + * + * @param initiatorName the initiatorName value to set. + * @return the IaasVmilrRegistrationRequest object itself. + */ + public IaasVmilrRegistrationRequest withInitiatorName(String initiatorName) { + this.initiatorName = initiatorName; + return this; + } + + /** + * Get the renewExistingRegistration property: Whether to renew existing registration with the iSCSI server. + * + * @return the renewExistingRegistration value. + */ + public Boolean renewExistingRegistration() { + return this.renewExistingRegistration; + } + + /** + * Set the renewExistingRegistration property: Whether to renew existing registration with the iSCSI server. + * + * @param renewExistingRegistration the renewExistingRegistration value to set. + * @return the IaasVmilrRegistrationRequest object itself. + */ + public IaasVmilrRegistrationRequest withRenewExistingRegistration(Boolean renewExistingRegistration) { + this.renewExistingRegistration = renewExistingRegistration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java new file mode 100644 index 0000000000000..7b28171409375 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Parameters to Provision ILR API. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = IlrRequest.class) +@JsonTypeName("IlrRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareProvisionILRRequest", value = AzureFileShareProvisionIlrRequest.class), + @JsonSubTypes.Type(name = "IaasVMILRRegistrationRequest", value = IaasVmilrRegistrationRequest.class) +}) +@Immutable +public class IlrRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IlrRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java new file mode 100644 index 0000000000000..660bea8fa3302 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters to Provision ILR API. */ +@Fluent +public final class IlrRequestResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IlrRequestResource.class); + + /* + * ILRRequestResource properties + */ + @JsonProperty(value = "properties") + private IlrRequest properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: ILRRequestResource properties. + * + * @return the properties value. + */ + public IlrRequest properties() { + return this.properties; + } + + /** + * Set the properties property: ILRRequestResource properties. + * + * @param properties the properties value to set. + * @return the IlrRequestResource object itself. + */ + public IlrRequestResource withProperties(IlrRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the IlrRequestResource object itself. + */ + public IlrRequestResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public IlrRequestResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IlrRequestResource withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java new file mode 100644 index 0000000000000..324f2471699a6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InfrastructureEncryptionState. */ +public final class InfrastructureEncryptionState extends ExpandableStringEnum { + /** Static value Invalid for InfrastructureEncryptionState. */ + public static final InfrastructureEncryptionState INVALID = fromString("Invalid"); + + /** Static value Disabled for InfrastructureEncryptionState. */ + public static final InfrastructureEncryptionState DISABLED = fromString("Disabled"); + + /** Static value Enabled for InfrastructureEncryptionState. */ + public static final InfrastructureEncryptionState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a InfrastructureEncryptionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InfrastructureEncryptionState. + */ + @JsonCreator + public static InfrastructureEncryptionState fromString(String name) { + return fromString(name, InfrastructureEncryptionState.class); + } + + /** @return known InfrastructureEncryptionState values. */ + public static Collection values() { + return values(InfrastructureEncryptionState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java new file mode 100644 index 0000000000000..cece3acb31ab7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Details about inquired protectable items under a given container. */ +@Fluent +public final class InquiryInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InquiryInfo.class); + + /* + * Inquiry Status for this container such as + * InProgress | Failed | Succeeded + */ + @JsonProperty(value = "status") + private String status; + + /* + * Error Details if the Status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /* + * Inquiry Details which will have workload specific details. + * For e.g. - For SQL and oracle this will contain different details. + */ + @JsonProperty(value = "inquiryDetails") + private List inquiryDetails; + + /** + * Get the status property: Inquiry Status for this container such as InProgress | Failed | Succeeded. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Inquiry Status for this container such as InProgress | Failed | Succeeded. + * + * @param status the status value to set. + * @return the InquiryInfo object itself. + */ + public InquiryInfo withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the errorDetail property: Error Details if the Status is non-success. + * + * @return the errorDetail value. + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set the errorDetail property: Error Details if the Status is non-success. + * + * @param errorDetail the errorDetail value to set. + * @return the InquiryInfo object itself. + */ + public InquiryInfo withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + + /** + * Get the inquiryDetails property: Inquiry Details which will have workload specific details. For e.g. - For SQL + * and oracle this will contain different details. + * + * @return the inquiryDetails value. + */ + public List inquiryDetails() { + return this.inquiryDetails; + } + + /** + * Set the inquiryDetails property: Inquiry Details which will have workload specific details. For e.g. - For SQL + * and oracle this will contain different details. + * + * @param inquiryDetails the inquiryDetails value to set. + * @return the InquiryInfo object itself. + */ + public InquiryInfo withInquiryDetails(List inquiryDetails) { + this.inquiryDetails = inquiryDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorDetail() != null) { + errorDetail().validate(); + } + if (inquiryDetails() != null) { + inquiryDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java new file mode 100644 index 0000000000000..503d79a9ff426 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InquiryStatus. */ +public final class InquiryStatus extends ExpandableStringEnum { + /** Static value Invalid for InquiryStatus. */ + public static final InquiryStatus INVALID = fromString("Invalid"); + + /** Static value Success for InquiryStatus. */ + public static final InquiryStatus SUCCESS = fromString("Success"); + + /** Static value Failed for InquiryStatus. */ + public static final InquiryStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a InquiryStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding InquiryStatus. + */ + @JsonCreator + public static InquiryStatus fromString(String name) { + return fromString(name, InquiryStatus.class); + } + + /** @return known InquiryStatus values. */ + public static Collection values() { + return values(InquiryStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java new file mode 100644 index 0000000000000..73bb319897987 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Validation for inquired protectable items under a given container. */ +@Fluent +public final class InquiryValidation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InquiryValidation.class); + + /* + * Status for the Inquiry Validation. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Error Detail in case the status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /* + * Error Additional Detail in case the status is non-success. + */ + @JsonProperty(value = "additionalDetail", access = JsonProperty.Access.WRITE_ONLY) + private String additionalDetail; + + /** + * Get the status property: Status for the Inquiry Validation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status for the Inquiry Validation. + * + * @param status the status value to set. + * @return the InquiryValidation object itself. + */ + public InquiryValidation withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the errorDetail property: Error Detail in case the status is non-success. + * + * @return the errorDetail value. + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set the errorDetail property: Error Detail in case the status is non-success. + * + * @param errorDetail the errorDetail value to set. + * @return the InquiryValidation object itself. + */ + public InquiryValidation withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + + /** + * Get the additionalDetail property: Error Additional Detail in case the status is non-success. + * + * @return the additionalDetail value. + */ + public String additionalDetail() { + return this.additionalDetail; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorDetail() != null) { + errorDetail().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java new file mode 100644 index 0000000000000..6bb8cd44583fe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.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.recoveryservicesbackup.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; + +/** Target details for file / folder restore. */ +@Fluent +public final class InstantItemRecoveryTarget { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstantItemRecoveryTarget.class); + + /* + * List of client scripts. + */ + @JsonProperty(value = "clientScripts") + private List clientScripts; + + /** + * Get the clientScripts property: List of client scripts. + * + * @return the clientScripts value. + */ + public List clientScripts() { + return this.clientScripts; + } + + /** + * Set the clientScripts property: List of client scripts. + * + * @param clientScripts the clientScripts value to set. + * @return the InstantItemRecoveryTarget object itself. + */ + public InstantItemRecoveryTarget withClientScripts(List clientScripts) { + this.clientScripts = clientScripts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientScripts() != null) { + clientScripts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java new file mode 100644 index 0000000000000..569dbecff919a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.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.recoveryservicesbackup.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 InstantRPAdditionalDetails model. */ +@Fluent +public final class InstantRPAdditionalDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstantRPAdditionalDetails.class); + + /* + * The azureBackupRGNamePrefix property. + */ + @JsonProperty(value = "azureBackupRGNamePrefix") + private String azureBackupRGNamePrefix; + + /* + * The azureBackupRGNameSuffix property. + */ + @JsonProperty(value = "azureBackupRGNameSuffix") + private String azureBackupRGNameSuffix; + + /** + * Get the azureBackupRGNamePrefix property: The azureBackupRGNamePrefix property. + * + * @return the azureBackupRGNamePrefix value. + */ + public String azureBackupRGNamePrefix() { + return this.azureBackupRGNamePrefix; + } + + /** + * Set the azureBackupRGNamePrefix property: The azureBackupRGNamePrefix property. + * + * @param azureBackupRGNamePrefix the azureBackupRGNamePrefix value to set. + * @return the InstantRPAdditionalDetails object itself. + */ + public InstantRPAdditionalDetails withAzureBackupRGNamePrefix(String azureBackupRGNamePrefix) { + this.azureBackupRGNamePrefix = azureBackupRGNamePrefix; + return this; + } + + /** + * Get the azureBackupRGNameSuffix property: The azureBackupRGNameSuffix property. + * + * @return the azureBackupRGNameSuffix value. + */ + public String azureBackupRGNameSuffix() { + return this.azureBackupRGNameSuffix; + } + + /** + * Set the azureBackupRGNameSuffix property: The azureBackupRGNameSuffix property. + * + * @param azureBackupRGNameSuffix the azureBackupRGNameSuffix value to set. + * @return the InstantRPAdditionalDetails object itself. + */ + public InstantRPAdditionalDetails withAzureBackupRGNameSuffix(String azureBackupRGNameSuffix) { + this.azureBackupRGNameSuffix = azureBackupRGNameSuffix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.java new file mode 100644 index 0000000000000..cf23791139238 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IntentItemType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntentItemType. */ +public final class IntentItemType extends ExpandableStringEnum { + /** Static value Invalid for IntentItemType. */ + public static final IntentItemType INVALID = fromString("Invalid"); + + /** Static value SQLInstance for IntentItemType. */ + public static final IntentItemType SQLINSTANCE = fromString("SQLInstance"); + + /** Static value SQLAvailabilityGroupContainer for IntentItemType. */ + public static final IntentItemType SQLAVAILABILITY_GROUP_CONTAINER = fromString("SQLAvailabilityGroupContainer"); + + /** + * Creates or finds a IntentItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntentItemType. + */ + @JsonCreator + public static IntentItemType fromString(String name) { + return fromString(name, IntentItemType.class); + } + + /** @return known IntentItemType values. */ + public static Collection values() { + return values(IntentItemType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java new file mode 100644 index 0000000000000..f9a8c621853f8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ItemLevelRecoveryConnections. */ +public interface ItemLevelRecoveryConnections { + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void provision( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters); + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status + * of provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + * for this backed up data. + * @param parameters resource ILR request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response provisionWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + IlrRequestResource parameters, + Context context); + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revoke( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId); + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer + * displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + * this backed up data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response revokeWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java new file mode 100644 index 0000000000000..6bb84e6ace06b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Defines workload agnostic properties for a job. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "jobType", + defaultImpl = Job.class) +@JsonTypeName("Job") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureIaaSVMJob", value = AzureIaaSvmJob.class), + @JsonSubTypes.Type(name = "AzureStorageJob", value = AzureStorageJob.class), + @JsonSubTypes.Type(name = "AzureWorkloadJob", value = AzureWorkloadJob.class), + @JsonSubTypes.Type(name = "DpmJob", value = DpmJob.class), + @JsonSubTypes.Type(name = "MabJob", value = MabJob.class), + @JsonSubTypes.Type(name = "VaultJob", value = VaultJob.class) +}) +@Fluent +public class Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Job.class); + + /* + * Friendly name of the entity on which the current job is executing. + */ + @JsonProperty(value = "entityFriendlyName") + private String entityFriendlyName; + + /* + * Backup management type to execute the current job. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * The operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Job status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * ActivityId of job. + */ + @JsonProperty(value = "activityId") + private String activityId; + + /** + * Get the entityFriendlyName property: Friendly name of the entity on which the current job is executing. + * + * @return the entityFriendlyName value. + */ + public String entityFriendlyName() { + return this.entityFriendlyName; + } + + /** + * Set the entityFriendlyName property: Friendly name of the entity on which the current job is executing. + * + * @param entityFriendlyName the entityFriendlyName value to set. + * @return the Job object itself. + */ + public Job withEntityFriendlyName(String entityFriendlyName) { + this.entityFriendlyName = entityFriendlyName; + return this; + } + + /** + * Get the backupManagementType property: Backup management type to execute the current job. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Backup management type to execute the current job. + * + * @param backupManagementType the backupManagementType value to set. + * @return the Job object itself. + */ + public Job withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the operation property: The operation name. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation name. + * + * @param operation the operation value to set. + * @return the Job object itself. + */ + public Job withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the status property: Job status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Job status. + * + * @param status the status value to set. + * @return the Job object itself. + */ + public Job withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the Job object itself. + */ + public Job withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the Job object itself. + */ + public Job withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the activityId property: ActivityId of job. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Set the activityId property: ActivityId of job. + * + * @param activityId the activityId value to set. + * @return the Job object itself. + */ + public Job withActivityId(String activityId) { + this.activityId = activityId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java new file mode 100644 index 0000000000000..c8b7b08efd0aa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of JobCancellations. */ +public interface JobCancellations { + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String vaultName, String resourceGroupName, String jobName); + + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + * GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job to cancel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java new file mode 100644 index 0000000000000..72a41eb253e8c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of JobDetails. */ +public interface JobDetails { + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + JobResource get(String vaultName, String resourceGroupName, String jobName); + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with the job. + */ + Response getWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java new file mode 100644 index 0000000000000..6d089f1dc7fba --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of JobOperationResults. */ +public interface JobOperationResults { + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String vaultName, String resourceGroupName, String jobName, String operationId); + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String jobName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.java new file mode 100644 index 0000000000000..2edbd820e7c8a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobOperationType. */ +public final class JobOperationType extends ExpandableStringEnum { + /** Static value Invalid for JobOperationType. */ + public static final JobOperationType INVALID = fromString("Invalid"); + + /** Static value Register for JobOperationType. */ + public static final JobOperationType REGISTER = fromString("Register"); + + /** Static value UnRegister for JobOperationType. */ + public static final JobOperationType UN_REGISTER = fromString("UnRegister"); + + /** Static value ConfigureBackup for JobOperationType. */ + public static final JobOperationType CONFIGURE_BACKUP = fromString("ConfigureBackup"); + + /** Static value Backup for JobOperationType. */ + public static final JobOperationType BACKUP = fromString("Backup"); + + /** Static value Restore for JobOperationType. */ + public static final JobOperationType RESTORE = fromString("Restore"); + + /** Static value DisableBackup for JobOperationType. */ + public static final JobOperationType DISABLE_BACKUP = fromString("DisableBackup"); + + /** Static value DeleteBackupData for JobOperationType. */ + public static final JobOperationType DELETE_BACKUP_DATA = fromString("DeleteBackupData"); + + /** Static value CrossRegionRestore for JobOperationType. */ + public static final JobOperationType CROSS_REGION_RESTORE = fromString("CrossRegionRestore"); + + /** Static value Undelete for JobOperationType. */ + public static final JobOperationType UNDELETE = fromString("Undelete"); + + /** Static value UpdateCustomerManagedKey for JobOperationType. */ + public static final JobOperationType UPDATE_CUSTOMER_MANAGED_KEY = fromString("UpdateCustomerManagedKey"); + + /** + * Creates or finds a JobOperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobOperationType. + */ + @JsonCreator + public static JobOperationType fromString(String name) { + return fromString(name, JobOperationType.class); + } + + /** @return known JobOperationType values. */ + public static Collection values() { + return values(JobOperationType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java new file mode 100644 index 0000000000000..e2db03e4d5b51 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import java.util.Map; + +/** An immutable client-side representation of JobResource. */ +public interface JobResource { + /** + * 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 properties property: JobResource properties. + * + * @return the properties value. + */ + Job properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner object. + * + * @return the inner object. + */ + JobResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResourceList.java new file mode 100644 index 0000000000000..a915d3808aaaf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Job resources. */ +@Fluent +public final class JobResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the JobResourceList object itself. + */ + public JobResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java new file mode 100644 index 0000000000000..0b95023798d7f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobStatus. */ +public final class JobStatus extends ExpandableStringEnum { + /** Static value Invalid for JobStatus. */ + public static final JobStatus INVALID = fromString("Invalid"); + + /** Static value InProgress for JobStatus. */ + public static final JobStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for JobStatus. */ + public static final JobStatus COMPLETED = fromString("Completed"); + + /** Static value Failed for JobStatus. */ + public static final JobStatus FAILED = fromString("Failed"); + + /** Static value CompletedWithWarnings for JobStatus. */ + public static final JobStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value Cancelled for JobStatus. */ + public static final JobStatus CANCELLED = fromString("Cancelled"); + + /** Static value Cancelling for JobStatus. */ + public static final JobStatus CANCELLING = fromString("Cancelling"); + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + @JsonCreator + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** @return known JobStatus values. */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java new file mode 100644 index 0000000000000..b0646f3df105c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.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.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for JobSupportedAction. */ +public enum JobSupportedAction { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Cancellable. */ + CANCELLABLE("Cancellable"), + + /** Enum value Retriable. */ + RETRIABLE("Retriable"); + + /** The actual serialized value for a JobSupportedAction instance. */ + private final String value; + + JobSupportedAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobSupportedAction instance. + * + * @param value the serialized value to parse. + * @return the parsed JobSupportedAction object, or null if unable to parse. + */ + @JsonCreator + public static JobSupportedAction fromString(String value) { + JobSupportedAction[] items = JobSupportedAction.values(); + for (JobSupportedAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java new file mode 100644 index 0000000000000..2a10b60ce895a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Jobs. */ +public interface Jobs { + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void export(String vaultName, String resourceGroupName); + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response exportWithResponse(String vaultName, String resourceGroupName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java new file mode 100644 index 0000000000000..da032c72cee23 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.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.recoveryservicesbackup.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; + +/** KEK is encryption key for BEK. */ +@Fluent +public final class KekDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KekDetails.class); + + /* + * Key is KEK. + */ + @JsonProperty(value = "keyUrl") + private String keyUrl; + + /* + * Key Vault ID where this Key is stored. + */ + @JsonProperty(value = "keyVaultId") + private String keyVaultId; + + /* + * KEK data. + */ + @JsonProperty(value = "keyBackupData") + private String keyBackupData; + + /** + * Get the keyUrl property: Key is KEK. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Key is KEK. + * + * @param keyUrl the keyUrl value to set. + * @return the KekDetails object itself. + */ + public KekDetails withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get the keyVaultId property: Key Vault ID where this Key is stored. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: Key Vault ID where this Key is stored. + * + * @param keyVaultId the keyVaultId value to set. + * @return the KekDetails object itself. + */ + public KekDetails withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the keyBackupData property: KEK data. + * + * @return the keyBackupData value. + */ + public String keyBackupData() { + return this.keyBackupData; + } + + /** + * Set the keyBackupData property: KEK data. + * + * @param keyBackupData the keyBackupData value to set. + * @return the KekDetails object itself. + */ + public KekDetails withKeyBackupData(String keyBackupData) { + this.keyBackupData = keyBackupData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java new file mode 100644 index 0000000000000..708be5c307c1b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.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.recoveryservicesbackup.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; + +/** + * BEK is bitlocker key. KEK is encryption key for BEK If the VM was encrypted then we will store following details : 1. + * Secret(BEK) - Url + Backup Data + vaultId. 2. Key(KEK) - Url + Backup Data + vaultId. 3. EncryptionMechanism BEK and + * KEK can potentially have different vault ids. + */ +@Fluent +public final class KeyAndSecretDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyAndSecretDetails.class); + + /* + * KEK is encryption key for BEK. + */ + @JsonProperty(value = "kekDetails") + private KekDetails kekDetails; + + /* + * BEK is bitlocker encryption key. + */ + @JsonProperty(value = "bekDetails") + private BekDetails bekDetails; + + /* + * Encryption mechanism: None/ SinglePass/ DoublePass + */ + @JsonProperty(value = "encryptionMechanism") + private String encryptionMechanism; + + /** + * Get the kekDetails property: KEK is encryption key for BEK. + * + * @return the kekDetails value. + */ + public KekDetails kekDetails() { + return this.kekDetails; + } + + /** + * Set the kekDetails property: KEK is encryption key for BEK. + * + * @param kekDetails the kekDetails value to set. + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withKekDetails(KekDetails kekDetails) { + this.kekDetails = kekDetails; + return this; + } + + /** + * Get the bekDetails property: BEK is bitlocker encryption key. + * + * @return the bekDetails value. + */ + public BekDetails bekDetails() { + return this.bekDetails; + } + + /** + * Set the bekDetails property: BEK is bitlocker encryption key. + * + * @param bekDetails the bekDetails value to set. + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withBekDetails(BekDetails bekDetails) { + this.bekDetails = bekDetails; + return this; + } + + /** + * Get the encryptionMechanism property: Encryption mechanism: None/ SinglePass/ DoublePass. + * + * @return the encryptionMechanism value. + */ + public String encryptionMechanism() { + return this.encryptionMechanism; + } + + /** + * Set the encryptionMechanism property: Encryption mechanism: None/ SinglePass/ DoublePass. + * + * @param encryptionMechanism the encryptionMechanism value to set. + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withEncryptionMechanism(String encryptionMechanism) { + this.encryptionMechanism = encryptionMechanism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kekDetails() != null) { + kekDetails().validate(); + } + if (bekDetails() != null) { + bekDetails().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java new file mode 100644 index 0000000000000..f592ae379f903 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.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.recoveryservicesbackup.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; + +/** KPI Resource Health Details. */ +@Fluent +public final class KpiResourceHealthDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KpiResourceHealthDetails.class); + + /* + * Resource Health Status + */ + @JsonProperty(value = "resourceHealthStatus") + private ResourceHealthStatus resourceHealthStatus; + + /* + * Resource Health Status + */ + @JsonProperty(value = "resourceHealthDetails") + private List resourceHealthDetails; + + /** + * Get the resourceHealthStatus property: Resource Health Status. + * + * @return the resourceHealthStatus value. + */ + public ResourceHealthStatus resourceHealthStatus() { + return this.resourceHealthStatus; + } + + /** + * Set the resourceHealthStatus property: Resource Health Status. + * + * @param resourceHealthStatus the resourceHealthStatus value to set. + * @return the KpiResourceHealthDetails object itself. + */ + public KpiResourceHealthDetails withResourceHealthStatus(ResourceHealthStatus resourceHealthStatus) { + this.resourceHealthStatus = resourceHealthStatus; + return this; + } + + /** + * Get the resourceHealthDetails property: Resource Health Status. + * + * @return the resourceHealthDetails value. + */ + public List resourceHealthDetails() { + return this.resourceHealthDetails; + } + + /** + * Set the resourceHealthDetails property: Resource Health Status. + * + * @param resourceHealthDetails the resourceHealthDetails value to set. + * @return the KpiResourceHealthDetails object itself. + */ + public KpiResourceHealthDetails withResourceHealthDetails(List resourceHealthDetails) { + this.resourceHealthDetails = resourceHealthDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceHealthDetails() != null) { + resourceHealthDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java new file mode 100644 index 0000000000000..c9a617f32ff7b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LastBackupStatus. */ +public final class LastBackupStatus extends ExpandableStringEnum { + /** Static value Invalid for LastBackupStatus. */ + public static final LastBackupStatus INVALID = fromString("Invalid"); + + /** Static value Healthy for LastBackupStatus. */ + public static final LastBackupStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for LastBackupStatus. */ + public static final LastBackupStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value IRPending for LastBackupStatus. */ + public static final LastBackupStatus IRPENDING = fromString("IRPending"); + + /** + * Creates or finds a LastBackupStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastBackupStatus. + */ + @JsonCreator + public static LastBackupStatus fromString(String name) { + return fromString(name, LastBackupStatus.class); + } + + /** @return known LastBackupStatus values. */ + public static Collection values() { + return values(LastBackupStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java new file mode 100644 index 0000000000000..4747da65b7f3e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LastUpdateStatus. */ +public final class LastUpdateStatus extends ExpandableStringEnum { + /** Static value Invalid for LastUpdateStatus. */ + public static final LastUpdateStatus INVALID = fromString("Invalid"); + + /** Static value NotEnabled for LastUpdateStatus. */ + public static final LastUpdateStatus NOT_ENABLED = fromString("NotEnabled"); + + /** Static value PartiallySucceeded for LastUpdateStatus. */ + public static final LastUpdateStatus PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); + + /** Static value PartiallyFailed for LastUpdateStatus. */ + public static final LastUpdateStatus PARTIALLY_FAILED = fromString("PartiallyFailed"); + + /** Static value Failed for LastUpdateStatus. */ + public static final LastUpdateStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for LastUpdateStatus. */ + public static final LastUpdateStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Creates or finds a LastUpdateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastUpdateStatus. + */ + @JsonCreator + public static LastUpdateStatus fromString(String name) { + return fromString(name, LastUpdateStatus.class); + } + + /** @return known LastUpdateStatus values. */ + public static Collection values() { + return values(LastUpdateStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java new file mode 100644 index 0000000000000..e34dc30703ea7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** ListRecoveryPointsRecommendedForMoveRequest Request. */ +@Fluent +public final class ListRecoveryPointsRecommendedForMoveRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListRecoveryPointsRecommendedForMoveRequest.class); + + /* + * Gets the class type. + */ + @JsonProperty(value = "objectType") + private String objectType; + + /* + * List of Recovery Points excluded from Move + */ + @JsonProperty(value = "excludedRPList") + private List excludedRPList; + + /** + * Get the objectType property: Gets the class type. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * Set the objectType property: Gets the class type. + * + * @param objectType the objectType value to set. + * @return the ListRecoveryPointsRecommendedForMoveRequest object itself. + */ + public ListRecoveryPointsRecommendedForMoveRequest withObjectType(String objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the excludedRPList property: List of Recovery Points excluded from Move. + * + * @return the excludedRPList value. + */ + public List excludedRPList() { + return this.excludedRPList; + } + + /** + * Set the excludedRPList property: List of Recovery Points excluded from Move. + * + * @param excludedRPList the excludedRPList value to set. + * @return the ListRecoveryPointsRecommendedForMoveRequest object itself. + */ + public ListRecoveryPointsRecommendedForMoveRequest withExcludedRPList(List excludedRPList) { + this.excludedRPList = excludedRPList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java new file mode 100644 index 0000000000000..d9901c2f1bcb4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.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.recoveryservicesbackup.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; + +/** Log policy schedule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("LogSchedulePolicy") +@Fluent +public final class LogSchedulePolicy extends SchedulePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSchedulePolicy.class); + + /* + * Frequency of the log schedule operation of this policy in minutes. + */ + @JsonProperty(value = "scheduleFrequencyInMins") + private Integer scheduleFrequencyInMins; + + /** + * Get the scheduleFrequencyInMins property: Frequency of the log schedule operation of this policy in minutes. + * + * @return the scheduleFrequencyInMins value. + */ + public Integer scheduleFrequencyInMins() { + return this.scheduleFrequencyInMins; + } + + /** + * Set the scheduleFrequencyInMins property: Frequency of the log schedule operation of this policy in minutes. + * + * @param scheduleFrequencyInMins the scheduleFrequencyInMins value to set. + * @return the LogSchedulePolicy object itself. + */ + public LogSchedulePolicy withScheduleFrequencyInMins(Integer scheduleFrequencyInMins) { + this.scheduleFrequencyInMins = scheduleFrequencyInMins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java new file mode 100644 index 0000000000000..a7ac64cb41e32 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.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.recoveryservicesbackup.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; + +/** Long term retention policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType") +@JsonTypeName("LongTermRetentionPolicy") +@Fluent +public final class LongTermRetentionPolicy extends RetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LongTermRetentionPolicy.class); + + /* + * Daily retention schedule of the protection policy. + */ + @JsonProperty(value = "dailySchedule") + private DailyRetentionSchedule dailySchedule; + + /* + * Weekly retention schedule of the protection policy. + */ + @JsonProperty(value = "weeklySchedule") + private WeeklyRetentionSchedule weeklySchedule; + + /* + * Monthly retention schedule of the protection policy. + */ + @JsonProperty(value = "monthlySchedule") + private MonthlyRetentionSchedule monthlySchedule; + + /* + * Yearly retention schedule of the protection policy. + */ + @JsonProperty(value = "yearlySchedule") + private YearlyRetentionSchedule yearlySchedule; + + /** + * Get the dailySchedule property: Daily retention schedule of the protection policy. + * + * @return the dailySchedule value. + */ + public DailyRetentionSchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set the dailySchedule property: Daily retention schedule of the protection policy. + * + * @param dailySchedule the dailySchedule value to set. + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withDailySchedule(DailyRetentionSchedule dailySchedule) { + this.dailySchedule = dailySchedule; + return this; + } + + /** + * Get the weeklySchedule property: Weekly retention schedule of the protection policy. + * + * @return the weeklySchedule value. + */ + public WeeklyRetentionSchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set the weeklySchedule property: Weekly retention schedule of the protection policy. + * + * @param weeklySchedule the weeklySchedule value to set. + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withWeeklySchedule(WeeklyRetentionSchedule weeklySchedule) { + this.weeklySchedule = weeklySchedule; + return this; + } + + /** + * Get the monthlySchedule property: Monthly retention schedule of the protection policy. + * + * @return the monthlySchedule value. + */ + public MonthlyRetentionSchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set the monthlySchedule property: Monthly retention schedule of the protection policy. + * + * @param monthlySchedule the monthlySchedule value to set. + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withMonthlySchedule(MonthlyRetentionSchedule monthlySchedule) { + this.monthlySchedule = monthlySchedule; + return this; + } + + /** + * Get the yearlySchedule property: Yearly retention schedule of the protection policy. + * + * @return the yearlySchedule value. + */ + public YearlyRetentionSchedule yearlySchedule() { + return this.yearlySchedule; + } + + /** + * Set the yearlySchedule property: Yearly retention schedule of the protection policy. + * + * @param yearlySchedule the yearlySchedule value to set. + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withYearlySchedule(YearlyRetentionSchedule yearlySchedule) { + this.yearlySchedule = yearlySchedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dailySchedule() != null) { + dailySchedule().validate(); + } + if (weeklySchedule() != null) { + weeklySchedule().validate(); + } + if (monthlySchedule() != null) { + monthlySchedule().validate(); + } + if (yearlySchedule() != null) { + yearlySchedule().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java new file mode 100644 index 0000000000000..7da0eb2617853 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Long term policy schedule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("LongTermSchedulePolicy") +@Immutable +public final class LongTermSchedulePolicy extends SchedulePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LongTermSchedulePolicy.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java new file mode 100644 index 0000000000000..24445e8eea7e4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Container with items backed up using MAB backup engine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType") +@JsonTypeName("Windows") +@Fluent +public final class MabContainer extends ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabContainer.class); + + /* + * Can the container be registered one more time. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /* + * ContainerID represents the container. + */ + @JsonProperty(value = "containerId") + private Long containerId; + + /* + * Number of items backed up in this container. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /* + * Agent version of this container. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Additional information for this container + */ + @JsonProperty(value = "extendedInfo") + private MabContainerExtendedInfo extendedInfo; + + /* + * Health details on this mab container. + */ + @JsonProperty(value = "mabContainerHealthDetails") + private List mabContainerHealthDetails; + + /* + * Health state of mab container. + */ + @JsonProperty(value = "containerHealthState") + private String containerHealthState; + + /** + * Get the canReRegister property: Can the container be registered one more time. + * + * @return the canReRegister value. + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set the canReRegister property: Can the container be registered one more time. + * + * @param canReRegister the canReRegister value to set. + * @return the MabContainer object itself. + */ + public MabContainer withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get the containerId property: ContainerID represents the container. + * + * @return the containerId value. + */ + public Long containerId() { + return this.containerId; + } + + /** + * Set the containerId property: ContainerID represents the container. + * + * @param containerId the containerId value to set. + * @return the MabContainer object itself. + */ + public MabContainer withContainerId(Long containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the protectedItemCount property: Number of items backed up in this container. + * + * @return the protectedItemCount value. + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of items backed up in this container. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the MabContainer object itself. + */ + public MabContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the agentVersion property: Agent version of this container. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Agent version of this container. + * + * @param agentVersion the agentVersion value to set. + * @return the MabContainer object itself. + */ + public MabContainer withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the extendedInfo property: Additional information for this container. + * + * @return the extendedInfo value. + */ + public MabContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information for this container. + * + * @param extendedInfo the extendedInfo value to set. + * @return the MabContainer object itself. + */ + public MabContainer withExtendedInfo(MabContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get the mabContainerHealthDetails property: Health details on this mab container. + * + * @return the mabContainerHealthDetails value. + */ + public List mabContainerHealthDetails() { + return this.mabContainerHealthDetails; + } + + /** + * Set the mabContainerHealthDetails property: Health details on this mab container. + * + * @param mabContainerHealthDetails the mabContainerHealthDetails value to set. + * @return the MabContainer object itself. + */ + public MabContainer withMabContainerHealthDetails(List mabContainerHealthDetails) { + this.mabContainerHealthDetails = mabContainerHealthDetails; + return this; + } + + /** + * Get the containerHealthState property: Health state of mab container. + * + * @return the containerHealthState value. + */ + public String containerHealthState() { + return this.containerHealthState; + } + + /** + * Set the containerHealthState property: Health state of mab container. + * + * @param containerHealthState the containerHealthState value to set. + * @return the MabContainer object itself. + */ + public MabContainer withContainerHealthState(String containerHealthState) { + this.containerHealthState = containerHealthState; + return this; + } + + /** {@inheritDoc} */ + @Override + public MabContainer withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabContainer withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabContainer withRegistrationStatus(String registrationStatus) { + super.withRegistrationStatus(registrationStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabContainer withHealthStatus(String healthStatus) { + super.withHealthStatus(healthStatus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + if (mabContainerHealthDetails() != null) { + mabContainerHealthDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java new file mode 100644 index 0000000000000..fa109ce78e038 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Additional information of the container. */ +@Fluent +public final class MabContainerExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabContainerExtendedInfo.class); + + /* + * Time stamp when this container was refreshed. + */ + @JsonProperty(value = "lastRefreshedAt") + private OffsetDateTime lastRefreshedAt; + + /* + * Type of backup items associated with this container. + */ + @JsonProperty(value = "backupItemType") + private BackupItemType backupItemType; + + /* + * List of backup items associated with this container. + */ + @JsonProperty(value = "backupItems") + private List backupItems; + + /* + * Backup policy associated with this container. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /* + * Latest backup status of this container. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Get the lastRefreshedAt property: Time stamp when this container was refreshed. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the lastRefreshedAt property: Time stamp when this container was refreshed. + * + * @param lastRefreshedAt the lastRefreshedAt value to set. + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get the backupItemType property: Type of backup items associated with this container. + * + * @return the backupItemType value. + */ + public BackupItemType backupItemType() { + return this.backupItemType; + } + + /** + * Set the backupItemType property: Type of backup items associated with this container. + * + * @param backupItemType the backupItemType value to set. + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withBackupItemType(BackupItemType backupItemType) { + this.backupItemType = backupItemType; + return this; + } + + /** + * Get the backupItems property: List of backup items associated with this container. + * + * @return the backupItems value. + */ + public List backupItems() { + return this.backupItems; + } + + /** + * Set the backupItems property: List of backup items associated with this container. + * + * @param backupItems the backupItems value to set. + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withBackupItems(List backupItems) { + this.backupItems = backupItems; + return this; + } + + /** + * Get the policyName property: Backup policy associated with this container. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Backup policy associated with this container. + * + * @param policyName the policyName value to set. + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the lastBackupStatus property: Latest backup status of this container. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Latest backup status of this container. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java new file mode 100644 index 0000000000000..b0acfec07e5ee --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** MAB workload-specific Health Details. */ +@Fluent +public final class MabContainerHealthDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabContainerHealthDetails.class); + + /* + * Health Code + */ + @JsonProperty(value = "code") + private Integer code; + + /* + * Health Title + */ + @JsonProperty(value = "title") + private String title; + + /* + * Health Message + */ + @JsonProperty(value = "message") + private String message; + + /* + * Health Recommended Actions + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get the code property: Health Code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: Health Code. + * + * @param code the code value to set. + * @return the MabContainerHealthDetails object itself. + */ + public MabContainerHealthDetails withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the title property: Health Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Health Title. + * + * @param title the title value to set. + * @return the MabContainerHealthDetails object itself. + */ + public MabContainerHealthDetails withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the message property: Health Message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Health Message. + * + * @param message the message value to set. + * @return the MabContainerHealthDetails object itself. + */ + public MabContainerHealthDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the recommendations property: Health Recommended Actions. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: Health Recommended Actions. + * + * @param recommendations the recommendations value to set. + * @return the MabContainerHealthDetails object itself. + */ + public MabContainerHealthDetails withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java new file mode 100644 index 0000000000000..818db5ce2aca6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.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.recoveryservicesbackup.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; + +/** MAB workload-specific error information. */ +@Immutable +public final class MabErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabErrorInfo.class); + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString", access = JsonProperty.Access.WRITE_ONLY) + private String errorString; + + /* + * List of localized recommendations. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Get the recommendations property: List of localized recommendations. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java new file mode 100644 index 0000000000000..6ed7349e52381 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** MAB workload-specific backup item. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("MabFileFolderProtectedItem") +@Fluent +public final class MabFileFolderProtectedItem extends ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabFileFolderProtectedItem.class); + + /* + * Friendly name of this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Name of the computer associated with this backup item. + */ + @JsonProperty(value = "computerName") + private String computerName; + + /* + * Status of last backup operation. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /* + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private OffsetDateTime lastBackupTime; + + /* + * Protected, ProtectionStopped, IRPending or ProtectionError + */ + @JsonProperty(value = "protectionState") + private String protectionState; + + /* + * Sync time for deferred deletion in UTC + */ + @JsonProperty(value = "deferredDeleteSyncTimeInUTC") + private Long deferredDeleteSyncTimeInUtc; + + /* + * Additional information with this backup item. + */ + @JsonProperty(value = "extendedInfo") + private MabFileFolderProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendlyName property: Friendly name of this backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of this backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the computerName property: Name of the computer associated with this backup item. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: Name of the computer associated with this backup item. + * + * @param computerName the computerName value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the lastBackupStatus property: Status of last backup operation. + * + * @return the lastBackupStatus value. + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the lastBackupStatus property: Status of last backup operation. + * + * @param lastBackupStatus the lastBackupStatus value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value. + */ + public OffsetDateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get the protectionState property: Protected, ProtectionStopped, IRPending or ProtectionError. + * + * @return the protectionState value. + */ + public String protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Protected, ProtectionStopped, IRPending or ProtectionError. + * + * @param protectionState the protectionState value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withProtectionState(String protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the deferredDeleteSyncTimeInUtc property: Sync time for deferred deletion in UTC. + * + * @return the deferredDeleteSyncTimeInUtc value. + */ + public Long deferredDeleteSyncTimeInUtc() { + return this.deferredDeleteSyncTimeInUtc; + } + + /** + * Set the deferredDeleteSyncTimeInUtc property: Sync time for deferred deletion in UTC. + * + * @param deferredDeleteSyncTimeInUtc the deferredDeleteSyncTimeInUtc value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withDeferredDeleteSyncTimeInUtc(Long deferredDeleteSyncTimeInUtc) { + this.deferredDeleteSyncTimeInUtc = deferredDeleteSyncTimeInUtc; + return this; + } + + /** + * Get the extendedInfo property: Additional information with this backup item. + * + * @return the extendedInfo value. + */ + public MabFileFolderProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information with this backup item. + * + * @param extendedInfo the extendedInfo value to set. + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withExtendedInfo(MabFileFolderProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withWorkloadType(DataSourceType workloadType) { + super.withWorkloadType(workloadType); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withSourceResourceId(String sourceResourceId) { + super.withSourceResourceId(sourceResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withPolicyId(String policyId) { + super.withPolicyId(policyId); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + super.withLastRecoveryPoint(lastRecoveryPoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withBackupSetName(String backupSetName) { + super.withBackupSetName(backupSetName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withCreateMode(CreateMode createMode) { + super.withCreateMode(createMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabFileFolderProtectedItem withIsRehydrate(Boolean isRehydrate) { + super.withIsRehydrate(isRehydrate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..c1a21039e41a0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Additional information on the backed up item. */ +@Fluent +public final class MabFileFolderProtectedItemExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabFileFolderProtectedItemExtendedInfo.class); + + /* + * Last time when the agent data synced to service. + */ + @JsonProperty(value = "lastRefreshedAt") + private OffsetDateTime lastRefreshedAt; + + /* + * The oldest backup copy available. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private OffsetDateTime oldestRecoveryPoint; + + /* + * Number of backup copies associated with the backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Get the lastRefreshedAt property: Last time when the agent data synced to service. + * + * @return the lastRefreshedAt value. + */ + public OffsetDateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the lastRefreshedAt property: Last time when the agent data synced to service. + * + * @param lastRefreshedAt the lastRefreshedAt value to set. + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get the oldestRecoveryPoint property: The oldest backup copy available. + * + * @return the oldestRecoveryPoint value. + */ + public OffsetDateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldestRecoveryPoint property: The oldest backup copy available. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the recoveryPointCount property: Number of backup copies associated with the backup item. + * + * @return the recoveryPointCount value. + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the recoveryPointCount property: Number of backup copies associated with the backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set. + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java new file mode 100644 index 0000000000000..6f9c849e46e0c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** MAB workload-specific job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("MabJob") +@Fluent +public final class MabJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabJob.class); + + /* + * Time taken by job to run. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * The state/actions applicable on jobs like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * Name of server protecting the DS. + */ + @JsonProperty(value = "mabServerName") + private String mabServerName; + + /* + * Server type of MAB container. + */ + @JsonProperty(value = "mabServerType") + private MabServerType mabServerType; + + /* + * Workload type of backup item. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /* + * The errors. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Additional information on the job. + */ + @JsonProperty(value = "extendedInfo") + private MabJobExtendedInfo extendedInfo; + + /** + * Get the duration property: Time taken by job to run. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time taken by job to run. + * + * @param duration the duration value to set. + * @return the MabJob object itself. + */ + public MabJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the actionsInfo property: The state/actions applicable on jobs like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: The state/actions applicable on jobs like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the MabJob object itself. + */ + public MabJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the mabServerName property: Name of server protecting the DS. + * + * @return the mabServerName value. + */ + public String mabServerName() { + return this.mabServerName; + } + + /** + * Set the mabServerName property: Name of server protecting the DS. + * + * @param mabServerName the mabServerName value to set. + * @return the MabJob object itself. + */ + public MabJob withMabServerName(String mabServerName) { + this.mabServerName = mabServerName; + return this; + } + + /** + * Get the mabServerType property: Server type of MAB container. + * + * @return the mabServerType value. + */ + public MabServerType mabServerType() { + return this.mabServerType; + } + + /** + * Set the mabServerType property: Server type of MAB container. + * + * @param mabServerType the mabServerType value to set. + * @return the MabJob object itself. + */ + public MabJob withMabServerType(MabServerType mabServerType) { + this.mabServerType = mabServerType; + return this; + } + + /** + * Get the workloadType property: Workload type of backup item. + * + * @return the workloadType value. + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Workload type of backup item. + * + * @param workloadType the workloadType value to set. + * @return the MabJob object itself. + */ + public MabJob withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the errorDetails property: The errors. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: The errors. + * + * @param errorDetails the errorDetails value to set. + * @return the MabJob object itself. + */ + public MabJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the extendedInfo property: Additional information on the job. + * + * @return the extendedInfo value. + */ + public MabJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information on the job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the MabJob object itself. + */ + public MabJob withExtendedInfo(MabJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MabJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java new file mode 100644 index 0000000000000..8f2cc52a60b44 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Additional information for the MAB workload-specific job. */ +@Fluent +public final class MabJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabJobExtendedInfo.class); + + /* + * List of tasks for this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /* + * The job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /* + * Non localized error message specific to this job. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get the tasksList property: List of tasks for this job. + * + * @return the tasksList value. + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set the tasksList property: List of tasks for this job. + * + * @param tasksList the tasksList value to set. + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the propertyBag property: The job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: The job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get the dynamicErrorMessage property: Non localized error message specific to this job. + * + * @return the dynamicErrorMessage value. + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set the dynamicErrorMessage property: Non localized error message specific to this job. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set. + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tasksList() != null) { + tasksList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java new file mode 100644 index 0000000000000..9f7bf5f3fd86c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** MAB workload-specific job task details. */ +@Fluent +public final class MabJobTaskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabJobTaskDetails.class); + + /* + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * The start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Time elapsed for task. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the taskId property: The task display name. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: The task display name. + * + * @param taskId the taskId value to set. + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the startTime property: The start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time. + * + * @param startTime the startTime value to set. + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time. + * + * @param endTime the endTime value to set. + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the duration property: Time elapsed for task. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed for task. + * + * @param duration the duration value to set. + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the status property: The status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status. + * + * @param status the status value to set. + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java new file mode 100644 index 0000000000000..0c6f8c1e5146e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Mab container-specific backup policy. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("MAB") +@Fluent +public final class MabProtectionPolicy extends ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MabProtectionPolicy.class); + + /* + * Backup schedule of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /* + * Retention policy details. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the schedulePolicy property: Backup schedule of backup policy. + * + * @return the schedulePolicy value. + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the schedulePolicy property: Backup schedule of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set. + * @return the MabProtectionPolicy object itself. + */ + public MabProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the retentionPolicy property: Retention policy details. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Retention policy details. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the MabProtectionPolicy object itself. + */ + public MabProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** {@inheritDoc} */ + @Override + public MabProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + super.withProtectedItemsCount(protectedItemsCount); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (schedulePolicy() != null) { + schedulePolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java new file mode 100644 index 0000000000000..01f80d1247006 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MabServerType. */ +public final class MabServerType extends ExpandableStringEnum { + /** Static value Invalid for MabServerType. */ + public static final MabServerType INVALID = fromString("Invalid"); + + /** Static value Unknown for MabServerType. */ + public static final MabServerType UNKNOWN = fromString("Unknown"); + + /** Static value IaasVMContainer for MabServerType. */ + public static final MabServerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); + + /** Static value IaasVMServiceContainer for MabServerType. */ + public static final MabServerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); + + /** Static value DPMContainer for MabServerType. */ + public static final MabServerType DPMCONTAINER = fromString("DPMContainer"); + + /** Static value AzureBackupServerContainer for MabServerType. */ + public static final MabServerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); + + /** Static value MABContainer for MabServerType. */ + public static final MabServerType MABCONTAINER = fromString("MABContainer"); + + /** Static value Cluster for MabServerType. */ + public static final MabServerType CLUSTER = fromString("Cluster"); + + /** Static value AzureSqlContainer for MabServerType. */ + public static final MabServerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); + + /** Static value Windows for MabServerType. */ + public static final MabServerType WINDOWS = fromString("Windows"); + + /** Static value VCenter for MabServerType. */ + public static final MabServerType VCENTER = fromString("VCenter"); + + /** Static value VMAppContainer for MabServerType. */ + public static final MabServerType VMAPP_CONTAINER = fromString("VMAppContainer"); + + /** Static value SQLAGWorkLoadContainer for MabServerType. */ + public static final MabServerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); + + /** Static value StorageContainer for MabServerType. */ + public static final MabServerType STORAGE_CONTAINER = fromString("StorageContainer"); + + /** Static value GenericContainer for MabServerType. */ + public static final MabServerType GENERIC_CONTAINER = fromString("GenericContainer"); + + /** + * Creates or finds a MabServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MabServerType. + */ + @JsonCreator + public static MabServerType fromString(String name) { + return fromString(name, MabServerType.class); + } + + /** @return known MabServerType values. */ + public static Collection values() { + return values(MabServerType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java new file mode 100644 index 0000000000000..42a34a82a5753 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.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.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for MonthOfYear. */ +public enum MonthOfYear { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value January. */ + JANUARY("January"), + + /** Enum value February. */ + FEBRUARY("February"), + + /** Enum value March. */ + MARCH("March"), + + /** Enum value April. */ + APRIL("April"), + + /** Enum value May. */ + MAY("May"), + + /** Enum value June. */ + JUNE("June"), + + /** Enum value July. */ + JULY("July"), + + /** Enum value August. */ + AUGUST("August"), + + /** Enum value September. */ + SEPTEMBER("September"), + + /** Enum value October. */ + OCTOBER("October"), + + /** Enum value November. */ + NOVEMBER("November"), + + /** Enum value December. */ + DECEMBER("December"); + + /** The actual serialized value for a MonthOfYear instance. */ + private final String value; + + MonthOfYear(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MonthOfYear instance. + * + * @param value the serialized value to parse. + * @return the parsed MonthOfYear object, or null if unable to parse. + */ + @JsonCreator + public static MonthOfYear fromString(String value) { + MonthOfYear[] items = MonthOfYear.values(); + for (MonthOfYear item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java new file mode 100644 index 0000000000000..d7b216c1b58f6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Monthly retention schedule. */ +@Fluent +public final class MonthlyRetentionSchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MonthlyRetentionSchedule.class); + + /* + * Retention schedule format type for monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleFormatType") + private RetentionScheduleFormat retentionScheduleFormatType; + + /* + * Daily retention format for monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /* + * Weekly retention format for monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /* + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /* + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the retentionScheduleFormatType property: Retention schedule format type for monthly retention policy. + * + * @return the retentionScheduleFormatType value. + */ + public RetentionScheduleFormat retentionScheduleFormatType() { + return this.retentionScheduleFormatType; + } + + /** + * Set the retentionScheduleFormatType property: Retention schedule format type for monthly retention policy. + * + * @param retentionScheduleFormatType the retentionScheduleFormatType value to set. + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleFormatType( + RetentionScheduleFormat retentionScheduleFormatType) { + this.retentionScheduleFormatType = retentionScheduleFormatType; + return this; + } + + /** + * Get the retentionScheduleDaily property: Daily retention format for monthly retention policy. + * + * @return the retentionScheduleDaily value. + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set the retentionScheduleDaily property: Daily retention format for monthly retention policy. + * + * @param retentionScheduleDaily the retentionScheduleDaily value to set. + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { + this.retentionScheduleDaily = retentionScheduleDaily; + return this; + } + + /** + * Get the retentionScheduleWeekly property: Weekly retention format for monthly retention policy. + * + * @return the retentionScheduleWeekly value. + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set the retentionScheduleWeekly property: Weekly retention format for monthly retention policy. + * + * @param retentionScheduleWeekly the retentionScheduleWeekly value to set. + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { + this.retentionScheduleWeekly = retentionScheduleWeekly; + return this; + } + + /** + * Get the retentionTimes property: Retention times of retention policy. + * + * @return the retentionTimes value. + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set the retentionTimes property: Retention times of retention policy. + * + * @param retentionTimes the retentionTimes value to set. + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get the retentionDuration property: Retention duration of retention Policy. + * + * @return the retentionDuration value. + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retentionDuration property: Retention duration of retention Policy. + * + * @param retentionDuration the retentionDuration value to set. + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionScheduleDaily() != null) { + retentionScheduleDaily().validate(); + } + if (retentionScheduleWeekly() != null) { + retentionScheduleWeekly().validate(); + } + if (retentionDuration() != null) { + retentionDuration().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java new file mode 100644 index 0000000000000..4658bc75a1572 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.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.recoveryservicesbackup.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 MoveRPAcrossTiersRequest model. */ +@Fluent +public final class MoveRPAcrossTiersRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MoveRPAcrossTiersRequest.class); + + /* + * Gets the class type. + */ + @JsonProperty(value = "objectType") + private String objectType; + + /* + * Source tier from where RP needs to be moved + */ + @JsonProperty(value = "sourceTierType") + private RecoveryPointTierType sourceTierType; + + /* + * Target tier where RP needs to be moved + */ + @JsonProperty(value = "targetTierType") + private RecoveryPointTierType targetTierType; + + /** + * Get the objectType property: Gets the class type. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * Set the objectType property: Gets the class type. + * + * @param objectType the objectType value to set. + * @return the MoveRPAcrossTiersRequest object itself. + */ + public MoveRPAcrossTiersRequest withObjectType(String objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the sourceTierType property: Source tier from where RP needs to be moved. + * + * @return the sourceTierType value. + */ + public RecoveryPointTierType sourceTierType() { + return this.sourceTierType; + } + + /** + * Set the sourceTierType property: Source tier from where RP needs to be moved. + * + * @param sourceTierType the sourceTierType value to set. + * @return the MoveRPAcrossTiersRequest object itself. + */ + public MoveRPAcrossTiersRequest withSourceTierType(RecoveryPointTierType sourceTierType) { + this.sourceTierType = sourceTierType; + return this; + } + + /** + * Get the targetTierType property: Target tier where RP needs to be moved. + * + * @return the targetTierType value. + */ + public RecoveryPointTierType targetTierType() { + return this.targetTierType; + } + + /** + * Set the targetTierType property: Target tier where RP needs to be moved. + * + * @param targetTierType the targetTierType value to set. + * @return the MoveRPAcrossTiersRequest object itself. + */ + public MoveRPAcrossTiersRequest withTargetTierType(RecoveryPointTierType targetTierType) { + this.targetTierType = targetTierType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java new file mode 100644 index 0000000000000..ebfdf92ea7e33 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The name of usage. */ +@Fluent +public final class NameInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameInfo.class); + + /* + * Value of usage. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Localized value of usage. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: Value of usage. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of usage. + * + * @param value the value value to set. + * @return the NameInfo object itself. + */ + public NameInfo withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: Localized value of usage. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: Localized value of usage. + * + * @param localizedValue the localizedValue value to set. + * @return the NameInfo object itself. + */ + public NameInfo withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java new file mode 100644 index 0000000000000..6e3eb1b5a13c4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.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.recoveryservicesbackup.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; + +/** Operation result info. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationResultInfo") +@Fluent +public final class OperationResultInfo extends OperationResultInfoBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInfo.class); + + /* + * List of jobs created by this operation. + */ + @JsonProperty(value = "jobList") + private List jobList; + + /** + * Get the jobList property: List of jobs created by this operation. + * + * @return the jobList value. + */ + public List jobList() { + return this.jobList; + } + + /** + * Set the jobList property: List of jobs created by this operation. + * + * @param jobList the jobList value to set. + * @return the OperationResultInfo object itself. + */ + public OperationResultInfo withJobList(List jobList) { + this.jobList = jobList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java new file mode 100644 index 0000000000000..85ba98177481a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for operation result info. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = OperationResultInfoBase.class) +@JsonTypeName("OperationResultInfoBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ExportJobsOperationResultInfo", value = ExportJobsOperationResultInfo.class), + @JsonSubTypes.Type(name = "OperationResultInfo", value = OperationResultInfo.class) +}) +@Immutable +public class OperationResultInfoBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInfoBase.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java new file mode 100644 index 0000000000000..f6b4cd32413f1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of OperationResultInfoBaseResource. */ +public interface OperationResultInfoBaseResource { + /** + * Gets the statusCode property: HTTP Status Code of the operation. + * + * @return the statusCode value. + */ + HttpStatusCode statusCode(); + + /** + * Gets the headers property: HTTP headers associated with this operation. + * + * @return the headers value. + */ + Map> headers(); + + /** + * Gets the operation property: OperationResultInfoBaseResource operation. + * + * @return the operation value. + */ + OperationResultInfoBase operation(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner object. + * + * @return the inner object. + */ + OperationResultInfoBaseResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java new file mode 100644 index 0000000000000..74da117c9539a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the id property: ID of the operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + OperationStatusValues status(); + + /** + * Gets the startTime property: Operation start time. Format: ISO-8601. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Operation end time. Format: ISO-8601. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: Error information related to this operation. + * + * @return the error value. + */ + OperationStatusError error(); + + /** + * Gets the properties property: Additional information associated with this operation. + * + * @return the properties value. + */ + OperationStatusExtendedInfo properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java new file mode 100644 index 0000000000000..36acbc49f35f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.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.recoveryservicesbackup.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; + +/** Error information associated with operation status call. */ +@Fluent +public final class OperationStatusError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusError.class); + + /* + * Error code of the operation failure. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Error message displayed if the operation failure. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: Error code of the operation failure. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Error code of the operation failure. + * + * @param code the code value to set. + * @return the OperationStatusError object itself. + */ + public OperationStatusError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Error message displayed if the operation failure. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message displayed if the operation failure. + * + * @param message the message value to set. + * @return the OperationStatusError object itself. + */ + public OperationStatusError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java new file mode 100644 index 0000000000000..0936178444330 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for additional information of operation status. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = OperationStatusExtendedInfo.class) +@JsonTypeName("OperationStatusExtendedInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "OperationStatusJobExtendedInfo", value = OperationStatusJobExtendedInfo.class), + @JsonSubTypes.Type(name = "OperationStatusJobsExtendedInfo", value = OperationStatusJobsExtendedInfo.class), + @JsonSubTypes.Type( + name = "OperationStatusProvisionILRExtendedInfo", + value = OperationStatusProvisionIlrExtendedInfo.class), + @JsonSubTypes.Type( + name = "OperationStatusRecoveryPointExtendedInfo", + value = OperationStatusRecoveryPointExtendedInfo.class) +}) +@Immutable +public class OperationStatusExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusExtendedInfo.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java new file mode 100644 index 0000000000000..60cdb7a259b18 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.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.recoveryservicesbackup.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; + +/** Operation status job extended info. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusJobExtendedInfo") +@Fluent +public final class OperationStatusJobExtendedInfo extends OperationStatusExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusJobExtendedInfo.class); + + /* + * ID of the job created for this protected item. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * Get the jobId property: ID of the job created for this protected item. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: ID of the job created for this protected item. + * + * @param jobId the jobId value to set. + * @return the OperationStatusJobExtendedInfo object itself. + */ + public OperationStatusJobExtendedInfo withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java new file mode 100644 index 0000000000000..6a83e5880bb1f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Operation status extended info for list of jobs. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusJobsExtendedInfo") +@Fluent +public final class OperationStatusJobsExtendedInfo extends OperationStatusExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusJobsExtendedInfo.class); + + /* + * IDs of the jobs created for the protected item. + */ + @JsonProperty(value = "jobIds") + private List jobIds; + + /* + * Stores all the failed jobs along with the corresponding error codes. + */ + @JsonProperty(value = "failedJobsError") + private Map failedJobsError; + + /** + * Get the jobIds property: IDs of the jobs created for the protected item. + * + * @return the jobIds value. + */ + public List jobIds() { + return this.jobIds; + } + + /** + * Set the jobIds property: IDs of the jobs created for the protected item. + * + * @param jobIds the jobIds value to set. + * @return the OperationStatusJobsExtendedInfo object itself. + */ + public OperationStatusJobsExtendedInfo withJobIds(List jobIds) { + this.jobIds = jobIds; + return this; + } + + /** + * Get the failedJobsError property: Stores all the failed jobs along with the corresponding error codes. + * + * @return the failedJobsError value. + */ + public Map failedJobsError() { + return this.failedJobsError; + } + + /** + * Set the failedJobsError property: Stores all the failed jobs along with the corresponding error codes. + * + * @param failedJobsError the failedJobsError value to set. + * @return the OperationStatusJobsExtendedInfo object itself. + */ + public OperationStatusJobsExtendedInfo withFailedJobsError(Map failedJobsError) { + this.failedJobsError = failedJobsError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java new file mode 100644 index 0000000000000..311488a6497bc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.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.recoveryservicesbackup.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; + +/** Operation status extended info for ILR provision action. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusProvisionILRExtendedInfo") +@Fluent +public final class OperationStatusProvisionIlrExtendedInfo extends OperationStatusExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusProvisionIlrExtendedInfo.class); + + /* + * Target details for file / folder restore. + */ + @JsonProperty(value = "recoveryTarget") + private InstantItemRecoveryTarget recoveryTarget; + + /** + * Get the recoveryTarget property: Target details for file / folder restore. + * + * @return the recoveryTarget value. + */ + public InstantItemRecoveryTarget recoveryTarget() { + return this.recoveryTarget; + } + + /** + * Set the recoveryTarget property: Target details for file / folder restore. + * + * @param recoveryTarget the recoveryTarget value to set. + * @return the OperationStatusProvisionIlrExtendedInfo object itself. + */ + public OperationStatusProvisionIlrExtendedInfo withRecoveryTarget(InstantItemRecoveryTarget recoveryTarget) { + this.recoveryTarget = recoveryTarget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (recoveryTarget() != null) { + recoveryTarget().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java new file mode 100644 index 0000000000000..b2e898ec62b6c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusRecoveryPointExtendedInfo.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Operation status extended info for Updated Recovery Point. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusRecoveryPointExtendedInfo") +@Fluent +public final class OperationStatusRecoveryPointExtendedInfo extends OperationStatusExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusRecoveryPointExtendedInfo.class); + + /* + * Recovery Point info with updated source snapshot URI + */ + @JsonProperty(value = "updatedRecoveryPoint") + private RecoveryPoint updatedRecoveryPoint; + + /* + * In case the share is in soft-deleted state, populate this field with + * deleted backup item + */ + @JsonProperty(value = "deletedBackupItemVersion") + private String deletedBackupItemVersion; + + /** + * Get the updatedRecoveryPoint property: Recovery Point info with updated source snapshot URI. + * + * @return the updatedRecoveryPoint value. + */ + public RecoveryPoint updatedRecoveryPoint() { + return this.updatedRecoveryPoint; + } + + /** + * Set the updatedRecoveryPoint property: Recovery Point info with updated source snapshot URI. + * + * @param updatedRecoveryPoint the updatedRecoveryPoint value to set. + * @return the OperationStatusRecoveryPointExtendedInfo object itself. + */ + public OperationStatusRecoveryPointExtendedInfo withUpdatedRecoveryPoint(RecoveryPoint updatedRecoveryPoint) { + this.updatedRecoveryPoint = updatedRecoveryPoint; + return this; + } + + /** + * Get the deletedBackupItemVersion property: In case the share is in soft-deleted state, populate this field with + * deleted backup item. + * + * @return the deletedBackupItemVersion value. + */ + public String deletedBackupItemVersion() { + return this.deletedBackupItemVersion; + } + + /** + * Set the deletedBackupItemVersion property: In case the share is in soft-deleted state, populate this field with + * deleted backup item. + * + * @param deletedBackupItemVersion the deletedBackupItemVersion value to set. + * @return the OperationStatusRecoveryPointExtendedInfo object itself. + */ + public OperationStatusRecoveryPointExtendedInfo withDeletedBackupItemVersion(String deletedBackupItemVersion) { + this.deletedBackupItemVersion = deletedBackupItemVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (updatedRecoveryPoint() != null) { + updatedRecoveryPoint().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java new file mode 100644 index 0000000000000..82202087fc749 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationStatusValues. */ +public final class OperationStatusValues extends ExpandableStringEnum { + /** Static value Invalid for OperationStatusValues. */ + public static final OperationStatusValues INVALID = fromString("Invalid"); + + /** Static value InProgress for OperationStatusValues. */ + public static final OperationStatusValues IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for OperationStatusValues. */ + public static final OperationStatusValues SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OperationStatusValues. */ + public static final OperationStatusValues FAILED = fromString("Failed"); + + /** Static value Canceled for OperationStatusValues. */ + public static final OperationStatusValues CANCELED = fromString("Canceled"); + + /** + * Creates or finds a OperationStatusValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatusValues. + */ + @JsonCreator + public static OperationStatusValues fromString(String name) { + return fromString(name, OperationStatusValues.class); + } + + /** @return known OperationStatusValues values. */ + public static Collection values() { + return values(OperationStatusValues.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java new file mode 100644 index 0000000000000..fbf0a3b3f44ee --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationType. */ +public final class OperationType extends ExpandableStringEnum { + /** Static value Invalid for OperationType. */ + public static final OperationType INVALID = fromString("Invalid"); + + /** Static value Register for OperationType. */ + public static final OperationType REGISTER = fromString("Register"); + + /** Static value Reregister for OperationType. */ + public static final OperationType REREGISTER = fromString("Reregister"); + + /** + * Creates or finds a OperationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationType. + */ + @JsonCreator + public static OperationType fromString(String name) { + return fromString(name, OperationType.class); + } + + /** @return known OperationType values. */ + public static Collection values() { + return values(OperationType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java new file mode 100644 index 0000000000000..d9b23e9971928 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** This is the base class for operation result responses. */ +@Fluent +public class OperationWorkerResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationWorkerResponse.class); + + /* + * HTTP Status Code of the operation. + */ + @JsonProperty(value = "statusCode") + private HttpStatusCode statusCode; + + /* + * HTTP headers associated with this operation. + */ + @JsonProperty(value = "headers") + private Map> headers; + + /** + * Get the statusCode property: HTTP Status Code of the operation. + * + * @return the statusCode value. + */ + public HttpStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: HTTP Status Code of the operation. + * + * @param statusCode the statusCode value to set. + * @return the OperationWorkerResponse object itself. + */ + public OperationWorkerResponse withStatusCode(HttpStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the headers property: HTTP headers associated with this operation. + * + * @return the headers value. + */ + public Map> headers() { + return this.headers; + } + + /** + * Set the headers property: HTTP headers associated with this operation. + * + * @param headers the headers value to set. + * @return the OperationWorkerResponse object itself. + */ + public OperationWorkerResponse withHeaders(Map> headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java new file mode 100644 index 0000000000000..5b574951c83a6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ValidateOperationsResponse validate( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters); + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response validateWithResponse( + String vaultName, String resourceGroupName, ValidateOperationRequest parameters, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.java new file mode 100644 index 0000000000000..d6bca099827f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationsOperations.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of OperationsOperations. */ +public interface OperationsOperations { + /** + * Returns the list of available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + PagedIterable list(); + + /** + * Returns the list of available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operations List response which contains list of available APIs. + */ + PagedIterable list(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java new file mode 100644 index 0000000000000..390553f7203ef --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OverwriteOptions. */ +public final class OverwriteOptions extends ExpandableStringEnum { + /** Static value Invalid for OverwriteOptions. */ + public static final OverwriteOptions INVALID = fromString("Invalid"); + + /** Static value FailOnConflict for OverwriteOptions. */ + public static final OverwriteOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** Static value Overwrite for OverwriteOptions. */ + public static final OverwriteOptions OVERWRITE = fromString("Overwrite"); + + /** + * Creates or finds a OverwriteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding OverwriteOptions. + */ + @JsonCreator + public static OverwriteOptions fromString(String name) { + return fromString(name, OverwriteOptions.class); + } + + /** @return known OverwriteOptions values. */ + public static Collection values() { + return values(OverwriteOptions.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java new file mode 100644 index 0000000000000..dfaab750a70ea --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Provides details for log ranges. */ +@Fluent +public final class PointInTimeRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PointInTimeRange.class); + + /* + * Start time of the time range for log recovery. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * End time of the time range for log recovery. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /** + * Get the startTime property: Start time of the time range for log recovery. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the time range for log recovery. + * + * @param startTime the startTime value to set. + * @return the PointInTimeRange object itself. + */ + public PointInTimeRange withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time of the time range for log recovery. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of the time range for log recovery. + * + * @param endTime the endTime value to set. + * @return the PointInTimeRange object itself. + */ + public PointInTimeRange withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java new file mode 100644 index 0000000000000..8c768a8321f79 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyType. */ +public final class PolicyType extends ExpandableStringEnum { + /** Static value Invalid for PolicyType. */ + public static final PolicyType INVALID = fromString("Invalid"); + + /** Static value Full for PolicyType. */ + public static final PolicyType FULL = fromString("Full"); + + /** Static value Differential for PolicyType. */ + public static final PolicyType DIFFERENTIAL = fromString("Differential"); + + /** Static value Log for PolicyType. */ + public static final PolicyType LOG = fromString("Log"); + + /** Static value CopyOnlyFull for PolicyType. */ + public static final PolicyType COPY_ONLY_FULL = fromString("CopyOnlyFull"); + + /** Static value Incremental for PolicyType. */ + public static final PolicyType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a PolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyType. + */ + @JsonCreator + public static PolicyType fromString(String name) { + return fromString(name, PolicyType.class); + } + + /** @return known PolicyType values. */ + public static Collection values() { + return values(PolicyType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java new file mode 100644 index 0000000000000..5ab050a778677 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.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.recoveryservicesbackup.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; + +/** Pre-backup validation for Azure VM Workload provider. */ +@Fluent +public final class PreBackupValidation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreBackupValidation.class); + + /* + * Status of protectable item, i.e. InProgress,Succeeded,Failed + */ + @JsonProperty(value = "status") + private InquiryStatus status; + + /* + * Error code of protectable item + */ + @JsonProperty(value = "code") + private String code; + + /* + * Message corresponding to the error code for the protectable item + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status property: Status of protectable item, i.e. InProgress,Succeeded,Failed. + * + * @return the status value. + */ + public InquiryStatus status() { + return this.status; + } + + /** + * Set the status property: Status of protectable item, i.e. InProgress,Succeeded,Failed. + * + * @param status the status value to set. + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withStatus(InquiryStatus status) { + this.status = status; + return this; + } + + /** + * Get the code property: Error code of protectable item. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Error code of protectable item. + * + * @param code the code value to set. + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Message corresponding to the error code for the protectable item. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message corresponding to the error code for the protectable item. + * + * @param message the message value to set. + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java new file mode 100644 index 0000000000000..4c5a18fc45eba --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** + * Contract to validate if backup can be enabled on the given resource in a given vault and given configuration. It will + * validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed in + * properties. + */ +@Fluent +public final class PreValidateEnableBackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreValidateEnableBackupRequest.class); + + /* + * ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc + */ + @JsonProperty(value = "resourceType") + private DataSourceType resourceType; + + /* + * ARM Virtual Machine Id + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * ARM id of the Recovery Services Vault + */ + @JsonProperty(value = "vaultId") + private String vaultId; + + /* + * Configuration of VM if any needs to be validated like OS type etc + */ + @JsonProperty(value = "properties") + private String properties; + + /** + * Get the resourceType property: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. + * + * @return the resourceType value. + */ + public DataSourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. + * + * @param resourceType the resourceType value to set. + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withResourceType(DataSourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceId property: ARM Virtual Machine Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: ARM Virtual Machine Id. + * + * @param resourceId the resourceId value to set. + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the vaultId property: ARM id of the Recovery Services Vault. + * + * @return the vaultId value. + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set the vaultId property: ARM id of the Recovery Services Vault. + * + * @param vaultId the vaultId value to set. + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get the properties property: Configuration of VM if any needs to be validated like OS type etc. + * + * @return the properties value. + */ + public String properties() { + return this.properties; + } + + /** + * Set the properties property: Configuration of VM if any needs to be validated like OS type etc. + * + * @param properties the properties value to set. + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withProperties(String properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java new file mode 100644 index 0000000000000..d277a97e75042 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; + +/** An immutable client-side representation of PreValidateEnableBackupResponse. */ +public interface PreValidateEnableBackupResponse { + /** + * Gets the status property: Validation Status. + * + * @return the status value. + */ + ValidationStatus status(); + + /** + * Gets the errorCode property: Response error code. + * + * @return the errorCode value. + */ + String errorCode(); + + /** + * Gets the errorMessage property: Response error message. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the recommendation property: Recommended action for user. + * + * @return the recommendation value. + */ + String recommendation(); + + /** + * Gets the containerName property: Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @return the containerName value. + */ + String containerName(); + + /** + * Gets the protectedItemName property: Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @return the protectedItemName value. + */ + String protectedItemName(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner object. + * + * @return the inner object. + */ + PreValidateEnableBackupResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java new file mode 100644 index 0000000000000..31ed457b7605b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Prepare DataMove Request. */ +@Fluent +public final class PrepareDataMoveRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrepareDataMoveRequest.class); + + /* + * ARM Id of target vault + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Target Region + */ + @JsonProperty(value = "targetRegion", required = true) + private String targetRegion; + + /* + * DataMove Level + */ + @JsonProperty(value = "dataMoveLevel", required = true) + private DataMoveLevel dataMoveLevel; + + /* + * Source Container ArmIds + * This needs to be populated only if DataMoveLevel is set to container + */ + @JsonProperty(value = "sourceContainerArmIds") + private List sourceContainerArmIds; + + /* + * Ignore the artifacts which are already moved. + */ + @JsonProperty(value = "ignoreMoved") + private Boolean ignoreMoved; + + /** + * Get the targetResourceId property: ARM Id of target vault. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: ARM Id of target vault. + * + * @param targetResourceId the targetResourceId value to set. + * @return the PrepareDataMoveRequest object itself. + */ + public PrepareDataMoveRequest withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the targetRegion property: Target Region. + * + * @return the targetRegion value. + */ + public String targetRegion() { + return this.targetRegion; + } + + /** + * Set the targetRegion property: Target Region. + * + * @param targetRegion the targetRegion value to set. + * @return the PrepareDataMoveRequest object itself. + */ + public PrepareDataMoveRequest withTargetRegion(String targetRegion) { + this.targetRegion = targetRegion; + return this; + } + + /** + * Get the dataMoveLevel property: DataMove Level. + * + * @return the dataMoveLevel value. + */ + public DataMoveLevel dataMoveLevel() { + return this.dataMoveLevel; + } + + /** + * Set the dataMoveLevel property: DataMove Level. + * + * @param dataMoveLevel the dataMoveLevel value to set. + * @return the PrepareDataMoveRequest object itself. + */ + public PrepareDataMoveRequest withDataMoveLevel(DataMoveLevel dataMoveLevel) { + this.dataMoveLevel = dataMoveLevel; + return this; + } + + /** + * Get the sourceContainerArmIds property: Source Container ArmIds This needs to be populated only if DataMoveLevel + * is set to container. + * + * @return the sourceContainerArmIds value. + */ + public List sourceContainerArmIds() { + return this.sourceContainerArmIds; + } + + /** + * Set the sourceContainerArmIds property: Source Container ArmIds This needs to be populated only if DataMoveLevel + * is set to container. + * + * @param sourceContainerArmIds the sourceContainerArmIds value to set. + * @return the PrepareDataMoveRequest object itself. + */ + public PrepareDataMoveRequest withSourceContainerArmIds(List sourceContainerArmIds) { + this.sourceContainerArmIds = sourceContainerArmIds; + return this; + } + + /** + * Get the ignoreMoved property: Ignore the artifacts which are already moved. + * + * @return the ignoreMoved value. + */ + public Boolean ignoreMoved() { + return this.ignoreMoved; + } + + /** + * Set the ignoreMoved property: Ignore the artifacts which are already moved. + * + * @param ignoreMoved the ignoreMoved value to set. + * @return the PrepareDataMoveRequest object itself. + */ + public PrepareDataMoveRequest withIgnoreMoved(Boolean ignoreMoved) { + this.ignoreMoved = ignoreMoved; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model PrepareDataMoveRequest")); + } + if (targetRegion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetRegion in model PrepareDataMoveRequest")); + } + if (dataMoveLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataMoveLevel in model PrepareDataMoveRequest")); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java new file mode 100644 index 0000000000000..bec748d799ac0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; +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.Map; + +/** Prepare DataMove Response. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("PrepareDataMoveResponse") +@Fluent +public final class PrepareDataMoveResponse extends VaultStorageConfigOperationResultResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrepareDataMoveResponse.class); + + /* + * Co-relationId for move operation + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Source Vault Properties + */ + @JsonProperty(value = "sourceVaultProperties") + private Map sourceVaultProperties; + + /** + * Get the correlationId property: Co-relationId for move operation. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Co-relationId for move operation. + * + * @param correlationId the correlationId value to set. + * @return the PrepareDataMoveResponse object itself. + */ + public PrepareDataMoveResponse withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the sourceVaultProperties property: Source Vault Properties. + * + * @return the sourceVaultProperties value. + */ + public Map sourceVaultProperties() { + return this.sourceVaultProperties; + } + + /** + * Set the sourceVaultProperties property: Source Vault Properties. + * + * @param sourceVaultProperties the sourceVaultProperties value to set. + * @return the PrepareDataMoveResponse object itself. + */ + public PrepareDataMoveResponse withSourceVaultProperties(Map sourceVaultProperties) { + this.sourceVaultProperties = sourceVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..9a6d6b5c5d6f7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.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.recoveryservicesbackup.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 Private Endpoint network resource that is linked to the Private Endpoint connection. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Gets or sets id + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Gets or sets id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets or sets id. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..3b57cc252333a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.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.recoveryservicesbackup.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; + +/** Private Endpoint Connection Response Properties. */ +@Fluent +public final class PrivateEndpointConnection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnection.class); + + /* + * Gets or sets provisioning state of the private endpoint connection + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * Gets or sets private endpoint associated with the private endpoint + * connection + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Gets or sets private link service connection state + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the provisioningState property: Gets or sets provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Gets or sets provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the privateEndpoint property: Gets or sets private endpoint associated with the private endpoint connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Gets or sets private endpoint associated with the private endpoint connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Gets or sets private link service connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Gets or sets private link service connection state. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java new file mode 100644 index 0000000000000..bf8b97fae02a0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; +import java.util.Map; + +/** An immutable client-side representation of PrivateEndpointConnectionResource. */ +public interface PrivateEndpointConnectionResource { + /** + * 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 properties property: PrivateEndpointConnectionResource properties. + * + * @return the properties value. + */ + PrivateEndpointConnection properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionResourceInner innerModel(); + + /** The entirety of the PrivateEndpointConnectionResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnectionResource definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnectionResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateEndpointConnectionResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the PrivateEndpointConnectionResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vaultName, resourceGroupName. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String vaultName, String resourceGroupName); + } + /** + * The stage of the PrivateEndpointConnectionResource 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.WithProperties, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnectionResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnectionResource create(Context context); + } + /** The stage of the PrivateEndpointConnectionResource 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 PrivateEndpointConnectionResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: PrivateEndpointConnectionResource properties. + * + * @param properties PrivateEndpointConnectionResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(PrivateEndpointConnection properties); + } + /** The stage of the PrivateEndpointConnectionResource definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the PrivateEndpointConnectionResource resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnectionResource.Update update(); + + /** The template for PrivateEndpointConnectionResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnectionResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnectionResource apply(Context context); + } + /** The PrivateEndpointConnectionResource update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnectionResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PrivateEndpointConnectionResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: PrivateEndpointConnectionResource properties. + * + * @param properties PrivateEndpointConnectionResource properties. + * @return the next definition stage. + */ + Update withProperties(PrivateEndpointConnection properties); + } + /** The stage of the PrivateEndpointConnectionResource update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnectionResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnectionResource refresh(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java new file mode 100644 index 0000000000000..b8d8ecb69d22b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionStatus. */ +public final class PrivateEndpointConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateEndpointConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointConnectionStatus.class); + } + + /** @return known PrivateEndpointConnectionStatus values. */ + public static Collection values() { + return values(PrivateEndpointConnectionStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..8935baf7ffa4c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + PrivateEndpointConnectionResource get( + String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @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 private Endpoint Connection. + */ + PrivateEndpointConnectionResource getById(String id); + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @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 private Endpoint Connection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnectionResource resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnectionResource definition. + */ + PrivateEndpointConnectionResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java new file mode 100644 index 0000000000000..660087d3892bb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpoints. */ +public interface PrivateEndpoints { + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation 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 operation status for a private endpoint connection. + */ + OperationStatus getOperationStatus( + String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId); + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation 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 operation status for a private endpoint connection. + */ + Response getOperationStatusWithResponse( + String vaultName, + String resourceGroupName, + String privateEndpointConnectionName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..29197dfe197a6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.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.recoveryservicesbackup.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; + +/** Private Link Service Connection State. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Gets or sets the status + */ + @JsonProperty(value = "status") + private PrivateEndpointConnectionStatus status; + + /* + * Gets or sets description + */ + @JsonProperty(value = "description") + private String description; + + /* + * Gets or sets actions required + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get the status property: Gets or sets the status. + * + * @return the status value. + */ + public PrivateEndpointConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Gets or sets the status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Gets or sets description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionRequired property: Gets or sets actions required. + * + * @return the actionRequired value. + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set the actionRequired property: Gets or sets actions required. + * + * @param actionRequired the actionRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java new file mode 100644 index 0000000000000..6053766f31f29 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Protectable Container Class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectableContainerType", + defaultImpl = ProtectableContainer.class) +@JsonTypeName("ProtectableContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageContainer", value = AzureStorageProtectableContainer.class), + @JsonSubTypes.Type(name = "VMAppContainer", value = AzureVMAppContainerProtectableContainer.class) +}) +@Fluent +public class ProtectableContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableContainer.class); + + /* + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Type of backup management for the container. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * Status of health of the container. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /* + * Fabric Id of the container such as ARM Id. + */ + @JsonProperty(value = "containerId") + private String containerId; + + /** + * Get the friendlyName property: Friendly name of the container. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the container. + * + * @param friendlyName the friendlyName value to set. + * @return the ProtectableContainer object itself. + */ + public ProtectableContainer withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backupManagementType property: Type of backup management for the container. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the container. + * + * @param backupManagementType the backupManagementType value to set. + * @return the ProtectableContainer object itself. + */ + public ProtectableContainer withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the healthStatus property: Status of health of the container. + * + * @return the healthStatus value. + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set the healthStatus property: Status of health of the container. + * + * @param healthStatus the healthStatus value to set. + * @return the ProtectableContainer object itself. + */ + public ProtectableContainer withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the containerId property: Fabric Id of the container such as ARM Id. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Fabric Id of the container such as ARM Id. + * + * @param containerId the containerId value to set. + * @return the ProtectableContainer object itself. + */ + public ProtectableContainer withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java new file mode 100644 index 0000000000000..2070794d1c153 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ProtectableContainerResource. */ +public interface ProtectableContainerResource { + /** + * 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 properties property: ProtectableContainerResource properties. + * + * @return the properties value. + */ + ProtectableContainer properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner + * object. + * + * @return the inner object. + */ + ProtectableContainerResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResourceList.java new file mode 100644 index 0000000000000..db4919cb516d0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ProtectableContainer resources. */ +@Fluent +public final class ProtectableContainerResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectableContainerResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ProtectableContainerResourceList object itself. + */ + public ProtectableContainerResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectableContainerResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java new file mode 100644 index 0000000000000..f9b166b5e7bbd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectableContainers. */ +public interface ProtectableContainers { + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName 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 list of ProtectableContainer resources. + */ + PagedIterable list(String vaultName, String resourceGroupName, String fabricName); + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ProtectableContainer resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java new file mode 100644 index 0000000000000..ac07ce3bf73c6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Base class for backup items. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectedItemType", + defaultImpl = ProtectedItem.class) +@JsonTypeName("ProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareProtectedItem", value = AzureFileshareProtectedItem.class), + @JsonSubTypes.Type(name = "AzureIaaSVMProtectedItem", value = AzureIaaSvmProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers/databases", value = AzureSqlProtectedItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadProtectedItem", value = AzureVmWorkloadProtectedItem.class), + @JsonSubTypes.Type(name = "DPMProtectedItem", value = DpmProtectedItem.class), + @JsonSubTypes.Type(name = "GenericProtectedItem", value = GenericProtectedItem.class), + @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class), + @JsonSubTypes.Type(name = "AzureFileShareProtectedItem", value = AzureFileshareProtectedItemAutoGenerated.class) +}) +@Fluent +public class ProtectedItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItem.class); + + /* + * Type of backup management for the backed up item. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * Type of workload this item represents. + */ + @JsonProperty(value = "workloadType") + private DataSourceType workloadType; + + /* + * Unique name of container + */ + @JsonProperty(value = "containerName") + private String containerName; + + /* + * ARM ID of the resource to be backed up. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * ID of the backup policy with which this item is backed up. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * Timestamp when the last (latest) backup copy was created for this backup + * item. + */ + @JsonProperty(value = "lastRecoveryPoint") + private OffsetDateTime lastRecoveryPoint; + + /* + * Name of the backup set the backup item belongs to + */ + @JsonProperty(value = "backupSetName") + private String backupSetName; + + /* + * Create mode to indicate recovery of existing soft deleted data source or + * creation of new data source. + */ + @JsonProperty(value = "createMode") + private CreateMode createMode; + + /* + * Time for deferred deletion in UTC + */ + @JsonProperty(value = "deferredDeleteTimeInUTC") + private OffsetDateTime deferredDeleteTimeInUtc; + + /* + * Flag to identify whether the DS is scheduled for deferred delete + */ + @JsonProperty(value = "isScheduledForDeferredDelete") + private Boolean isScheduledForDeferredDelete; + + /* + * Time remaining before the DS marked for deferred delete is permanently + * deleted + */ + @JsonProperty(value = "deferredDeleteTimeRemaining") + private String deferredDeleteTimeRemaining; + + /* + * Flag to identify whether the deferred deleted DS is to be purged soon + */ + @JsonProperty(value = "isDeferredDeleteScheduleUpcoming") + private Boolean isDeferredDeleteScheduleUpcoming; + + /* + * Flag to identify that deferred deleted DS is to be moved into Pause + * state + */ + @JsonProperty(value = "isRehydrate") + private Boolean isRehydrate; + + /** + * Get the backupManagementType property: Type of backup management for the backed up item. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the backed up item. + * + * @param backupManagementType the backupManagementType value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workloadType property: Type of workload this item represents. + * + * @return the workloadType value. + */ + public DataSourceType workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Type of workload this item represents. + * + * @param workloadType the workloadType value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withWorkloadType(DataSourceType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the containerName property: Unique name of container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Unique name of container. + * + * @param containerName the containerName value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the policyId property: ID of the backup policy with which this item is backed up. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: ID of the backup policy with which this item is backed up. + * + * @param policyId the policyId value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup + * item. + * + * @return the lastRecoveryPoint value. + */ + public OffsetDateTime lastRecoveryPoint() { + return this.lastRecoveryPoint; + } + + /** + * Set the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup + * item. + * + * @param lastRecoveryPoint the lastRecoveryPoint value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { + this.lastRecoveryPoint = lastRecoveryPoint; + return this; + } + + /** + * Get the backupSetName property: Name of the backup set the backup item belongs to. + * + * @return the backupSetName value. + */ + public String backupSetName() { + return this.backupSetName; + } + + /** + * Set the backupSetName property: Name of the backup set the backup item belongs to. + * + * @param backupSetName the backupSetName value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withBackupSetName(String backupSetName) { + this.backupSetName = backupSetName; + return this; + } + + /** + * Get the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of + * new data source. + * + * @return the createMode value. + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of + * new data source. + * + * @param createMode the createMode value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the deferredDeleteTimeInUtc property: Time for deferred deletion in UTC. + * + * @return the deferredDeleteTimeInUtc value. + */ + public OffsetDateTime deferredDeleteTimeInUtc() { + return this.deferredDeleteTimeInUtc; + } + + /** + * Set the deferredDeleteTimeInUtc property: Time for deferred deletion in UTC. + * + * @param deferredDeleteTimeInUtc the deferredDeleteTimeInUtc value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { + this.deferredDeleteTimeInUtc = deferredDeleteTimeInUtc; + return this; + } + + /** + * Get the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. + * + * @return the isScheduledForDeferredDelete value. + */ + public Boolean isScheduledForDeferredDelete() { + return this.isScheduledForDeferredDelete; + } + + /** + * Set the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. + * + * @param isScheduledForDeferredDelete the isScheduledForDeferredDelete value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + this.isScheduledForDeferredDelete = isScheduledForDeferredDelete; + return this; + } + + /** + * Get the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is + * permanently deleted. + * + * @return the deferredDeleteTimeRemaining value. + */ + public String deferredDeleteTimeRemaining() { + return this.deferredDeleteTimeRemaining; + } + + /** + * Set the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is + * permanently deleted. + * + * @param deferredDeleteTimeRemaining the deferredDeleteTimeRemaining value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + this.deferredDeleteTimeRemaining = deferredDeleteTimeRemaining; + return this; + } + + /** + * Get the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be + * purged soon. + * + * @return the isDeferredDeleteScheduleUpcoming value. + */ + public Boolean isDeferredDeleteScheduleUpcoming() { + return this.isDeferredDeleteScheduleUpcoming; + } + + /** + * Set the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be + * purged soon. + * + * @param isDeferredDeleteScheduleUpcoming the isDeferredDeleteScheduleUpcoming value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + this.isDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; + return this; + } + + /** + * Get the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @return the isRehydrate value. + */ + public Boolean isRehydrate() { + return this.isRehydrate; + } + + /** + * Set the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @param isRehydrate the isRehydrate value to set. + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsRehydrate(Boolean isRehydrate) { + this.isRehydrate = isRehydrate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java new file mode 100644 index 0000000000000..199dfeebdfdd2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtectedItemHealthStatus. */ +public final class ProtectedItemHealthStatus extends ExpandableStringEnum { + /** Static value Invalid for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus INVALID = fromString("Invalid"); + + /** Static value Healthy for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value NotReachable for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus NOT_REACHABLE = fromString("NotReachable"); + + /** Static value IRPending for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus IRPENDING = fromString("IRPending"); + + /** + * Creates or finds a ProtectedItemHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectedItemHealthStatus. + */ + @JsonCreator + public static ProtectedItemHealthStatus fromString(String name) { + return fromString(name, ProtectedItemHealthStatus.class); + } + + /** @return known ProtectedItemHealthStatus values. */ + public static Collection values() { + return values(ProtectedItemHealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java new file mode 100644 index 0000000000000..5f66050cb9c5c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectedItemOperationResults. */ +public interface ProtectedItemOperationResults { + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + ProtectedItemResource get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId); + + /** + * Fetches the result of any operation on the backup item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java new file mode 100644 index 0000000000000..d4b664476b857 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectedItemOperationStatuses. */ +public interface ProtectedItemOperationStatuses { + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + OperationStatus get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId); + + /** + * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed + * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some + * operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java new file mode 100644 index 0000000000000..e8475e8fc5532 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ProtectedItemResource. */ +public interface ProtectedItemResource { + /** + * 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 properties property: ProtectedItemResource properties. + * + * @return the properties value. + */ + ProtectedItem properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner object. + * + * @return the inner object. + */ + ProtectedItemResourceInner innerModel(); + + /** The entirety of the ProtectedItemResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The ProtectedItemResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectedItemResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ProtectedItemResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ProtectedItemResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vaultName, resourceGroupName, fabricName, containerName. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @return the next definition stage. + */ + WithCreate withExistingProtectionContainer( + String vaultName, String resourceGroupName, String fabricName, String containerName); + } + /** + * The stage of the ProtectedItemResource 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.WithProperties, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectedItemResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectedItemResource create(Context context); + } + /** The stage of the ProtectedItemResource 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 ProtectedItemResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectedItemResource properties. + * + * @param properties ProtectedItemResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProtectedItem properties); + } + /** The stage of the ProtectedItemResource definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the ProtectedItemResource resource. + * + * @return the stage of resource update. + */ + ProtectedItemResource.Update update(); + + /** The template for ProtectedItemResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProtectedItemResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProtectedItemResource apply(Context context); + } + /** The ProtectedItemResource update stages. */ + interface UpdateStages { + /** The stage of the ProtectedItemResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ProtectedItemResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectedItemResource properties. + * + * @param properties ProtectedItemResource properties. + * @return the next definition stage. + */ + Update withProperties(ProtectedItem properties); + } + /** The stage of the ProtectedItemResource update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectedItemResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectedItemResource refresh(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResourceList.java new file mode 100644 index 0000000000000..9428b37037691 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ProtectedItem resources. */ +@Fluent +public final class ProtectedItemResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectedItemResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ProtectedItemResourceList object itself. + */ + public ProtectedItemResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectedItemResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java new file mode 100644 index 0000000000000..d3683d8e4ec6f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtectedItemState. */ +public final class ProtectedItemState extends ExpandableStringEnum { + /** Static value Invalid for ProtectedItemState. */ + public static final ProtectedItemState INVALID = fromString("Invalid"); + + /** Static value IRPending for ProtectedItemState. */ + public static final ProtectedItemState IRPENDING = fromString("IRPending"); + + /** Static value Protected for ProtectedItemState. */ + public static final ProtectedItemState PROTECTED = fromString("Protected"); + + /** Static value ProtectionError for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_ERROR = fromString("ProtectionError"); + + /** Static value ProtectionStopped for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** Static value ProtectionPaused for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates or finds a ProtectedItemState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectedItemState. + */ + @JsonCreator + public static ProtectedItemState fromString(String name) { + return fromString(name, ProtectedItemState.class); + } + + /** @return known ProtectedItemState values. */ + public static Collection values() { + return values(ProtectedItemState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java new file mode 100644 index 0000000000000..2252544ca940c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectedItems. */ +public interface ProtectedItems { + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + ProtectedItemResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + Context context); + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @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 base class for backup items. + */ + ProtectedItemResource getById(String id); + + /** + * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the + * operation, call the GetItemOperationResult API. + * + * @param id the resource ID. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items. + */ + Response getByIdWithResponse(String id, String filter, Context context); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of + * the request, call the GetItemOperationResult API. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectedItemResource resource. + * + * @param name resource name. + * @return the first stage of the new ProtectedItemResource definition. + */ + ProtectedItemResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java new file mode 100644 index 0000000000000..30b54bbb07a50 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.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.recoveryservicesbackup.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; + +/** Base class for container with backup items. Containers with specific workloads are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "containerType", + defaultImpl = ProtectionContainer.class) +@JsonTypeName("ProtectionContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DPMContainer", value = DpmContainer.class), + @JsonSubTypes.Type(name = "IaaSVMContainer", value = IaaSvmContainer.class), + @JsonSubTypes.Type(name = "AzureWorkloadContainer", value = AzureWorkloadContainer.class), + @JsonSubTypes.Type(name = "AzureSqlContainer", value = AzureSqlContainer.class), + @JsonSubTypes.Type(name = "StorageContainer", value = AzureStorageContainer.class), + @JsonSubTypes.Type(name = "GenericContainer", value = GenericContainer.class), + @JsonSubTypes.Type(name = "Windows", value = MabContainer.class) +}) +@Fluent +public class ProtectionContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainer.class); + + /* + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Type of backup management for the container. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * Status of registration of the container with the Recovery Services + * Vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /* + * Status of health of the container. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * Get the friendlyName property: Friendly name of the container. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the container. + * + * @param friendlyName the friendlyName value to set. + * @return the ProtectionContainer object itself. + */ + public ProtectionContainer withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backupManagementType property: Type of backup management for the container. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the container. + * + * @param backupManagementType the backupManagementType value to set. + * @return the ProtectionContainer object itself. + */ + public ProtectionContainer withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the registrationStatus property: Status of registration of the container with the Recovery Services Vault. + * + * @return the registrationStatus value. + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set the registrationStatus property: Status of registration of the container with the Recovery Services Vault. + * + * @param registrationStatus the registrationStatus value to set. + * @return the ProtectionContainer object itself. + */ + public ProtectionContainer withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + + /** + * Get the healthStatus property: Status of health of the container. + * + * @return the healthStatus value. + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set the healthStatus property: Status of health of the container. + * + * @param healthStatus the healthStatus value to set. + * @return the ProtectionContainer object itself. + */ + public ProtectionContainer withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java new file mode 100644 index 0000000000000..805b3ba719bd6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionContainerOperationResults. */ +public interface ProtectionContainerOperationResults { + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + ProtectionContainerResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId); + + /** + * Fetches the result of any operation on the container. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for container with backup items. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java new file mode 100644 index 0000000000000..5b579a5ea3534 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionContainerRefreshOperationResults. */ +public interface ProtectionContainerRefreshOperationResults { + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String vaultName, String resourceGroupName, String fabricName, String operationId); + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java new file mode 100644 index 0000000000000..e9db079139e31 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ProtectionContainerResource. */ +public interface ProtectionContainerResource { + /** + * 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 properties property: ProtectionContainerResource properties. + * + * @return the properties value. + */ + ProtectionContainer properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner + * object. + * + * @return the inner object. + */ + ProtectionContainerResourceInner innerModel(); + + /** The entirety of the ProtectionContainerResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The ProtectionContainerResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectionContainerResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ProtectionContainerResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ProtectionContainerResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vaultName, resourceGroupName, fabricName. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @return the next definition stage. + */ + WithCreate withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName); + } + /** + * The stage of the ProtectionContainerResource 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.WithProperties, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectionContainerResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectionContainerResource create(Context context); + } + /** The stage of the ProtectionContainerResource 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 ProtectionContainerResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionContainerResource properties. + * + * @param properties ProtectionContainerResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProtectionContainer properties); + } + /** The stage of the ProtectionContainerResource definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the ProtectionContainerResource resource. + * + * @return the stage of resource update. + */ + ProtectionContainerResource.Update update(); + + /** The template for ProtectionContainerResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProtectionContainerResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProtectionContainerResource apply(Context context); + } + /** The ProtectionContainerResource update stages. */ + interface UpdateStages { + /** The stage of the ProtectionContainerResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ProtectionContainerResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionContainerResource properties. + * + * @param properties ProtectionContainerResource properties. + * @return the next definition stage. + */ + Update withProperties(ProtectionContainer properties); + } + /** The stage of the ProtectionContainerResource update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectionContainerResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectionContainerResource refresh(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResourceList.java new file mode 100644 index 0000000000000..7024b0abf7ec8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ProtectionContainer resources. */ +@Fluent +public final class ProtectionContainerResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionContainerResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ProtectionContainerResourceList object itself. + */ + public ProtectionContainerResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionContainerResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java new file mode 100644 index 0000000000000..16eb8ce8412ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionContainers. */ +public interface ProtectionContainers { + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + ProtectionContainerResource get( + String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context); + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To + * determine whether the backend service has finished processing the request, call Get Container Operation Result + * API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response unregisterWithResponse( + String vaultName, String resourceGroupName, String fabricName, String containerName, Context context); + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response inquireWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String filter, + Context context); + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void refresh(String vaultName, String resourceGroupName, String fabricName); + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response refreshWithResponse( + String vaultName, String resourceGroupName, String fabricName, String filter, Context context); + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + ProtectionContainerResource getById(String id); + + /** + * Gets details of the specific container registered to your Recovery Services Vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specific container registered to your Recovery Services Vault. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectionContainerResource resource. + * + * @param name resource name. + * @return the first stage of the new ProtectionContainerResource definition. + */ + ProtectionContainerResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java new file mode 100644 index 0000000000000..50eebe5ded754 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Base class for backup ProtectionIntent. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectionIntentItemType", + defaultImpl = ProtectionIntent.class) +@JsonTypeName("ProtectionIntent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "RecoveryServiceVaultItem", value = AzureRecoveryServiceVaultProtectionIntent.class), + @JsonSubTypes.Type(name = "AzureResourceItem", value = AzureResourceProtectionIntent.class), + @JsonSubTypes.Type(name = "AzureWorkloadAutoProtectionIntent", value = AzureWorkloadAutoProtectionIntent.class) +}) +@Fluent +public class ProtectionIntent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionIntent.class); + + /* + * Type of backup management for the backed up item. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /* + * ARM ID of the resource to be backed up. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /* + * ID of the item which is getting protected, In case of Azure Vm , it is + * ProtectedItemId + */ + @JsonProperty(value = "itemId") + private String itemId; + + /* + * ID of the backup policy with which this item is backed up. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * Backup state of this backup item. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get the backupManagementType property: Type of backup management for the backed up item. + * + * @return the backupManagementType value. + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management for the backed up item. + * + * @param backupManagementType the backupManagementType value to set. + * @return the ProtectionIntent object itself. + */ + public ProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: ARM ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the ProtectionIntent object itself. + */ + public ProtectionIntent withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the itemId property: ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. + * + * @return the itemId value. + */ + public String itemId() { + return this.itemId; + } + + /** + * Set the itemId property: ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. + * + * @param itemId the itemId value to set. + * @return the ProtectionIntent object itself. + */ + public ProtectionIntent withItemId(String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get the policyId property: ID of the backup policy with which this item is backed up. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: ID of the backup policy with which this item is backed up. + * + * @param policyId the policyId value to set. + * @return the ProtectionIntent object itself. + */ + public ProtectionIntent withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the protectionState property: Backup state of this backup item. + * + * @return the protectionState value. + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: Backup state of this backup item. + * + * @param protectionState the protectionState value to set. + * @return the ProtectionIntent object itself. + */ + public ProtectionIntent withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java new file mode 100644 index 0000000000000..283ff75444aeb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ProtectionIntentResource. */ +public interface ProtectionIntentResource { + /** + * 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 properties property: ProtectionIntentResource properties. + * + * @return the properties value. + */ + ProtectionIntent properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner + * object. + * + * @return the inner object. + */ + ProtectionIntentResourceInner innerModel(); + + /** The entirety of the ProtectionIntentResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The ProtectionIntentResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectionIntentResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ProtectionIntentResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ProtectionIntentResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vaultName, resourceGroupName, fabricName. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @return the next definition stage. + */ + WithCreate withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName); + } + /** + * The stage of the ProtectionIntentResource 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.WithProperties, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectionIntentResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectionIntentResource create(Context context); + } + /** The stage of the ProtectionIntentResource 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 ProtectionIntentResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionIntentResource properties. + * + * @param properties ProtectionIntentResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProtectionIntent properties); + } + /** The stage of the ProtectionIntentResource definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the ProtectionIntentResource resource. + * + * @return the stage of resource update. + */ + ProtectionIntentResource.Update update(); + + /** The template for ProtectionIntentResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProtectionIntentResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProtectionIntentResource apply(Context context); + } + /** The ProtectionIntentResource update stages. */ + interface UpdateStages { + /** The stage of the ProtectionIntentResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ProtectionIntentResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionIntentResource properties. + * + * @param properties ProtectionIntentResource properties. + * @return the next definition stage. + */ + Update withProperties(ProtectionIntent properties); + } + /** The stage of the ProtectionIntentResource update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectionIntentResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectionIntentResource refresh(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResourceList.java new file mode 100644 index 0000000000000..cef673d047c8a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ProtectionIntent resources. */ +@Fluent +public final class ProtectionIntentResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionIntentResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ProtectionIntentResourceList object itself. + */ + public ProtectionIntentResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionIntentResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java new file mode 100644 index 0000000000000..7c31c6ab71c25 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionIntents. */ +public interface ProtectionIntents { + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + PreValidateEnableBackupResponse validate(String azureRegion, PreValidateEnableBackupRequest parameters); + + /** + * It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed + * in properties. + * + * @param azureRegion Azure region to hit Api. + * @param parameters Enable backup validation request on Virtual Machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response contract for enable backup validation request. + */ + Response validateWithResponse( + String azureRegion, PreValidateEnableBackupRequest parameters, Context context); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + ProtectionIntentResource get( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup ProtectionIntent. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context); + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName); + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String vaultName, String resourceGroupName, String fabricName, String intentObjectName, Context context); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @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 base class for backup ProtectionIntent. + */ + ProtectionIntentResource getById(String id); + + /** + * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of + * the operation, call the GetItemOperationResult API. + * + * @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 base class for backup ProtectionIntent. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Used to remove intent from an item. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Used to remove intent from an item. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectionIntentResource resource. + * + * @param name resource name. + * @return the first stage of the new ProtectionIntentResource definition. + */ + ProtectionIntentResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java new file mode 100644 index 0000000000000..1ef12e7afdc13 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionPolicies. */ +public interface ProtectionPolicies { + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName); + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy information to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, Context context); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vaultName, String resourceGroupName, String policyName); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String vaultName, String resourceGroupName, String policyName, Context context); + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @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 base class for backup policy. + */ + ProtectionPolicyResource getById(String id); + + /** + * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + * operation. Status of the operation can be fetched using GetPolicyOperationResult API. + * + * @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 base class for backup policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of + * the operation can be fetched using GetProtectionPolicyOperationResult API. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProtectionPolicyResource resource. + * + * @param name resource name. + * @return the first stage of the new ProtectionPolicyResource definition. + */ + ProtectionPolicyResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java new file mode 100644 index 0000000000000..75b01d0c1445a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.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.recoveryservicesbackup.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; + +/** Base class for backup policy. Workload-specific backup policies are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "backupManagementType", + defaultImpl = ProtectionPolicy.class) +@JsonTypeName("ProtectionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkload", value = AzureVmWorkloadProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureStorage", value = AzureFileShareProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureIaasVM", value = AzureIaaSvmProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureSql", value = AzureSqlProtectionPolicy.class), + @JsonSubTypes.Type(name = "GenericProtectionPolicy", value = GenericProtectionPolicy.class), + @JsonSubTypes.Type(name = "MAB", value = MabProtectionPolicy.class) +}) +@Fluent +public class ProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPolicy.class); + + /* + * Number of items associated with this policy. + */ + @JsonProperty(value = "protectedItemsCount") + private Integer protectedItemsCount; + + /** + * Get the protectedItemsCount property: Number of items associated with this policy. + * + * @return the protectedItemsCount value. + */ + public Integer protectedItemsCount() { + return this.protectedItemsCount; + } + + /** + * Set the protectedItemsCount property: Number of items associated with this policy. + * + * @param protectedItemsCount the protectedItemsCount value to set. + * @return the ProtectionPolicy object itself. + */ + public ProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + this.protectedItemsCount = protectedItemsCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java new file mode 100644 index 0000000000000..382170cd890f6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionPolicyOperationResults. */ +public interface ProtectionPolicyOperationResults { + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName, String operationId); + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's result needs to be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup policy. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java new file mode 100644 index 0000000000000..eaf02d5f6cf1b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProtectionPolicyOperationStatuses. */ +public interface ProtectionPolicyOperationStatuses { + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + OperationStatus get(String vaultName, String resourceGroupName, String policyName, String operationId); + + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some + * operations create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getWithResponse( + String vaultName, String resourceGroupName, String policyName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java new file mode 100644 index 0000000000000..e9761c0b3351c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ProtectionPolicyResource. */ +public interface ProtectionPolicyResource { + /** + * 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 properties property: ProtectionPolicyResource properties. + * + * @return the properties value. + */ + ProtectionPolicy properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * 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.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner + * object. + * + * @return the inner object. + */ + ProtectionPolicyResourceInner innerModel(); + + /** The entirety of the ProtectionPolicyResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The ProtectionPolicyResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ProtectionPolicyResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ProtectionPolicyResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ProtectionPolicyResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies vaultName, resourceGroupName. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingVault(String vaultName, String resourceGroupName); + } + /** + * The stage of the ProtectionPolicyResource 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.WithProperties, DefinitionStages.WithEtag { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProtectionPolicyResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProtectionPolicyResource create(Context context); + } + /** The stage of the ProtectionPolicyResource 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 ProtectionPolicyResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionPolicyResource properties. + * + * @param properties ProtectionPolicyResource properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProtectionPolicy properties); + } + /** The stage of the ProtectionPolicyResource definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + } + /** + * Begins update for the ProtectionPolicyResource resource. + * + * @return the stage of resource update. + */ + ProtectionPolicyResource.Update update(); + + /** The template for ProtectionPolicyResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProtectionPolicyResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProtectionPolicyResource apply(Context context); + } + /** The ProtectionPolicyResource update stages. */ + interface UpdateStages { + /** The stage of the ProtectionPolicyResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ProtectionPolicyResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: ProtectionPolicyResource properties. + * + * @param properties ProtectionPolicyResource properties. + * @return the next definition stage. + */ + Update withProperties(ProtectionPolicy properties); + } + /** The stage of the ProtectionPolicyResource update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Optional ETag.. + * + * @param etag Optional ETag. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProtectionPolicyResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProtectionPolicyResource refresh(Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResourceList.java new file mode 100644 index 0000000000000..93e85d9a58531 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ProtectionPolicy resources. */ +@Fluent +public final class ProtectionPolicyResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtectionPolicyResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the ProtectionPolicyResourceList object itself. + */ + public ProtectionPolicyResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProtectionPolicyResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java new file mode 100644 index 0000000000000..a9e957b3c06c2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtectionState. */ +public final class ProtectionState extends ExpandableStringEnum { + /** Static value Invalid for ProtectionState. */ + public static final ProtectionState INVALID = fromString("Invalid"); + + /** Static value IRPending for ProtectionState. */ + public static final ProtectionState IRPENDING = fromString("IRPending"); + + /** Static value Protected for ProtectionState. */ + public static final ProtectionState PROTECTED = fromString("Protected"); + + /** Static value ProtectionError for ProtectionState. */ + public static final ProtectionState PROTECTION_ERROR = fromString("ProtectionError"); + + /** Static value ProtectionStopped for ProtectionState. */ + public static final ProtectionState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** Static value ProtectionPaused for ProtectionState. */ + public static final ProtectionState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates or finds a ProtectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionState. + */ + @JsonCreator + public static ProtectionState fromString(String name) { + return fromString(name, ProtectionState.class); + } + + /** @return known ProtectionState values. */ + public static Collection values() { + return values(ProtectionState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java new file mode 100644 index 0000000000000..f7ca4ccafc080 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtectionStatus. */ +public final class ProtectionStatus extends ExpandableStringEnum { + /** Static value Invalid for ProtectionStatus. */ + public static final ProtectionStatus INVALID = fromString("Invalid"); + + /** Static value NotProtected for ProtectionStatus. */ + public static final ProtectionStatus NOT_PROTECTED = fromString("NotProtected"); + + /** Static value Protecting for ProtectionStatus. */ + public static final ProtectionStatus PROTECTING = fromString("Protecting"); + + /** Static value Protected for ProtectionStatus. */ + public static final ProtectionStatus PROTECTED = fromString("Protected"); + + /** Static value ProtectionFailed for ProtectionStatus. */ + public static final ProtectionStatus PROTECTION_FAILED = fromString("ProtectionFailed"); + + /** + * Creates or finds a ProtectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtectionStatus. + */ + @JsonCreator + public static ProtectionStatus fromString(String name) { + return fromString(name, ProtectionStatus.class); + } + + /** @return known ProtectionStatus values. */ + public static Collection values() { + return values(ProtectionStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java new file mode 100644 index 0000000000000..b9ca5161ebc6c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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.recoveryservicesbackup.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 Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Pending for ProvisioningState. */ + public static final ProvisioningState PENDING = fromString("Pending"); + + /** + * 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java new file mode 100644 index 0000000000000..fc2fd27c9fe68 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryMode. */ +public final class RecoveryMode extends ExpandableStringEnum { + /** Static value Invalid for RecoveryMode. */ + public static final RecoveryMode INVALID = fromString("Invalid"); + + /** Static value FileRecovery for RecoveryMode. */ + public static final RecoveryMode FILE_RECOVERY = fromString("FileRecovery"); + + /** Static value WorkloadRecovery for RecoveryMode. */ + public static final RecoveryMode WORKLOAD_RECOVERY = fromString("WorkloadRecovery"); + + /** + * Creates or finds a RecoveryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryMode. + */ + @JsonCreator + public static RecoveryMode fromString(String name) { + return fromString(name, RecoveryMode.class); + } + + /** @return known RecoveryMode values. */ + public static Collection values() { + return values(RecoveryMode.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java new file mode 100644 index 0000000000000..171bc8635ba4a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for backup copies. Workload-specific backup copies are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = RecoveryPoint.class) +@JsonTypeName("RecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareRecoveryPoint", value = AzureFileShareRecoveryPoint.class), + @JsonSubTypes.Type(name = "AzureWorkloadRecoveryPoint", value = AzureWorkloadRecoveryPoint.class), + @JsonSubTypes.Type(name = "GenericRecoveryPoint", value = GenericRecoveryPoint.class), + @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPoint.class), + @JsonSubTypes.Type(name = "AzureFileShareRecoveryPoint", value = AzureFileShareRecoveryPointAutoGenerated.class), + @JsonSubTypes.Type(name = "AzureWorkloadRecoveryPoint", value = AzureWorkloadRecoveryPointAutoGenerated.class), + @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPointAutoGenerated.class) +}) +@Immutable +public class RecoveryPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPoint.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java new file mode 100644 index 0000000000000..9f3c64bbeaf45 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Disk configuration. */ +@Fluent +public final class RecoveryPointDiskConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointDiskConfiguration.class); + + /* + * Number of disks included in backup + */ + @JsonProperty(value = "numberOfDisksIncludedInBackup") + private Integer numberOfDisksIncludedInBackup; + + /* + * Number of disks attached to the VM + */ + @JsonProperty(value = "numberOfDisksAttachedToVm") + private Integer numberOfDisksAttachedToVm; + + /* + * Information of disks included in backup + */ + @JsonProperty(value = "includedDiskList") + private List includedDiskList; + + /* + * Information of disks excluded from backup + */ + @JsonProperty(value = "excludedDiskList") + private List excludedDiskList; + + /** + * Get the numberOfDisksIncludedInBackup property: Number of disks included in backup. + * + * @return the numberOfDisksIncludedInBackup value. + */ + public Integer numberOfDisksIncludedInBackup() { + return this.numberOfDisksIncludedInBackup; + } + + /** + * Set the numberOfDisksIncludedInBackup property: Number of disks included in backup. + * + * @param numberOfDisksIncludedInBackup the numberOfDisksIncludedInBackup value to set. + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withNumberOfDisksIncludedInBackup(Integer numberOfDisksIncludedInBackup) { + this.numberOfDisksIncludedInBackup = numberOfDisksIncludedInBackup; + return this; + } + + /** + * Get the numberOfDisksAttachedToVm property: Number of disks attached to the VM. + * + * @return the numberOfDisksAttachedToVm value. + */ + public Integer numberOfDisksAttachedToVm() { + return this.numberOfDisksAttachedToVm; + } + + /** + * Set the numberOfDisksAttachedToVm property: Number of disks attached to the VM. + * + * @param numberOfDisksAttachedToVm the numberOfDisksAttachedToVm value to set. + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withNumberOfDisksAttachedToVm(Integer numberOfDisksAttachedToVm) { + this.numberOfDisksAttachedToVm = numberOfDisksAttachedToVm; + return this; + } + + /** + * Get the includedDiskList property: Information of disks included in backup. + * + * @return the includedDiskList value. + */ + public List includedDiskList() { + return this.includedDiskList; + } + + /** + * Set the includedDiskList property: Information of disks included in backup. + * + * @param includedDiskList the includedDiskList value to set. + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withIncludedDiskList(List includedDiskList) { + this.includedDiskList = includedDiskList; + return this; + } + + /** + * Get the excludedDiskList property: Information of disks excluded from backup. + * + * @return the excludedDiskList value. + */ + public List excludedDiskList() { + return this.excludedDiskList; + } + + /** + * Set the excludedDiskList property: Information of disks excluded from backup. + * + * @param excludedDiskList the excludedDiskList value to set. + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withExcludedDiskList(List excludedDiskList) { + this.excludedDiskList = excludedDiskList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (includedDiskList() != null) { + includedDiskList().forEach(e -> e.validate()); + } + if (excludedDiskList() != null) { + excludedDiskList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java new file mode 100644 index 0000000000000..dc128560ba861 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.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.recoveryservicesbackup.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 RecoveryPointMoveReadinessInfo model. */ +@Fluent +public final class RecoveryPointMoveReadinessInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointMoveReadinessInfo.class); + + /* + * The isReadyForMove property. + */ + @JsonProperty(value = "isReadyForMove") + private Boolean isReadyForMove; + + /* + * The additionalInfo property. + */ + @JsonProperty(value = "additionalInfo") + private String additionalInfo; + + /** + * Get the isReadyForMove property: The isReadyForMove property. + * + * @return the isReadyForMove value. + */ + public Boolean isReadyForMove() { + return this.isReadyForMove; + } + + /** + * Set the isReadyForMove property: The isReadyForMove property. + * + * @param isReadyForMove the isReadyForMove value to set. + * @return the RecoveryPointMoveReadinessInfo object itself. + */ + public RecoveryPointMoveReadinessInfo withIsReadyForMove(Boolean isReadyForMove) { + this.isReadyForMove = isReadyForMove; + return this; + } + + /** + * Get the additionalInfo property: The additionalInfo property. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * Set the additionalInfo property: The additionalInfo property. + * + * @param additionalInfo the additionalInfo value to set. + * @return the RecoveryPointMoveReadinessInfo object itself. + */ + public RecoveryPointMoveReadinessInfo withAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java new file mode 100644 index 0000000000000..edbd1b6067b9b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** RP Rehydration Info. */ +@Fluent +public final class RecoveryPointRehydrationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointRehydrationInfo.class); + + /* + * How long the rehydrated RP should be kept + * Should be ISO8601 Duration format e.g. "P7D" + */ + @JsonProperty(value = "rehydrationRetentionDuration") + private String rehydrationRetentionDuration; + + /* + * Rehydration Priority + */ + @JsonProperty(value = "rehydrationPriority") + private RehydrationPriority rehydrationPriority; + + /** + * Get the rehydrationRetentionDuration property: How long the rehydrated RP should be kept Should be ISO8601 + * Duration format e.g. "P7D". + * + * @return the rehydrationRetentionDuration value. + */ + public String rehydrationRetentionDuration() { + return this.rehydrationRetentionDuration; + } + + /** + * Set the rehydrationRetentionDuration property: How long the rehydrated RP should be kept Should be ISO8601 + * Duration format e.g. "P7D". + * + * @param rehydrationRetentionDuration the rehydrationRetentionDuration value to set. + * @return the RecoveryPointRehydrationInfo object itself. + */ + public RecoveryPointRehydrationInfo withRehydrationRetentionDuration(String rehydrationRetentionDuration) { + this.rehydrationRetentionDuration = rehydrationRetentionDuration; + return this; + } + + /** + * Get the rehydrationPriority property: Rehydration Priority. + * + * @return the rehydrationPriority value. + */ + public RehydrationPriority rehydrationPriority() { + return this.rehydrationPriority; + } + + /** + * Set the rehydrationPriority property: Rehydration Priority. + * + * @param rehydrationPriority the rehydrationPriority value to set. + * @return the RecoveryPointRehydrationInfo object itself. + */ + public RecoveryPointRehydrationInfo withRehydrationPriority(RehydrationPriority rehydrationPriority) { + this.rehydrationPriority = rehydrationPriority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java new file mode 100644 index 0000000000000..66345189b5cc4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import java.util.Map; + +/** An immutable client-side representation of RecoveryPointResource. */ +public interface RecoveryPointResource { + /** + * 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 properties property: RecoveryPointResource properties. + * + * @return the properties value. + */ + RecoveryPoint properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner object. + * + * @return the inner object. + */ + RecoveryPointResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResourceList.java new file mode 100644 index 0000000000000..c6853dceb5721 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RecoveryPoint resources. */ +@Fluent +public final class RecoveryPointResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the RecoveryPointResourceList object itself. + */ + public RecoveryPointResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public RecoveryPointResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java new file mode 100644 index 0000000000000..cbbab0feabb84 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Recovery point tier information. */ +@Fluent +public final class RecoveryPointTierInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryPointTierInformation.class); + + /* + * Recovery point tier type. + */ + @JsonProperty(value = "type") + private RecoveryPointTierType type; + + /* + * Recovery point tier status. + */ + @JsonProperty(value = "status") + private RecoveryPointTierStatus status; + + /* + * Recovery point tier status. + */ + @JsonProperty(value = "extendedInfo") + private Map extendedInfo; + + /** + * Get the type property: Recovery point tier type. + * + * @return the type value. + */ + public RecoveryPointTierType type() { + return this.type; + } + + /** + * Set the type property: Recovery point tier type. + * + * @param type the type value to set. + * @return the RecoveryPointTierInformation object itself. + */ + public RecoveryPointTierInformation withType(RecoveryPointTierType type) { + this.type = type; + return this; + } + + /** + * Get the status property: Recovery point tier status. + * + * @return the status value. + */ + public RecoveryPointTierStatus status() { + return this.status; + } + + /** + * Set the status property: Recovery point tier status. + * + * @param status the status value to set. + * @return the RecoveryPointTierInformation object itself. + */ + public RecoveryPointTierInformation withStatus(RecoveryPointTierStatus status) { + this.status = status; + return this; + } + + /** + * Get the extendedInfo property: Recovery point tier status. + * + * @return the extendedInfo value. + */ + public Map extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Recovery point tier status. + * + * @param extendedInfo the extendedInfo value to set. + * @return the RecoveryPointTierInformation object itself. + */ + public RecoveryPointTierInformation withExtendedInfo(Map extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java new file mode 100644 index 0000000000000..39498a4ee4fea --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.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.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecoveryPointTierStatus. */ +public enum RecoveryPointTierStatus { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Valid. */ + VALID("Valid"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Deleted. */ + DELETED("Deleted"), + + /** Enum value Rehydrated. */ + REHYDRATED("Rehydrated"); + + /** The actual serialized value for a RecoveryPointTierStatus instance. */ + private final String value; + + RecoveryPointTierStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierStatus object, or null if unable to parse. + */ + @JsonCreator + public static RecoveryPointTierStatus fromString(String value) { + RecoveryPointTierStatus[] items = RecoveryPointTierStatus.values(); + for (RecoveryPointTierStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java new file mode 100644 index 0000000000000..1f8052c0bbc3e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.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.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecoveryPointTierType. */ +public enum RecoveryPointTierType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value InstantRP. */ + INSTANT_RP("InstantRP"), + + /** Enum value HardenedRP. */ + HARDENED_RP("HardenedRP"), + + /** Enum value ArchivedRP. */ + ARCHIVED_RP("ArchivedRP"); + + /** The actual serialized value for a RecoveryPointTierType instance. */ + private final String value; + + RecoveryPointTierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierType object, or null if unable to parse. + */ + @JsonCreator + public static RecoveryPointTierType fromString(String value) { + RecoveryPointTierType[] items = RecoveryPointTierType.values(); + for (RecoveryPointTierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java new file mode 100644 index 0000000000000..5c6ff7e9272b3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AadPropertiesResourceInner; + +/** Resource collection API of RecoveryPoints. */ +public interface RecoveryPoints { + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + RecoveryPointResource get( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId); + + /** + * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous + * operation. To know the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with backed up item. + * @param containerName Container name associated with backed up item. + * @param protectedItemName Backed up item name whose backup data needs to be fetched. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + Response getWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + Context context); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + CrrAccessTokenResource getAccessToken( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters); + + /** + * Returns the Access token for communication between BMS and Protection service. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param protectedItemName Name of the Protected Item. + * @param recoveryPointId Recovery Point Id. + * @param parameters Get Access Token request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getAccessTokenWithResponse( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + AadPropertiesResourceInner parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java new file mode 100644 index 0000000000000..268ba7c236dbd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsCrrs.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of RecoveryPointsCrrs. */ +public interface RecoveryPointsCrrs { + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists the backup copies for the backed up item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param containerName Container name associated with the backed up item. + * @param protectedItemName Backed up item whose backup copies are to be fetched. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String filter, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java new file mode 100644 index 0000000000000..e6722680cb25c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of RecoveryPointsRecommendedForMoves. */ +public interface RecoveryPointsRecommendedForMoves { + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters); + + /** + * Lists the recovery points recommended for move to another tier. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param parameters List Recovery points Recommended for Move Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RecoveryPoint resources. + */ + PagedIterable list( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + ListRecoveryPointsRecommendedForMoveRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java new file mode 100644 index 0000000000000..07fcd729b7b0c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RecoveryType. */ +public final class RecoveryType extends ExpandableStringEnum { + /** Static value Invalid for RecoveryType. */ + public static final RecoveryType INVALID = fromString("Invalid"); + + /** Static value OriginalLocation for RecoveryType. */ + public static final RecoveryType ORIGINAL_LOCATION = fromString("OriginalLocation"); + + /** Static value AlternateLocation for RecoveryType. */ + public static final RecoveryType ALTERNATE_LOCATION = fromString("AlternateLocation"); + + /** Static value RestoreDisks for RecoveryType. */ + public static final RecoveryType RESTORE_DISKS = fromString("RestoreDisks"); + + /** Static value Offline for RecoveryType. */ + public static final RecoveryType OFFLINE = fromString("Offline"); + + /** + * Creates or finds a RecoveryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryType. + */ + @JsonCreator + public static RecoveryType fromString(String name) { + return fromString(name, RecoveryType.class); + } + + /** @return known RecoveryType values. */ + public static Collection values() { + return values(RecoveryType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java new file mode 100644 index 0000000000000..2d6c489c35a7b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RehydrationPriority. */ +public final class RehydrationPriority extends ExpandableStringEnum { + /** Static value Standard for RehydrationPriority. */ + public static final RehydrationPriority STANDARD = fromString("Standard"); + + /** Static value High for RehydrationPriority. */ + public static final RehydrationPriority HIGH = fromString("High"); + + /** + * Creates or finds a RehydrationPriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding RehydrationPriority. + */ + @JsonCreator + public static RehydrationPriority fromString(String name) { + return fromString(name, RehydrationPriority.class); + } + + /** @return known RehydrationPriority values. */ + public static Collection values() { + return values(RehydrationPriority.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java new file mode 100644 index 0000000000000..c13e50a1191ef --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Health Details for backup items. */ +@Immutable +public class ResourceHealthDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceHealthDetails.class); + + /* + * Health Code + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private Integer code; + + /* + * Health Title + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /* + * Health Message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Health Recommended Actions + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get the code property: Health Code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Get the title property: Health Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the message property: Health Message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the recommendations property: Health Recommended Actions. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java new file mode 100644 index 0000000000000..765b35e844323 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceHealthStatus. */ +public final class ResourceHealthStatus extends ExpandableStringEnum { + /** Static value Healthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus HEALTHY = fromString("Healthy"); + + /** Static value TransientDegraded for ResourceHealthStatus. */ + public static final ResourceHealthStatus TRANSIENT_DEGRADED = fromString("TransientDegraded"); + + /** Static value PersistentDegraded for ResourceHealthStatus. */ + public static final ResourceHealthStatus PERSISTENT_DEGRADED = fromString("PersistentDegraded"); + + /** Static value TransientUnhealthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus TRANSIENT_UNHEALTHY = fromString("TransientUnhealthy"); + + /** Static value PersistentUnhealthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus PERSISTENT_UNHEALTHY = fromString("PersistentUnhealthy"); + + /** Static value Invalid for ResourceHealthStatus. */ + public static final ResourceHealthStatus INVALID = fromString("Invalid"); + + /** + * Creates or finds a ResourceHealthStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceHealthStatus. + */ + @JsonCreator + public static ResourceHealthStatus fromString(String name) { + return fromString(name, ResourceHealthStatus.class); + } + + /** @return known ResourceHealthStatus values. */ + public static Collection values() { + return values(ResourceHealthStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java new file mode 100644 index 0000000000000..bf8758e908af2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base for all lists of resources. */ +@Fluent +public class ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceList.class); + + /* + * The uri to fetch the next page of resources. Call ListNext() fetches + * next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of resources. Call ListNext() fetches next page of + * resources. + * + * @param nextLink the nextLink value to set. + * @return the ResourceList object itself. + */ + public ResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java new file mode 100644 index 0000000000000..30b9b7cc0c1b3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId 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. + */ + OperationStatus getOperationStatus(String vaultName, String resourceGroupName, String operationId); + + /** + * Fetches operation status for data move operation on vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId The operationId parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + Response getOperationStatusWithResponse( + String vaultName, String resourceGroupName, String operationId, Context context); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); + + /** + * Prepares source vault for Data Move operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Prepare data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void bmsPrepareDataMove( + String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, Context context); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); + + /** + * Triggers Data Move Operation on target vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters Trigger data move request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void bmsTriggerDataMove( + String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, Context context); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters); + + /** + * Move recovery point from one datastore to another store. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName The fabricName parameter. + * @param containerName The containerName parameter. + * @param protectedItemName The protectedItemName parameter. + * @param recoveryPointId The recoveryPointId parameter. + * @param parameters Move Resource Across Tiers Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void moveRecoveryPoint( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + MoveRPAcrossTiersRequest parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java new file mode 100644 index 0000000000000..d0fcb0dffedd9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.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.recoveryservicesbackup.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; + +/** Restore file specs like file path, type and target folder path info. */ +@Fluent +public final class RestoreFileSpecs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreFileSpecs.class); + + /* + * Source File/Folder path + */ + @JsonProperty(value = "path") + private String path; + + /* + * Indicates what the Path variable stands for + */ + @JsonProperty(value = "fileSpecType") + private String fileSpecType; + + /* + * Destination folder path in target FileShare + */ + @JsonProperty(value = "targetFolderPath") + private String targetFolderPath; + + /** + * Get the path property: Source File/Folder path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Source File/Folder path. + * + * @param path the path value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the fileSpecType property: Indicates what the Path variable stands for. + * + * @return the fileSpecType value. + */ + public String fileSpecType() { + return this.fileSpecType; + } + + /** + * Set the fileSpecType property: Indicates what the Path variable stands for. + * + * @param fileSpecType the fileSpecType value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withFileSpecType(String fileSpecType) { + this.fileSpecType = fileSpecType; + return this; + } + + /** + * Get the targetFolderPath property: Destination folder path in target FileShare. + * + * @return the targetFolderPath value. + */ + public String targetFolderPath() { + return this.targetFolderPath; + } + + /** + * Set the targetFolderPath property: Destination folder path in target FileShare. + * + * @param targetFolderPath the targetFolderPath value to set. + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withTargetFolderPath(String targetFolderPath) { + this.targetFolderPath = targetFolderPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java new file mode 100644 index 0000000000000..40e89e5a31429 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointQueryType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestorePointQueryType. */ +public final class RestorePointQueryType extends ExpandableStringEnum { + /** Static value Invalid for RestorePointQueryType. */ + public static final RestorePointQueryType INVALID = fromString("Invalid"); + + /** Static value Full for RestorePointQueryType. */ + public static final RestorePointQueryType FULL = fromString("Full"); + + /** Static value Log for RestorePointQueryType. */ + public static final RestorePointQueryType LOG = fromString("Log"); + + /** Static value Differential for RestorePointQueryType. */ + public static final RestorePointQueryType DIFFERENTIAL = fromString("Differential"); + + /** Static value FullAndDifferential for RestorePointQueryType. */ + public static final RestorePointQueryType FULL_AND_DIFFERENTIAL = fromString("FullAndDifferential"); + + /** Static value All for RestorePointQueryType. */ + public static final RestorePointQueryType ALL = fromString("All"); + + /** Static value Incremental for RestorePointQueryType. */ + public static final RestorePointQueryType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a RestorePointQueryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointQueryType. + */ + @JsonCreator + public static RestorePointQueryType fromString(String name) { + return fromString(name, RestorePointQueryType.class); + } + + /** @return known RestorePointQueryType values. */ + public static Collection values() { + return values(RestorePointQueryType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java new file mode 100644 index 0000000000000..8d963a52d2c6d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestorePointType. */ +public final class RestorePointType extends ExpandableStringEnum { + /** Static value Invalid for RestorePointType. */ + public static final RestorePointType INVALID = fromString("Invalid"); + + /** Static value Full for RestorePointType. */ + public static final RestorePointType FULL = fromString("Full"); + + /** Static value Log for RestorePointType. */ + public static final RestorePointType LOG = fromString("Log"); + + /** Static value Differential for RestorePointType. */ + public static final RestorePointType DIFFERENTIAL = fromString("Differential"); + + /** Static value Incremental for RestorePointType. */ + public static final RestorePointType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a RestorePointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestorePointType. + */ + @JsonCreator + public static RestorePointType fromString(String name) { + return fromString(name, RestorePointType.class); + } + + /** @return known RestorePointType values. */ + public static Collection values() { + return values(RestorePointType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java new file mode 100644 index 0000000000000..e1bd16316fe43 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for restore request. Workload-specific restore requests are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = RestoreRequest.class) +@JsonTypeName("RestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareRestoreRequest", value = AzureFileShareRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadRestoreRequest", value = AzureWorkloadRestoreRequest.class), + @JsonSubTypes.Type(name = "IaasVMRestoreRequest", value = IaasVMRestoreRequest.class) +}) +@Immutable +public class RestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java new file mode 100644 index 0000000000000..3b86166ed57a6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Base class for restore request. Workload-specific restore requests are derived from this class. */ +@Fluent +public final class RestoreRequestResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreRequestResource.class); + + /* + * RestoreRequestResource properties + */ + @JsonProperty(value = "properties") + private RestoreRequest properties; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the properties property: RestoreRequestResource properties. + * + * @return the properties value. + */ + public RestoreRequest properties() { + return this.properties; + } + + /** + * Set the properties property: RestoreRequestResource properties. + * + * @param properties the properties value to set. + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withProperties(RestoreRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Optional ETag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Optional ETag. + * + * @param etag the etag value to set. + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public RestoreRequestResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RestoreRequestResource withTags(Map tags) { + super.withTags(tags); + 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/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java new file mode 100644 index 0000000000000..90ce84417bf45 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestoreRequestType. */ +public final class RestoreRequestType extends ExpandableStringEnum { + /** Static value Invalid for RestoreRequestType. */ + public static final RestoreRequestType INVALID = fromString("Invalid"); + + /** Static value FullShareRestore for RestoreRequestType. */ + public static final RestoreRequestType FULL_SHARE_RESTORE = fromString("FullShareRestore"); + + /** Static value ItemLevelRestore for RestoreRequestType. */ + public static final RestoreRequestType ITEM_LEVEL_RESTORE = fromString("ItemLevelRestore"); + + /** + * Creates or finds a RestoreRequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestoreRequestType. + */ + @JsonCreator + public static RestoreRequestType fromString(String name) { + return fromString(name, RestoreRequestType.class); + } + + /** @return known RestoreRequestType values. */ + public static Collection values() { + return values(RestoreRequestType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java new file mode 100644 index 0000000000000..0110512e14f74 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** Resource collection API of Restores. */ +public interface Restores { + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters); + + /** + * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, + * use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item to be restored. + * @param recoveryPointId Recovery point ID which represents the backed up data to be restored. + * @param parameters resource restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger( + String vaultName, + String resourceGroupName, + String fabricName, + String containerName, + String protectedItemName, + String recoveryPointId, + RestoreRequestResource parameters, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java new file mode 100644 index 0000000000000..39f84164b0600 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.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.recoveryservicesbackup.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; + +/** Retention duration. */ +@Fluent +public final class RetentionDuration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionDuration.class); + + /* + * Count of duration types. Retention duration is obtained by the counting + * the duration type Count times. + * For example, when Count = 3 and DurationType = Weeks, retention duration + * will be three weeks. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * Retention duration type of retention policy. + */ + @JsonProperty(value = "durationType") + private RetentionDurationType durationType; + + /** + * Get the count property: Count of duration types. Retention duration is obtained by the counting the duration type + * Count times. For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Count of duration types. Retention duration is obtained by the counting the duration type + * Count times. For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + * + * @param count the count value to set. + * @return the RetentionDuration object itself. + */ + public RetentionDuration withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the durationType property: Retention duration type of retention policy. + * + * @return the durationType value. + */ + public RetentionDurationType durationType() { + return this.durationType; + } + + /** + * Set the durationType property: Retention duration type of retention policy. + * + * @param durationType the durationType value to set. + * @return the RetentionDuration object itself. + */ + public RetentionDuration withDurationType(RetentionDurationType durationType) { + this.durationType = durationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java new file mode 100644 index 0000000000000..b6b75c3811a09 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RetentionDurationType. */ +public final class RetentionDurationType extends ExpandableStringEnum { + /** Static value Invalid for RetentionDurationType. */ + public static final RetentionDurationType INVALID = fromString("Invalid"); + + /** Static value Days for RetentionDurationType. */ + public static final RetentionDurationType DAYS = fromString("Days"); + + /** Static value Weeks for RetentionDurationType. */ + public static final RetentionDurationType WEEKS = fromString("Weeks"); + + /** Static value Months for RetentionDurationType. */ + public static final RetentionDurationType MONTHS = fromString("Months"); + + /** Static value Years for RetentionDurationType. */ + public static final RetentionDurationType YEARS = fromString("Years"); + + /** + * Creates or finds a RetentionDurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RetentionDurationType. + */ + @JsonCreator + public static RetentionDurationType fromString(String name) { + return fromString(name, RetentionDurationType.class); + } + + /** @return known RetentionDurationType values. */ + public static Collection values() { + return values(RetentionDurationType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java new file mode 100644 index 0000000000000..f9341eb299ab7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for retention policy. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "retentionPolicyType", + defaultImpl = RetentionPolicy.class) +@JsonTypeName("RetentionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LongTermRetentionPolicy", value = LongTermRetentionPolicy.class), + @JsonSubTypes.Type(name = "SimpleRetentionPolicy", value = SimpleRetentionPolicy.class) +}) +@Immutable +public class RetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicy.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java new file mode 100644 index 0000000000000..0adb53e88628b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RetentionScheduleFormat. */ +public final class RetentionScheduleFormat extends ExpandableStringEnum { + /** Static value Invalid for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat INVALID = fromString("Invalid"); + + /** Static value Daily for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat DAILY = fromString("Daily"); + + /** Static value Weekly for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a RetentionScheduleFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding RetentionScheduleFormat. + */ + @JsonCreator + public static RetentionScheduleFormat fromString(String name) { + return fromString(name, RetentionScheduleFormat.class); + } + + /** @return known RetentionScheduleFormat values. */ + public static Collection values() { + return values(RetentionScheduleFormat.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java new file mode 100644 index 0000000000000..45fd54e7f09ac --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.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.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for backup schedule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "schedulePolicyType", + defaultImpl = SchedulePolicy.class) +@JsonTypeName("SchedulePolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LogSchedulePolicy", value = LogSchedulePolicy.class), + @JsonSubTypes.Type(name = "LongTermSchedulePolicy", value = LongTermSchedulePolicy.class), + @JsonSubTypes.Type(name = "SimpleSchedulePolicy", value = SimpleSchedulePolicy.class) +}) +@Immutable +public class SchedulePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchedulePolicy.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java new file mode 100644 index 0000000000000..94b0fbfb3dc37 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScheduleRunType. */ +public final class ScheduleRunType extends ExpandableStringEnum { + /** Static value Invalid for ScheduleRunType. */ + public static final ScheduleRunType INVALID = fromString("Invalid"); + + /** Static value Daily for ScheduleRunType. */ + public static final ScheduleRunType DAILY = fromString("Daily"); + + /** Static value Weekly for ScheduleRunType. */ + public static final ScheduleRunType WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a ScheduleRunType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScheduleRunType. + */ + @JsonCreator + public static ScheduleRunType fromString(String name) { + return fromString(name, ScheduleRunType.class); + } + + /** @return known ScheduleRunType values. */ + public static Collection values() { + return values(ScheduleRunType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java new file mode 100644 index 0000000000000..c58e1ea862ffe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.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.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SecurityPINs. */ +public interface SecurityPINs { + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + TokenInformation get(String vaultName, String resourceGroupName); + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the security PIN. + */ + Response getWithResponse(String vaultName, String resourceGroupName, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java new file mode 100644 index 0000000000000..3182a4e2301c5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.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.recoveryservicesbackup.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; + +/** Common settings field for backup management. */ +@Fluent +public final class Settings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Settings.class); + + /* + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * SQL compression flag + */ + @JsonProperty(value = "issqlcompression") + private Boolean issqlcompression; + + /* + * Workload compression flag. This has been added so that + * 'isSqlCompression' + * will be deprecated once clients upgrade to consider this flag. + */ + @JsonProperty(value = "isCompression") + private Boolean isCompression; + + /** + * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set. + * @return the Settings object itself. + */ + public Settings withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the issqlcompression property: SQL compression flag. + * + * @return the issqlcompression value. + */ + public Boolean issqlcompression() { + return this.issqlcompression; + } + + /** + * Set the issqlcompression property: SQL compression flag. + * + * @param issqlcompression the issqlcompression value to set. + * @return the Settings object itself. + */ + public Settings withIssqlcompression(Boolean issqlcompression) { + this.issqlcompression = issqlcompression; + return this; + } + + /** + * Get the isCompression property: Workload compression flag. This has been added so that 'isSqlCompression' will be + * deprecated once clients upgrade to consider this flag. + * + * @return the isCompression value. + */ + public Boolean isCompression() { + return this.isCompression; + } + + /** + * Set the isCompression property: Workload compression flag. This has been added so that 'isSqlCompression' will be + * deprecated once clients upgrade to consider this flag. + * + * @param isCompression the isCompression value to set. + * @return the Settings object itself. + */ + public Settings withIsCompression(Boolean isCompression) { + this.isCompression = isCompression; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java new file mode 100644 index 0000000000000..ee24961a3863a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.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.recoveryservicesbackup.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; + +/** Simple policy retention. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType") +@JsonTypeName("SimpleRetentionPolicy") +@Fluent +public final class SimpleRetentionPolicy extends RetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimpleRetentionPolicy.class); + + /* + * Retention duration of the protection policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the retentionDuration property: Retention duration of the protection policy. + * + * @return the retentionDuration value. + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retentionDuration property: Retention duration of the protection policy. + * + * @param retentionDuration the retentionDuration value to set. + * @return the SimpleRetentionPolicy object itself. + */ + public SimpleRetentionPolicy withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (retentionDuration() != null) { + retentionDuration().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java new file mode 100644 index 0000000000000..f1165329c525e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Simple policy schedule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("SimpleSchedulePolicy") +@Fluent +public final class SimpleSchedulePolicy extends SchedulePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimpleSchedulePolicy.class); + + /* + * Frequency of the schedule operation of this policy. + */ + @JsonProperty(value = "scheduleRunFrequency") + private ScheduleRunType scheduleRunFrequency; + + /* + * List of days of week this schedule has to be run. + */ + @JsonProperty(value = "scheduleRunDays") + private List scheduleRunDays; + + /* + * List of times of day this schedule has to be run. + */ + @JsonProperty(value = "scheduleRunTimes") + private List scheduleRunTimes; + + /* + * At every number weeks this schedule has to be run. + */ + @JsonProperty(value = "scheduleWeeklyFrequency") + private Integer scheduleWeeklyFrequency; + + /** + * Get the scheduleRunFrequency property: Frequency of the schedule operation of this policy. + * + * @return the scheduleRunFrequency value. + */ + public ScheduleRunType scheduleRunFrequency() { + return this.scheduleRunFrequency; + } + + /** + * Set the scheduleRunFrequency property: Frequency of the schedule operation of this policy. + * + * @param scheduleRunFrequency the scheduleRunFrequency value to set. + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunFrequency(ScheduleRunType scheduleRunFrequency) { + this.scheduleRunFrequency = scheduleRunFrequency; + return this; + } + + /** + * Get the scheduleRunDays property: List of days of week this schedule has to be run. + * + * @return the scheduleRunDays value. + */ + public List scheduleRunDays() { + return this.scheduleRunDays; + } + + /** + * Set the scheduleRunDays property: List of days of week this schedule has to be run. + * + * @param scheduleRunDays the scheduleRunDays value to set. + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunDays(List scheduleRunDays) { + this.scheduleRunDays = scheduleRunDays; + return this; + } + + /** + * Get the scheduleRunTimes property: List of times of day this schedule has to be run. + * + * @return the scheduleRunTimes value. + */ + public List scheduleRunTimes() { + return this.scheduleRunTimes; + } + + /** + * Set the scheduleRunTimes property: List of times of day this schedule has to be run. + * + * @param scheduleRunTimes the scheduleRunTimes value to set. + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunTimes(List scheduleRunTimes) { + this.scheduleRunTimes = scheduleRunTimes; + return this; + } + + /** + * Get the scheduleWeeklyFrequency property: At every number weeks this schedule has to be run. + * + * @return the scheduleWeeklyFrequency value. + */ + public Integer scheduleWeeklyFrequency() { + return this.scheduleWeeklyFrequency; + } + + /** + * Set the scheduleWeeklyFrequency property: At every number weeks this schedule has to be run. + * + * @param scheduleWeeklyFrequency the scheduleWeeklyFrequency value to set. + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleWeeklyFrequency(Integer scheduleWeeklyFrequency) { + this.scheduleWeeklyFrequency = scheduleWeeklyFrequency; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java new file mode 100644 index 0000000000000..1ca958bf4c82e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SoftDeleteFeatureState. */ +public final class SoftDeleteFeatureState extends ExpandableStringEnum { + /** Static value Invalid for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState INVALID = fromString("Invalid"); + + /** Static value Enabled for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState ENABLED = fromString("Enabled"); + + /** Static value Disabled for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SoftDeleteFeatureState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftDeleteFeatureState. + */ + @JsonCreator + public static SoftDeleteFeatureState fromString(String name) { + return fromString(name, SoftDeleteFeatureState.class); + } + + /** @return known SoftDeleteFeatureState values. */ + public static Collection values() { + return values(SoftDeleteFeatureState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java new file mode 100644 index 0000000000000..a48fe242b6d58 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.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.recoveryservicesbackup.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; + +/** SQLDataDirectory info. */ +@Fluent +public final class SqlDataDirectory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlDataDirectory.class); + + /* + * Type of data directory mapping + */ + @JsonProperty(value = "type") + private SqlDataDirectoryType type; + + /* + * File path + */ + @JsonProperty(value = "path") + private String path; + + /* + * Logical name of the file + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Get the type property: Type of data directory mapping. + * + * @return the type value. + */ + public SqlDataDirectoryType type() { + return this.type; + } + + /** + * Set the type property: Type of data directory mapping. + * + * @param type the type value to set. + * @return the SqlDataDirectory object itself. + */ + public SqlDataDirectory withType(SqlDataDirectoryType type) { + this.type = type; + return this; + } + + /** + * Get the path property: File path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: File path. + * + * @param path the path value to set. + * @return the SqlDataDirectory object itself. + */ + public SqlDataDirectory withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the logicalName property: Logical name of the file. + * + * @return the logicalName value. + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set the logicalName property: Logical name of the file. + * + * @param logicalName the logicalName value to set. + * @return the SqlDataDirectory object itself. + */ + public SqlDataDirectory withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java new file mode 100644 index 0000000000000..67170c0b0ada3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.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.recoveryservicesbackup.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; + +/** Encapsulates information regarding data directory. */ +@Fluent +public final class SqlDataDirectoryMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlDataDirectoryMapping.class); + + /* + * Type of data directory mapping + */ + @JsonProperty(value = "mappingType") + private SqlDataDirectoryType mappingType; + + /* + * Restore source logical name path + */ + @JsonProperty(value = "sourceLogicalName") + private String sourceLogicalName; + + /* + * Restore source path + */ + @JsonProperty(value = "sourcePath") + private String sourcePath; + + /* + * Target path + */ + @JsonProperty(value = "targetPath") + private String targetPath; + + /** + * Get the mappingType property: Type of data directory mapping. + * + * @return the mappingType value. + */ + public SqlDataDirectoryType mappingType() { + return this.mappingType; + } + + /** + * Set the mappingType property: Type of data directory mapping. + * + * @param mappingType the mappingType value to set. + * @return the SqlDataDirectoryMapping object itself. + */ + public SqlDataDirectoryMapping withMappingType(SqlDataDirectoryType mappingType) { + this.mappingType = mappingType; + return this; + } + + /** + * Get the sourceLogicalName property: Restore source logical name path. + * + * @return the sourceLogicalName value. + */ + public String sourceLogicalName() { + return this.sourceLogicalName; + } + + /** + * Set the sourceLogicalName property: Restore source logical name path. + * + * @param sourceLogicalName the sourceLogicalName value to set. + * @return the SqlDataDirectoryMapping object itself. + */ + public SqlDataDirectoryMapping withSourceLogicalName(String sourceLogicalName) { + this.sourceLogicalName = sourceLogicalName; + return this; + } + + /** + * Get the sourcePath property: Restore source path. + * + * @return the sourcePath value. + */ + public String sourcePath() { + return this.sourcePath; + } + + /** + * Set the sourcePath property: Restore source path. + * + * @param sourcePath the sourcePath value to set. + * @return the SqlDataDirectoryMapping object itself. + */ + public SqlDataDirectoryMapping withSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + return this; + } + + /** + * Get the targetPath property: Target path. + * + * @return the targetPath value. + */ + public String targetPath() { + return this.targetPath; + } + + /** + * Set the targetPath property: Target path. + * + * @param targetPath the targetPath value to set. + * @return the SqlDataDirectoryMapping object itself. + */ + public SqlDataDirectoryMapping withTargetPath(String targetPath) { + this.targetPath = targetPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java new file mode 100644 index 0000000000000..1fdc4182b8b55 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SqlDataDirectoryType. */ +public final class SqlDataDirectoryType extends ExpandableStringEnum { + /** Static value Invalid for SqlDataDirectoryType. */ + public static final SqlDataDirectoryType INVALID = fromString("Invalid"); + + /** Static value Data for SqlDataDirectoryType. */ + public static final SqlDataDirectoryType DATA = fromString("Data"); + + /** Static value Log for SqlDataDirectoryType. */ + public static final SqlDataDirectoryType LOG = fromString("Log"); + + /** + * Creates or finds a SqlDataDirectoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SqlDataDirectoryType. + */ + @JsonCreator + public static SqlDataDirectoryType fromString(String name) { + return fromString(name, SqlDataDirectoryType.class); + } + + /** @return known SqlDataDirectoryType values. */ + public static Collection values() { + return values(SqlDataDirectoryType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java new file mode 100644 index 0000000000000..fd15a23f5c228 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageType. */ +public final class StorageType extends ExpandableStringEnum { + /** Static value Invalid for StorageType. */ + public static final StorageType INVALID = fromString("Invalid"); + + /** Static value GeoRedundant for StorageType. */ + public static final StorageType GEO_REDUNDANT = fromString("GeoRedundant"); + + /** Static value LocallyRedundant for StorageType. */ + public static final StorageType LOCALLY_REDUNDANT = fromString("LocallyRedundant"); + + /** Static value ZoneRedundant for StorageType. */ + public static final StorageType ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** Static value ReadAccessGeoZoneRedundant for StorageType. */ + public static final StorageType READ_ACCESS_GEO_ZONE_REDUNDANT = fromString("ReadAccessGeoZoneRedundant"); + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** @return known StorageType values. */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java new file mode 100644 index 0000000000000..89d352469cc7b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageTypeState. */ +public final class StorageTypeState extends ExpandableStringEnum { + /** Static value Invalid for StorageTypeState. */ + public static final StorageTypeState INVALID = fromString("Invalid"); + + /** Static value Locked for StorageTypeState. */ + public static final StorageTypeState LOCKED = fromString("Locked"); + + /** Static value Unlocked for StorageTypeState. */ + public static final StorageTypeState UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a StorageTypeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTypeState. + */ + @JsonCreator + public static StorageTypeState fromString(String name) { + return fromString(name, StorageTypeState.class); + } + + /** @return known StorageTypeState values. */ + public static Collection values() { + return values(StorageTypeState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java new file mode 100644 index 0000000000000..44dc73b7870a4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Sub-protection policy which includes schedule and retention. */ +@Fluent +public final class SubProtectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubProtectionPolicy.class); + + /* + * Type of backup policy type + */ + @JsonProperty(value = "policyType") + private PolicyType policyType; + + /* + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /* + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the policyType property: Type of backup policy type. + * + * @return the policyType value. + */ + public PolicyType policyType() { + return this.policyType; + } + + /** + * Set the policyType property: Type of backup policy type. + * + * @param policyType the policyType value to set. + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withPolicyType(PolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value. + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the schedulePolicy property: Backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set. + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schedulePolicy() != null) { + schedulePolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java new file mode 100644 index 0000000000000..8feb1a1f2402b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportStatus. */ +public final class SupportStatus extends ExpandableStringEnum { + /** Static value Invalid for SupportStatus. */ + public static final SupportStatus INVALID = fromString("Invalid"); + + /** Static value Supported for SupportStatus. */ + public static final SupportStatus SUPPORTED = fromString("Supported"); + + /** Static value DefaultOFF for SupportStatus. */ + public static final SupportStatus DEFAULT_OFF = fromString("DefaultOFF"); + + /** Static value DefaultON for SupportStatus. */ + public static final SupportStatus DEFAULT_ON = fromString("DefaultON"); + + /** Static value NotSupported for SupportStatus. */ + public static final SupportStatus NOT_SUPPORTED = fromString("NotSupported"); + + /** + * Creates or finds a SupportStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportStatus. + */ + @JsonCreator + public static SupportStatus fromString(String name) { + return fromString(name, SupportStatus.class); + } + + /** @return known SupportStatus values. */ + public static Collection values() { + return values(SupportStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java new file mode 100644 index 0000000000000..46088ec082274 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.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.recoveryservicesbackup.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; + +/** Target Azure File Share Info. */ +@Fluent +public final class TargetAfsRestoreInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetAfsRestoreInfo.class); + + /* + * File share name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Target file share resource ARM ID + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /** + * Get the name property: File share name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: File share name. + * + * @param name the name value to set. + * @return the TargetAfsRestoreInfo object itself. + */ + public TargetAfsRestoreInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetResourceId property: Target file share resource ARM ID. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: Target file share resource ARM ID. + * + * @param targetResourceId the targetResourceId value to set. + * @return the TargetAfsRestoreInfo object itself. + */ + public TargetAfsRestoreInfo withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java new file mode 100644 index 0000000000000..5f5dea530d5a5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Details about target workload during restore operation. */ +@Fluent +public final class TargetRestoreInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetRestoreInfo.class); + + /* + * Can Overwrite if Target DataBase already exists + */ + @JsonProperty(value = "overwriteOption") + private OverwriteOptions overwriteOption; + + /* + * Resource Id name of the container in which Target DataBase resides + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * Database name InstanceName/DataBaseName for SQL or System/DbName for SAP + * Hana + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Target directory location for restore as files. + */ + @JsonProperty(value = "targetDirectoryForFileRestore") + private String targetDirectoryForFileRestore; + + /** + * Get the overwriteOption property: Can Overwrite if Target DataBase already exists. + * + * @return the overwriteOption value. + */ + public OverwriteOptions overwriteOption() { + return this.overwriteOption; + } + + /** + * Set the overwriteOption property: Can Overwrite if Target DataBase already exists. + * + * @param overwriteOption the overwriteOption value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withOverwriteOption(OverwriteOptions overwriteOption) { + this.overwriteOption = overwriteOption; + return this; + } + + /** + * Get the containerId property: Resource Id name of the container in which Target DataBase resides. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Resource Id name of the container in which Target DataBase resides. + * + * @param containerId the containerId value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @param databaseName the databaseName value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the targetDirectoryForFileRestore property: Target directory location for restore as files. + * + * @return the targetDirectoryForFileRestore value. + */ + public String targetDirectoryForFileRestore() { + return this.targetDirectoryForFileRestore; + } + + /** + * Set the targetDirectoryForFileRestore property: Target directory location for restore as files. + * + * @param targetDirectoryForFileRestore the targetDirectoryForFileRestore value to set. + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withTargetDirectoryForFileRestore(String targetDirectoryForFileRestore) { + this.targetDirectoryForFileRestore = targetDirectoryForFileRestore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java new file mode 100644 index 0000000000000..940899d663d15 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; + +/** An immutable client-side representation of TokenInformation. */ +public interface TokenInformation { + /** + * Gets the token property: Token value. + * + * @return the token value. + */ + String token(); + + /** + * Gets the expiryTimeInUtcTicks property: Expiry time of token. + * + * @return the expiryTimeInUtcTicks value. + */ + Long expiryTimeInUtcTicks(); + + /** + * Gets the securityPin property: Security PIN. + * + * @return the securityPin value. + */ + String securityPin(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner object. + * + * @return the inner object. + */ + TokenInformationInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java new file mode 100644 index 0000000000000..5c7cc3d47edae --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Trigger DataMove Request. */ +@Fluent +public final class TriggerDataMoveRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerDataMoveRequest.class); + + /* + * ARM Id of source vault + */ + @JsonProperty(value = "sourceResourceId", required = true) + private String sourceResourceId; + + /* + * Source Region + */ + @JsonProperty(value = "sourceRegion", required = true) + private String sourceRegion; + + /* + * DataMove Level + */ + @JsonProperty(value = "dataMoveLevel", required = true) + private DataMoveLevel dataMoveLevel; + + /* + * Correlation Id + */ + @JsonProperty(value = "correlationId", required = true) + private String correlationId; + + /* + * Source Container ArmIds + */ + @JsonProperty(value = "sourceContainerArmIds") + private List sourceContainerArmIds; + + /* + * Pause GC + */ + @JsonProperty(value = "pauseGC") + private Boolean pauseGC; + + /** + * Get the sourceResourceId property: ARM Id of source vault. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: ARM Id of source vault. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the sourceRegion property: Source Region. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: Source Region. + * + * @param sourceRegion the sourceRegion value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the dataMoveLevel property: DataMove Level. + * + * @return the dataMoveLevel value. + */ + public DataMoveLevel dataMoveLevel() { + return this.dataMoveLevel; + } + + /** + * Set the dataMoveLevel property: DataMove Level. + * + * @param dataMoveLevel the dataMoveLevel value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withDataMoveLevel(DataMoveLevel dataMoveLevel) { + this.dataMoveLevel = dataMoveLevel; + return this; + } + + /** + * Get the correlationId property: Correlation Id. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: Correlation Id. + * + * @param correlationId the correlationId value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the sourceContainerArmIds property: Source Container ArmIds. + * + * @return the sourceContainerArmIds value. + */ + public List sourceContainerArmIds() { + return this.sourceContainerArmIds; + } + + /** + * Set the sourceContainerArmIds property: Source Container ArmIds. + * + * @param sourceContainerArmIds the sourceContainerArmIds value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withSourceContainerArmIds(List sourceContainerArmIds) { + this.sourceContainerArmIds = sourceContainerArmIds; + return this; + } + + /** + * Get the pauseGC property: Pause GC. + * + * @return the pauseGC value. + */ + public Boolean pauseGC() { + return this.pauseGC; + } + + /** + * Set the pauseGC property: Pause GC. + * + * @param pauseGC the pauseGC value to set. + * @return the TriggerDataMoveRequest object itself. + */ + public TriggerDataMoveRequest withPauseGC(Boolean pauseGC) { + this.pauseGC = pauseGC; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceResourceId in model TriggerDataMoveRequest")); + } + if (sourceRegion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceRegion in model TriggerDataMoveRequest")); + } + if (dataMoveLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataMoveLevel in model TriggerDataMoveRequest")); + } + if (correlationId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property correlationId in model TriggerDataMoveRequest")); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java new file mode 100644 index 0000000000000..4ff8280b833dc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Type.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Type. */ +public final class Type extends ExpandableStringEnum { + /** Static value Invalid for Type. */ + public static final Type INVALID = fromString("Invalid"); + + /** Static value BackupProtectedItemCountSummary for Type. */ + public static final Type BACKUP_PROTECTED_ITEM_COUNT_SUMMARY = fromString("BackupProtectedItemCountSummary"); + + /** Static value BackupProtectionContainerCountSummary for Type. */ + public static final Type BACKUP_PROTECTION_CONTAINER_COUNT_SUMMARY = + fromString("BackupProtectionContainerCountSummary"); + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** @return known Type values. */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java new file mode 100644 index 0000000000000..e29fd94e2223c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsagesUnit. */ +public final class UsagesUnit extends ExpandableStringEnum { + /** Static value Count for UsagesUnit. */ + public static final UsagesUnit COUNT = fromString("Count"); + + /** Static value Bytes for UsagesUnit. */ + public static final UsagesUnit BYTES = fromString("Bytes"); + + /** Static value Seconds for UsagesUnit. */ + public static final UsagesUnit SECONDS = fromString("Seconds"); + + /** Static value Percent for UsagesUnit. */ + public static final UsagesUnit PERCENT = fromString("Percent"); + + /** Static value CountPerSecond for UsagesUnit. */ + public static final UsagesUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** Static value BytesPerSecond for UsagesUnit. */ + public static final UsagesUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** + * Creates or finds a UsagesUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsagesUnit. + */ + @JsonCreator + public static UsagesUnit fromString(String name) { + return fromString(name, UsagesUnit.class); + } + + /** @return known UsagesUnit values. */ + public static Collection values() { + return values(UsagesUnit.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java new file mode 100644 index 0000000000000..b910928ea8554 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.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.recoveryservicesbackup.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; + +/** AzureRestoreValidation request. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("ValidateIaasVMRestoreOperationRequest") +@Immutable +public final class ValidateIaasVMRestoreOperationRequest extends ValidateRestoreOperationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateIaasVMRestoreOperationRequest.class); + + /** {@inheritDoc} */ + @Override + public ValidateIaasVMRestoreOperationRequest withRestoreRequest(RestoreRequest restoreRequest) { + super.withRestoreRequest(restoreRequest); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java new file mode 100644 index 0000000000000..476afa948ac44 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for validate operation request. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = ValidateOperationRequest.class) +@JsonTypeName("ValidateOperationRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ValidateRestoreOperationRequest", value = ValidateRestoreOperationRequest.class) +}) +@Immutable +public class ValidateOperationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateOperationRequest.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java new file mode 100644 index 0000000000000..468cd3e5e45b2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.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.recoveryservicesbackup.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; + +/** Base class for validate operation response. */ +@Fluent +public final class ValidateOperationResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateOperationResponse.class); + + /* + * Gets the validation result + */ + @JsonProperty(value = "validationResults") + private List validationResults; + + /** + * Get the validationResults property: Gets the validation result. + * + * @return the validationResults value. + */ + public List validationResults() { + return this.validationResults; + } + + /** + * Set the validationResults property: Gets the validation result. + * + * @param validationResults the validationResults value to set. + * @return the ValidateOperationResponse object itself. + */ + public ValidateOperationResponse withValidationResults(List validationResults) { + this.validationResults = validationResults; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationResults() != null) { + validationResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java new file mode 100644 index 0000000000000..a540de41c8877 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; + +/** An immutable client-side representation of ValidateOperationsResponse. */ +public interface ValidateOperationsResponse { + /** + * Gets the validateOperationResponse property: Base class for validate operation response. + * + * @return the validateOperationResponse value. + */ + ValidateOperationResponse validateOperationResponse(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner + * object. + * + * @return the inner object. + */ + ValidateOperationsResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java new file mode 100644 index 0000000000000..b37707b4a4260 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** AzureRestoreValidation request. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectType", + defaultImpl = ValidateRestoreOperationRequest.class) +@JsonTypeName("ValidateRestoreOperationRequest") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "ValidateIaasVMRestoreOperationRequest", + value = ValidateIaasVMRestoreOperationRequest.class) +}) +@Fluent +public class ValidateRestoreOperationRequest extends ValidateOperationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateRestoreOperationRequest.class); + + /* + * Sets restore request to be validated + */ + @JsonProperty(value = "restoreRequest") + private RestoreRequest restoreRequest; + + /** + * Get the restoreRequest property: Sets restore request to be validated. + * + * @return the restoreRequest value. + */ + public RestoreRequest restoreRequest() { + return this.restoreRequest; + } + + /** + * Set the restoreRequest property: Sets restore request to be validated. + * + * @param restoreRequest the restoreRequest value to set. + * @return the ValidateRestoreOperationRequest object itself. + */ + public ValidateRestoreOperationRequest withRestoreRequest(RestoreRequest restoreRequest) { + this.restoreRequest = restoreRequest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (restoreRequest() != null) { + restoreRequest().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java new file mode 100644 index 0000000000000..6b7c4f58d4b1c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ValidationStatus. */ +public final class ValidationStatus extends ExpandableStringEnum { + /** Static value Invalid for ValidationStatus. */ + public static final ValidationStatus INVALID = fromString("Invalid"); + + /** Static value Succeeded for ValidationStatus. */ + public static final ValidationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ValidationStatus. */ + public static final ValidationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ValidationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationStatus. + */ + @JsonCreator + public static ValidationStatus fromString(String name) { + return fromString(name, ValidationStatus.class); + } + + /** @return known ValidationStatus values. */ + public static Collection values() { + return values(ValidationStatus.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java new file mode 100644 index 0000000000000..d80ce213d1b6c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Vault level Job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("VaultJob") +@Fluent +public final class VaultJob extends Job { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultJob.class); + + /* + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Duration duration; + + /* + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /* + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /* + * Additional information about the job. + */ + @JsonProperty(value = "extendedInfo") + private VaultJobExtendedInfo extendedInfo; + + /** + * Get the duration property: Time elapsed during the execution of this job. + * + * @return the duration value. + */ + public Duration duration() { + return this.duration; + } + + /** + * Set the duration property: Time elapsed during the execution of this job. + * + * @param duration the duration value to set. + * @return the VaultJob object itself. + */ + public VaultJob withDuration(Duration duration) { + this.duration = duration; + return this; + } + + /** + * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value. + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set. + * @return the VaultJob object itself. + */ + public VaultJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errorDetails property: Error details on execution of this job. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: Error details on execution of this job. + * + * @param errorDetails the errorDetails value to set. + * @return the VaultJob object itself. + */ + public VaultJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the extendedInfo property: Additional information about the job. + * + * @return the extendedInfo value. + */ + public VaultJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set the extendedInfo property: Additional information about the job. + * + * @param extendedInfo the extendedInfo value to set. + * @return the VaultJob object itself. + */ + public VaultJob withExtendedInfo(VaultJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withEntityFriendlyName(String entityFriendlyName) { + super.withEntityFriendlyName(entityFriendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withBackupManagementType(BackupManagementType backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withStatus(String status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withStartTime(OffsetDateTime startTime) { + super.withStartTime(startTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withEndTime(OffsetDateTime endTime) { + super.withEndTime(endTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultJob withActivityId(String activityId) { + super.withActivityId(activityId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (extendedInfo() != null) { + extendedInfo().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java new file mode 100644 index 0000000000000..12439cd2098dd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Vault Job specific error information. */ +@Fluent +public final class VaultJobErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultJobErrorInfo.class); + + /* + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /* + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /* + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: Error code. + * + * @param errorCode the errorCode value to set. + * @return the VaultJobErrorInfo object itself. + */ + public VaultJobErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorString property: Localized error string. + * + * @return the errorString value. + */ + public String errorString() { + return this.errorString; + } + + /** + * Set the errorString property: Localized error string. + * + * @param errorString the errorString value to set. + * @return the VaultJobErrorInfo object itself. + */ + public VaultJobErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get the recommendations property: List of localized recommendations for above error code. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the recommendations property: List of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set. + * @return the VaultJobErrorInfo object itself. + */ + public VaultJobErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java new file mode 100644 index 0000000000000..649042aeac486 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Vault Job for CMK - has CMK specific info. */ +@Fluent +public final class VaultJobExtendedInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultJobExtendedInfo.class); + + /* + * Job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /** + * Get the propertyBag property: Job properties. + * + * @return the propertyBag value. + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the propertyBag property: Job properties. + * + * @param propertyBag the propertyBag value to set. + * @return the VaultJobExtendedInfo object itself. + */ + public VaultJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java new file mode 100644 index 0000000000000..818ff20d2de85 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.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. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; + +/** An immutable client-side representation of VaultStorageConfigOperationResultResponse. */ +public interface VaultStorageConfigOperationResultResponse { + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner + * object. + * + * @return the inner object. + */ + VaultStorageConfigOperationResultResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java new file mode 100644 index 0000000000000..27d5c103a6f22 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.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.recoveryservicesbackup.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for WeekOfMonth. */ +public enum WeekOfMonth { + /** Enum value First. */ + FIRST("First"), + + /** Enum value Second. */ + SECOND("Second"), + + /** Enum value Third. */ + THIRD("Third"), + + /** Enum value Fourth. */ + FOURTH("Fourth"), + + /** Enum value Last. */ + LAST("Last"), + + /** Enum value Invalid. */ + INVALID("Invalid"); + + /** The actual serialized value for a WeekOfMonth instance. */ + private final String value; + + WeekOfMonth(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WeekOfMonth instance. + * + * @param value the serialized value to parse. + * @return the parsed WeekOfMonth object, or null if unable to parse. + */ + @JsonCreator + public static WeekOfMonth fromString(String value) { + WeekOfMonth[] items = WeekOfMonth.values(); + for (WeekOfMonth item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java new file mode 100644 index 0000000000000..dc3e4379416a5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Weekly retention format. */ +@Fluent +public final class WeeklyRetentionFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WeeklyRetentionFormat.class); + + /* + * List of days of the week. + */ + @JsonProperty(value = "daysOfTheWeek") + private List daysOfTheWeek; + + /* + * List of weeks of month. + */ + @JsonProperty(value = "weeksOfTheMonth") + private List weeksOfTheMonth; + + /** + * Get the daysOfTheWeek property: List of days of the week. + * + * @return the daysOfTheWeek value. + */ + public List daysOfTheWeek() { + return this.daysOfTheWeek; + } + + /** + * Set the daysOfTheWeek property: List of days of the week. + * + * @param daysOfTheWeek the daysOfTheWeek value to set. + * @return the WeeklyRetentionFormat object itself. + */ + public WeeklyRetentionFormat withDaysOfTheWeek(List daysOfTheWeek) { + this.daysOfTheWeek = daysOfTheWeek; + return this; + } + + /** + * Get the weeksOfTheMonth property: List of weeks of month. + * + * @return the weeksOfTheMonth value. + */ + public List weeksOfTheMonth() { + return this.weeksOfTheMonth; + } + + /** + * Set the weeksOfTheMonth property: List of weeks of month. + * + * @param weeksOfTheMonth the weeksOfTheMonth value to set. + * @return the WeeklyRetentionFormat object itself. + */ + public WeeklyRetentionFormat withWeeksOfTheMonth(List weeksOfTheMonth) { + this.weeksOfTheMonth = weeksOfTheMonth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java new file mode 100644 index 0000000000000..1d51fb856e9eb --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Weekly retention schedule. */ +@Fluent +public final class WeeklyRetentionSchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WeeklyRetentionSchedule.class); + + /* + * List of days of week for weekly retention policy. + */ + @JsonProperty(value = "daysOfTheWeek") + private List daysOfTheWeek; + + /* + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /* + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the daysOfTheWeek property: List of days of week for weekly retention policy. + * + * @return the daysOfTheWeek value. + */ + public List daysOfTheWeek() { + return this.daysOfTheWeek; + } + + /** + * Set the daysOfTheWeek property: List of days of week for weekly retention policy. + * + * @param daysOfTheWeek the daysOfTheWeek value to set. + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withDaysOfTheWeek(List daysOfTheWeek) { + this.daysOfTheWeek = daysOfTheWeek; + return this; + } + + /** + * Get the retentionTimes property: Retention times of retention policy. + * + * @return the retentionTimes value. + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set the retentionTimes property: Retention times of retention policy. + * + * @param retentionTimes the retentionTimes value to set. + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get the retentionDuration property: Retention duration of retention Policy. + * + * @return the retentionDuration value. + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retentionDuration property: Retention duration of retention Policy. + * + * @param retentionDuration the retentionDuration value to set. + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionDuration() != null) { + retentionDuration().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java new file mode 100644 index 0000000000000..ea9ea3633b90e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadCrrAccessToken.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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.Map; + +/** The WorkloadCrrAccessToken model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("WorkloadCrrAccessToken") +@Fluent +public final class WorkloadCrrAccessToken extends CrrAccessToken { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadCrrAccessToken.class); + + /* + * The protectableObjectUniqueName property. + */ + @JsonProperty(value = "protectableObjectUniqueName") + private String protectableObjectUniqueName; + + /* + * The protectableObjectFriendlyName property. + */ + @JsonProperty(value = "protectableObjectFriendlyName") + private String protectableObjectFriendlyName; + + /* + * The protectableObjectWorkloadType property. + */ + @JsonProperty(value = "protectableObjectWorkloadType") + private String protectableObjectWorkloadType; + + /* + * The protectableObjectProtectionState property. + */ + @JsonProperty(value = "protectableObjectProtectionState") + private String protectableObjectProtectionState; + + /* + * The protectableObjectContainerHostOsName property. + */ + @JsonProperty(value = "protectableObjectContainerHostOsName") + private String protectableObjectContainerHostOsName; + + /* + * The protectableObjectParentLogicalContainerName property. + */ + @JsonProperty(value = "protectableObjectParentLogicalContainerName") + private String protectableObjectParentLogicalContainerName; + + /* + * Container Id + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * Policy Name + */ + @JsonProperty(value = "policyName") + private String policyName; + + /* + * Policy Id + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** + * Get the protectableObjectUniqueName property: The protectableObjectUniqueName property. + * + * @return the protectableObjectUniqueName value. + */ + public String protectableObjectUniqueName() { + return this.protectableObjectUniqueName; + } + + /** + * Set the protectableObjectUniqueName property: The protectableObjectUniqueName property. + * + * @param protectableObjectUniqueName the protectableObjectUniqueName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectUniqueName(String protectableObjectUniqueName) { + this.protectableObjectUniqueName = protectableObjectUniqueName; + return this; + } + + /** + * Get the protectableObjectFriendlyName property: The protectableObjectFriendlyName property. + * + * @return the protectableObjectFriendlyName value. + */ + public String protectableObjectFriendlyName() { + return this.protectableObjectFriendlyName; + } + + /** + * Set the protectableObjectFriendlyName property: The protectableObjectFriendlyName property. + * + * @param protectableObjectFriendlyName the protectableObjectFriendlyName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectFriendlyName(String protectableObjectFriendlyName) { + this.protectableObjectFriendlyName = protectableObjectFriendlyName; + return this; + } + + /** + * Get the protectableObjectWorkloadType property: The protectableObjectWorkloadType property. + * + * @return the protectableObjectWorkloadType value. + */ + public String protectableObjectWorkloadType() { + return this.protectableObjectWorkloadType; + } + + /** + * Set the protectableObjectWorkloadType property: The protectableObjectWorkloadType property. + * + * @param protectableObjectWorkloadType the protectableObjectWorkloadType value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectWorkloadType(String protectableObjectWorkloadType) { + this.protectableObjectWorkloadType = protectableObjectWorkloadType; + return this; + } + + /** + * Get the protectableObjectProtectionState property: The protectableObjectProtectionState property. + * + * @return the protectableObjectProtectionState value. + */ + public String protectableObjectProtectionState() { + return this.protectableObjectProtectionState; + } + + /** + * Set the protectableObjectProtectionState property: The protectableObjectProtectionState property. + * + * @param protectableObjectProtectionState the protectableObjectProtectionState value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectProtectionState(String protectableObjectProtectionState) { + this.protectableObjectProtectionState = protectableObjectProtectionState; + return this; + } + + /** + * Get the protectableObjectContainerHostOsName property: The protectableObjectContainerHostOsName property. + * + * @return the protectableObjectContainerHostOsName value. + */ + public String protectableObjectContainerHostOsName() { + return this.protectableObjectContainerHostOsName; + } + + /** + * Set the protectableObjectContainerHostOsName property: The protectableObjectContainerHostOsName property. + * + * @param protectableObjectContainerHostOsName the protectableObjectContainerHostOsName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectContainerHostOsName( + String protectableObjectContainerHostOsName) { + this.protectableObjectContainerHostOsName = protectableObjectContainerHostOsName; + return this; + } + + /** + * Get the protectableObjectParentLogicalContainerName property: The protectableObjectParentLogicalContainerName + * property. + * + * @return the protectableObjectParentLogicalContainerName value. + */ + public String protectableObjectParentLogicalContainerName() { + return this.protectableObjectParentLogicalContainerName; + } + + /** + * Set the protectableObjectParentLogicalContainerName property: The protectableObjectParentLogicalContainerName + * property. + * + * @param protectableObjectParentLogicalContainerName the protectableObjectParentLogicalContainerName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withProtectableObjectParentLogicalContainerName( + String protectableObjectParentLogicalContainerName) { + this.protectableObjectParentLogicalContainerName = protectableObjectParentLogicalContainerName; + return this; + } + + /** + * Get the containerId property: Container Id. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: Container Id. + * + * @param containerId the containerId value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the policyName property: Policy Name. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Policy Name. + * + * @param policyName the policyName value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the policyId property: Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: Policy Id. + * + * @param policyId the policyId value to set. + * @return the WorkloadCrrAccessToken object itself. + */ + public WorkloadCrrAccessToken withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withAccessTokenString(String accessTokenString) { + super.withAccessTokenString(accessTokenString); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withSubscriptionId(String subscriptionId) { + super.withSubscriptionId(subscriptionId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withResourceGroupName(String resourceGroupName) { + super.withResourceGroupName(resourceGroupName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withResourceName(String resourceName) { + super.withResourceName(resourceName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withResourceId(String resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withProtectionContainerId(Long protectionContainerId) { + super.withProtectionContainerId(protectionContainerId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRecoveryPointId(String recoveryPointId) { + super.withRecoveryPointId(recoveryPointId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRecoveryPointTime(String recoveryPointTime) { + super.withRecoveryPointTime(recoveryPointTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withContainerName(String containerName) { + super.withContainerName(containerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withContainerType(String containerType) { + super.withContainerType(containerType); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withBackupManagementType(String backupManagementType) { + super.withBackupManagementType(backupManagementType); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withDatasourceType(String datasourceType) { + super.withDatasourceType(datasourceType); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withDatasourceName(String datasourceName) { + super.withDatasourceName(datasourceName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withDatasourceId(String datasourceId) { + super.withDatasourceId(datasourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withDatasourceContainerName(String datasourceContainerName) { + super.withDatasourceContainerName(datasourceContainerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withCoordinatorServiceStampId(String coordinatorServiceStampId) { + super.withCoordinatorServiceStampId(coordinatorServiceStampId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withCoordinatorServiceStampUri(String coordinatorServiceStampUri) { + super.withCoordinatorServiceStampUri(coordinatorServiceStampUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withProtectionServiceStampId(String protectionServiceStampId) { + super.withProtectionServiceStampId(protectionServiceStampId); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withProtectionServiceStampUri(String protectionServiceStampUri) { + super.withProtectionServiceStampUri(protectionServiceStampUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withTokenExtendedInformation(String tokenExtendedInformation) { + super.withTokenExtendedInformation(tokenExtendedInformation); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRpTierInformation(Map rpTierInformation) { + super.withRpTierInformation(rpTierInformation); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRpOriginalSAOption(Boolean rpOriginalSAOption) { + super.withRpOriginalSAOption(rpOriginalSAOption); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRpIsManagedVirtualMachine(Boolean rpIsManagedVirtualMachine) { + super.withRpIsManagedVirtualMachine(rpIsManagedVirtualMachine); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withRpVMSizeDescription(String rpVMSizeDescription) { + super.withRpVMSizeDescription(rpVMSizeDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadCrrAccessToken withBMSActiveRegion(String bMSActiveRegion) { + super.withBMSActiveRegion(bMSActiveRegion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java new file mode 100644 index 0000000000000..74c0ecff479b1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Details of an inquired protectable item. */ +@Fluent +public final class WorkloadInquiryDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadInquiryDetails.class); + + /* + * Type of the Workload such as SQL, Oracle etc. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Contains the protectable item Count inside this Container. + */ + @JsonProperty(value = "itemCount") + private Long itemCount; + + /* + * Inquiry validation such as permissions and other backup validations. + */ + @JsonProperty(value = "inquiryValidation") + private InquiryValidation inquiryValidation; + + /** + * Get the type property: Type of the Workload such as SQL, Oracle etc. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the Workload such as SQL, Oracle etc. + * + * @param type the type value to set. + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withType(String type) { + this.type = type; + return this; + } + + /** + * Get the itemCount property: Contains the protectable item Count inside this Container. + * + * @return the itemCount value. + */ + public Long itemCount() { + return this.itemCount; + } + + /** + * Set the itemCount property: Contains the protectable item Count inside this Container. + * + * @param itemCount the itemCount value to set. + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withItemCount(Long itemCount) { + this.itemCount = itemCount; + return this; + } + + /** + * Get the inquiryValidation property: Inquiry validation such as permissions and other backup validations. + * + * @return the inquiryValidation value. + */ + public InquiryValidation inquiryValidation() { + return this.inquiryValidation; + } + + /** + * Set the inquiryValidation property: Inquiry validation such as permissions and other backup validations. + * + * @param inquiryValidation the inquiryValidation value to set. + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withInquiryValidation(InquiryValidation inquiryValidation) { + this.inquiryValidation = inquiryValidation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inquiryValidation() != null) { + inquiryValidation().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java new file mode 100644 index 0000000000000..08b2d260bc89a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Base class for backup item. Workload-specific backup items are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "workloadItemType", + defaultImpl = WorkloadItem.class) +@JsonTypeName("WorkloadItem") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureVmWorkloadItem", value = AzureVmWorkloadItem.class)}) +@Fluent +public class WorkloadItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadItem.class); + + /* + * Type of backup management to backup an item. + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /* + * Type of workload for the backup management + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * Friendly name of the backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * State of the back up item. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get the backupManagementType property: Type of backup management to backup an item. + * + * @return the backupManagementType value. + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management to backup an item. + * + * @param backupManagementType the backupManagementType value to set. + * @return the WorkloadItem object itself. + */ + public WorkloadItem withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workloadType property: Type of workload for the backup management. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Type of workload for the backup management. + * + * @param workloadType the workloadType value to set. + * @return the WorkloadItem object itself. + */ + public WorkloadItem withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the friendlyName property: Friendly name of the backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkloadItem object itself. + */ + public WorkloadItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectionState property: State of the back up item. + * + * @return the protectionState value. + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: State of the back up item. + * + * @param protectionState the protectionState value to set. + * @return the WorkloadItem object itself. + */ + public WorkloadItem withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java new file mode 100644 index 0000000000000..722f5258f62b8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.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.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; +import java.util.Map; + +/** An immutable client-side representation of WorkloadItemResource. */ +public interface WorkloadItemResource { + /** + * 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 properties property: WorkloadItemResource properties. + * + * @return the properties value. + */ + WorkloadItem properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner object. + * + * @return the inner object. + */ + WorkloadItemResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResourceList.java new file mode 100644 index 0000000000000..a79c5353b5289 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of WorkloadItem resources. */ +@Fluent +public final class WorkloadItemResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadItemResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the WorkloadItemResourceList object itself. + */ + public WorkloadItemResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadItemResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java new file mode 100644 index 0000000000000..ca1d1813417ce --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadItemType. */ +public final class WorkloadItemType extends ExpandableStringEnum { + /** Static value Invalid for WorkloadItemType. */ + public static final WorkloadItemType INVALID = fromString("Invalid"); + + /** Static value SQLInstance for WorkloadItemType. */ + public static final WorkloadItemType SQLINSTANCE = fromString("SQLInstance"); + + /** Static value SQLDataBase for WorkloadItemType. */ + public static final WorkloadItemType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value SAPHanaSystem for WorkloadItemType. */ + public static final WorkloadItemType SAPHANA_SYSTEM = fromString("SAPHanaSystem"); + + /** Static value SAPHanaDatabase for WorkloadItemType. */ + public static final WorkloadItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseSystem for WorkloadItemType. */ + public static final WorkloadItemType SAPASE_SYSTEM = fromString("SAPAseSystem"); + + /** Static value SAPAseDatabase for WorkloadItemType. */ + public static final WorkloadItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a WorkloadItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadItemType. + */ + @JsonCreator + public static WorkloadItemType fromString(String name) { + return fromString(name, WorkloadItemType.class); + } + + /** @return known WorkloadItemType values. */ + public static Collection values() { + return values(WorkloadItemType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java new file mode 100644 index 0000000000000..83cc2e08633fd --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.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; + +/** Base class for backup item. Workload-specific backup items are derived from this class. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "protectableItemType", + defaultImpl = WorkloadProtectableItem.class) +@JsonTypeName("WorkloadProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShare", value = AzureFileShareProtectableItem.class), + @JsonSubTypes.Type(name = "IaaSVMProtectableItem", value = IaaSvmProtectableItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadProtectableItem", value = AzureVmWorkloadProtectableItem.class) +}) +@Fluent +public class WorkloadProtectableItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadProtectableItem.class); + + /* + * Type of backup management to backup an item. + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /* + * Type of workload for the backup management + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * Friendly name of the backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * State of the back up item. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get the backupManagementType property: Type of backup management to backup an item. + * + * @return the backupManagementType value. + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backupManagementType property: Type of backup management to backup an item. + * + * @param backupManagementType the backupManagementType value to set. + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workloadType property: Type of workload for the backup management. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: Type of workload for the backup management. + * + * @param workloadType the workloadType value to set. + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the friendlyName property: Friendly name of the backup item. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly name of the backup item. + * + * @param friendlyName the friendlyName value to set. + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the protectionState property: State of the back up item. + * + * @return the protectionState value. + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set the protectionState property: State of the back up item. + * + * @param protectionState the protectionState value to set. + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java new file mode 100644 index 0000000000000..4ef2f9e94024b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; +import java.util.Map; + +/** An immutable client-side representation of WorkloadProtectableItemResource. */ +public interface WorkloadProtectableItemResource { + /** + * 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 properties property: WorkloadProtectableItemResource properties. + * + * @return the properties value. + */ + WorkloadProtectableItem properties(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner object. + * + * @return the inner object. + */ + WorkloadProtectableItemResourceInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResourceList.java new file mode 100644 index 0000000000000..d2689ff10b125 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResourceList.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of WorkloadProtectableItem resources. */ +@Fluent +public final class WorkloadProtectableItemResourceList extends ResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadProtectableItemResourceList.class); + + /* + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources. + * + * @param value the value value to set. + * @return the WorkloadProtectableItemResourceList object itself. + */ + public WorkloadProtectableItemResourceList withValue(List value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadProtectableItemResourceList withNextLink(String nextLink) { + super.withNextLink(nextLink); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java new file mode 100644 index 0000000000000..808dfc46fef87 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.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.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadType. */ +public final class WorkloadType extends ExpandableStringEnum { + /** Static value Invalid for WorkloadType. */ + public static final WorkloadType INVALID = fromString("Invalid"); + + /** Static value VM for WorkloadType. */ + public static final WorkloadType VM = fromString("VM"); + + /** Static value FileFolder for WorkloadType. */ + public static final WorkloadType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for WorkloadType. */ + public static final WorkloadType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for WorkloadType. */ + public static final WorkloadType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for WorkloadType. */ + public static final WorkloadType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for WorkloadType. */ + public static final WorkloadType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for WorkloadType. */ + public static final WorkloadType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for WorkloadType. */ + public static final WorkloadType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for WorkloadType. */ + public static final WorkloadType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for WorkloadType. */ + public static final WorkloadType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for WorkloadType. */ + public static final WorkloadType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for WorkloadType. */ + public static final WorkloadType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for WorkloadType. */ + public static final WorkloadType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for WorkloadType. */ + public static final WorkloadType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a WorkloadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadType. + */ + @JsonCreator + public static WorkloadType fromString(String name) { + return fromString(name, WorkloadType.class); + } + + /** @return known WorkloadType values. */ + public static Collection values() { + return values(WorkloadType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java new file mode 100644 index 0000000000000..e7740b99f1eee --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.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.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Yearly retention schedule. */ +@Fluent +public final class YearlyRetentionSchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(YearlyRetentionSchedule.class); + + /* + * Retention schedule format for yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleFormatType") + private RetentionScheduleFormat retentionScheduleFormatType; + + /* + * List of months of year of yearly retention policy. + */ + @JsonProperty(value = "monthsOfYear") + private List monthsOfYear; + + /* + * Daily retention format for yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /* + * Weekly retention format for yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /* + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /* + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the retentionScheduleFormatType property: Retention schedule format for yearly retention policy. + * + * @return the retentionScheduleFormatType value. + */ + public RetentionScheduleFormat retentionScheduleFormatType() { + return this.retentionScheduleFormatType; + } + + /** + * Set the retentionScheduleFormatType property: Retention schedule format for yearly retention policy. + * + * @param retentionScheduleFormatType the retentionScheduleFormatType value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleFormatType( + RetentionScheduleFormat retentionScheduleFormatType) { + this.retentionScheduleFormatType = retentionScheduleFormatType; + return this; + } + + /** + * Get the monthsOfYear property: List of months of year of yearly retention policy. + * + * @return the monthsOfYear value. + */ + public List monthsOfYear() { + return this.monthsOfYear; + } + + /** + * Set the monthsOfYear property: List of months of year of yearly retention policy. + * + * @param monthsOfYear the monthsOfYear value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withMonthsOfYear(List monthsOfYear) { + this.monthsOfYear = monthsOfYear; + return this; + } + + /** + * Get the retentionScheduleDaily property: Daily retention format for yearly retention policy. + * + * @return the retentionScheduleDaily value. + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set the retentionScheduleDaily property: Daily retention format for yearly retention policy. + * + * @param retentionScheduleDaily the retentionScheduleDaily value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { + this.retentionScheduleDaily = retentionScheduleDaily; + return this; + } + + /** + * Get the retentionScheduleWeekly property: Weekly retention format for yearly retention policy. + * + * @return the retentionScheduleWeekly value. + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set the retentionScheduleWeekly property: Weekly retention format for yearly retention policy. + * + * @param retentionScheduleWeekly the retentionScheduleWeekly value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { + this.retentionScheduleWeekly = retentionScheduleWeekly; + return this; + } + + /** + * Get the retentionTimes property: Retention times of retention policy. + * + * @return the retentionTimes value. + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set the retentionTimes property: Retention times of retention policy. + * + * @param retentionTimes the retentionTimes value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get the retentionDuration property: Retention duration of retention Policy. + * + * @return the retentionDuration value. + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retentionDuration property: Retention duration of retention Policy. + * + * @param retentionDuration the retentionDuration value to set. + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retentionScheduleDaily() != null) { + retentionScheduleDaily().validate(); + } + if (retentionScheduleWeekly() != null) { + retentionScheduleWeekly().validate(); + } + if (retentionDuration() != null) { + retentionDuration().validate(); + } + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java new file mode 100644 index 0000000000000..cbbbed4b7f1dc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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 RecoveryServicesBackupClient. Open API 2.0 Specs for Azure RecoveryServices + * Backup service. + */ +package com.azure.resourcemanager.recoveryservicesbackup.models; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java new file mode 100644 index 0000000000000..7224f6df9ba30 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/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 RecoveryServicesBackupClient. Open API 2.0 Specs for Azure RecoveryServices Backup + * service. + */ +package com.azure.resourcemanager.recoveryservicesbackup; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java new file mode 100644 index 0000000000000..94f84d96fc09a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/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.recoveryservicesbackup { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.recoveryservicesbackup; + exports com.azure.resourcemanager.recoveryservicesbackup.fluent; + exports com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + exports com.azure.resourcemanager.recoveryservicesbackup.models; + + opens com.azure.resourcemanager.recoveryservicesbackup.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.recoveryservicesbackup.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/recoveryservicesbackup/ci.yml b/sdk/recoveryservicesbackup/ci.yml new file mode 100644 index 0000000000000..4d9c3ccc98672 --- /dev/null +++ b/sdk/recoveryservicesbackup/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/recoveryservicesbackup/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesbackup/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesbackup + Artifacts: + - name: azure-resourcemanager-recoveryservicesbackup + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservicesbackup diff --git a/sdk/recoveryservicesbackup/pom.xml b/sdk/recoveryservicesbackup/pom.xml new file mode 100644 index 0000000000000..118695ca277d9 --- /dev/null +++ b/sdk/recoveryservicesbackup/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-recoveryservicesbackup-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-recoveryservicesbackup + + + +