diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566fee..464bc9b7cf1a 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee36..223041e2da03 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -58,7 +63,7 @@ com.azure:azure-core-serializer-json-gson;1.0.3;1.1.0-beta.1 com.azure:azure-core-serializer-json-jackson;1.1.0;1.2.0-beta.1 com.azure:azure-core-test;1.5.1;1.6.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.6;1.0.0-beta.7 -com.azure:azure-cosmos;4.8.0;4.9.0-beta.1 +com.azure:azure-cosmos;4.9.0;4.10.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-dotnet-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-encryption;1.0.0-beta.1;1.0.0-beta.1 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -84,19 +89,19 @@ com.azure:azure-security-keyvault-jca;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-security-keyvault-keys;4.2.3;4.3.0-beta.4 com.azure:azure-security-keyvault-secrets;4.2.3;4.3.0-beta.3 com.azure:azure-sdk-template;1.2.1-beta.2;1.2.1-beta.16 -com.azure:azure-spring-data-cosmos;3.1.0;3.2.0-beta.1 +com.azure:azure-spring-data-cosmos;3.2.0;3.3.0-beta.1 com.azure:azure-spring-data-cosmos-test;3.0.0-beta.1;3.0.0-beta.1 -com.azure:azure-storage-blob;12.9.0;12.10.0-beta.1 -com.azure:azure-storage-blob-batch;12.7.0;12.8.0-beta.1 +com.azure:azure-storage-blob;12.9.0;12.10.0-beta.2 +com.azure:azure-storage-blob-batch;12.7.0;12.8.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.4;12.0.0-beta.5 -com.azure:azure-storage-blob-cryptography;12.9.0;12.10.0-beta.1 +com.azure:azure-storage-blob-cryptography;12.9.0;12.10.0-beta.2 com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 -com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 -com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 -com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-common;12.9.0;12.10.0-beta.2 +com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.2 +com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.2 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.2 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 +com.azure:azure-storage-queue;12.7.0;12.8.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-spring-boot-starter-active-directory-b2c;3.0.0-beta.1;3.0.0-beta.2 com.azure.spring:azure-spring-boot-starter-active-directory;3.0.0-beta.1;3.0.0-beta.2 @@ -168,6 +173,7 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +182,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +192,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index 61c6a98825df..da53965c2792 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -34,7 +34,7 @@ com.microsoft.azure:azure-keyvault-cryptography;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-extensions;1.2.4;1.3.0-beta.1 com.microsoft.azure:azure-keyvault-test;1.2.3;1.2.4 com.microsoft.azure:azure-keyvault-webkey;1.2.4;1.3.0-beta.1 -com.microsoft.azure:azure-servicebus;3.5.0;3.5.1 +com.microsoft.azure:azure-servicebus;3.5.1;3.6.0-beta.1 com.microsoft.azure:azure-storage-blob;11.0.2;11.0.2 com.microsoft.azure.msi_auth_token_provider:azure-authentication-msi-token-provider;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure:azure-eventgrid;1.4.0-beta.1;1.4.0-beta.1 diff --git a/pom.xml b/pom.xml index d97614e5dba3..86a177279a5d 100644 --- a/pom.xml +++ b/pom.xml @@ -9,17 +9,17 @@ 1.0.0 common/perf-test-core - eng/jacoco-test-coverage eng/code-quality-reports + eng/jacoco-test-coverage sdk/anomalydetector sdk/appconfiguration sdk/authorization sdk/batch sdk/boms - sdk/core - sdk/cosmos sdk/cognitiveservices sdk/communication + sdk/core + sdk/cosmos sdk/digitaltwins sdk/eventgrid sdk/eventhubs @@ -28,16 +28,18 @@ sdk/keyvault sdk/loganalytics sdk/mediaservices - sdk/monitor sdk/metricsadvisor + sdk/monitor + sdk/recoveryservices sdk/resourcemanager sdk/schemaregistry sdk/search sdk/servicebus + sdk/spring sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics - sdk/spring diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md new file mode 100644 index 000000000000..6ac5e59f4c1d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-14) + +- Azure Resource Manager RecoveryServices client library for Java. This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2016-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md new file mode 100644 index 000000000000..278ab6b05b39 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager RecoveryServices client library for Java + +Azure Resource Manager RecoveryServices client library for Java. + +This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2016-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +```xml + + com.azure.resourcemanager + azure-resourcemanager-recoveryservices + 1.0.0-beta.1 + +``` + +### 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: + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-recoveryservices;current}) +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +RecoveryServicesManager manager = RecoveryServicesManager + .authenticate(credential, profile); +``` +[//]: # ({x-version-update-end}) + +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 + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml new file mode 100644 index 000000000000..b6744e38b4d5 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/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-recoveryservices + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for RecoveryServices Management + This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2016-06. 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.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java new file mode 100644 index 000000000000..80e1cac92863 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices; + +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.recoveryservices.fluent.RecoveryServicesManagementClient; +import com.azure.resourcemanager.recoveryservices.implementation.OperationsImpl; +import com.azure.resourcemanager.recoveryservices.implementation.PrivateLinkResourcesOperationsImpl; +import com.azure.resourcemanager.recoveryservices.implementation.RecoveryServicesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.RecoveryServicesManagementClientBuilder; +import com.azure.resourcemanager.recoveryservices.implementation.RegisteredIdentitiesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.ReplicationUsagesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.UsagesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.VaultCertificatesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.VaultExtendedInfoesImpl; +import com.azure.resourcemanager.recoveryservices.implementation.VaultsImpl; +import com.azure.resourcemanager.recoveryservices.models.Operations; +import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResourcesOperations; +import com.azure.resourcemanager.recoveryservices.models.RecoveryServices; +import com.azure.resourcemanager.recoveryservices.models.RegisteredIdentities; +import com.azure.resourcemanager.recoveryservices.models.ReplicationUsages; +import com.azure.resourcemanager.recoveryservices.models.Usages; +import com.azure.resourcemanager.recoveryservices.models.VaultCertificates; +import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; +import com.azure.resourcemanager.recoveryservices.models.Vaults; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to RecoveryServicesManager. Recovery Services Client. */ +public final class RecoveryServicesManager { + private VaultCertificates vaultCertificates; + + private RegisteredIdentities registeredIdentities; + + private ReplicationUsages replicationUsages; + + private PrivateLinkResourcesOperations privateLinkResourcesOperations; + + private RecoveryServices recoveryServices; + + private Vaults vaults; + + private Operations operations; + + private VaultExtendedInfoes vaultExtendedInfoes; + + private Usages usages; + + private final RecoveryServicesManagementClient clientObject; + + private RecoveryServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new RecoveryServicesManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of RecoveryServices service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the RecoveryServices service API instance. + */ + public static RecoveryServicesManager 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 RecoveryServicesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RecoveryServicesManager.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 RecoveryServices service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the RecoveryServices service API instance. + */ + public RecoveryServicesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.recoveryservices", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RecoveryServicesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of VaultCertificates. */ + public VaultCertificates vaultCertificates() { + if (this.vaultCertificates == null) { + this.vaultCertificates = new VaultCertificatesImpl(clientObject.getVaultCertificates(), this); + } + return vaultCertificates; + } + + /** @return Resource collection API of RegisteredIdentities. */ + public RegisteredIdentities registeredIdentities() { + if (this.registeredIdentities == null) { + this.registeredIdentities = new RegisteredIdentitiesImpl(clientObject.getRegisteredIdentities(), this); + } + return registeredIdentities; + } + + /** @return Resource collection API of ReplicationUsages. */ + public ReplicationUsages replicationUsages() { + if (this.replicationUsages == null) { + this.replicationUsages = new ReplicationUsagesImpl(clientObject.getReplicationUsages(), this); + } + return replicationUsages; + } + + /** @return Resource collection API of PrivateLinkResourcesOperations. */ + public PrivateLinkResourcesOperations privateLinkResourcesOperations() { + if (this.privateLinkResourcesOperations == null) { + this.privateLinkResourcesOperations = + new PrivateLinkResourcesOperationsImpl(clientObject.getPrivateLinkResourcesOperations(), this); + } + return privateLinkResourcesOperations; + } + + /** @return Resource collection API of RecoveryServices. */ + public RecoveryServices recoveryServices() { + if (this.recoveryServices == null) { + this.recoveryServices = new RecoveryServicesImpl(clientObject.getRecoveryServices(), this); + } + return recoveryServices; + } + + /** @return Resource collection API of Vaults. */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(clientObject.getVaults(), this); + } + return vaults; + } + + /** @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 VaultExtendedInfoes. */ + public VaultExtendedInfoes vaultExtendedInfoes() { + if (this.vaultExtendedInfoes == null) { + this.vaultExtendedInfoes = new VaultExtendedInfoesImpl(clientObject.getVaultExtendedInfoes(), this); + } + return vaultExtendedInfoes; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * @return Wrapped service client RecoveryServicesManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public RecoveryServicesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java new file mode 100644 index 000000000000..4bc1a2ee1385 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.java new file mode 100644 index 000000000000..aff819a4682f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/PrivateLinkResourcesOperationsClient.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.recoveryservices.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.recoveryservices.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesOperationsClient. */ +public interface PrivateLinkResourcesOperationsClient { + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String vaultName, String privateLinkResourceName); + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String privateLinkResourceName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.java new file mode 100644 index 000000000000..097e6db77e5d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesClient.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.recoveryservices.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.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; + +/** An instance of this class provides access to all the operations defined in RecoveryServicesClient. */ +public interface RecoveryServicesClient { + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityParameters input); + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.java new file mode 100644 index 000000000000..e3e15634178d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RecoveryServicesManagementClient.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.recoveryservices.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for RecoveryServicesManagementClient class. */ +public interface RecoveryServicesManagementClient { + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the VaultCertificatesClient object to access its operations. + * + * @return the VaultCertificatesClient object. + */ + VaultCertificatesClient getVaultCertificates(); + + /** + * Gets the RegisteredIdentitiesClient object to access its operations. + * + * @return the RegisteredIdentitiesClient object. + */ + RegisteredIdentitiesClient getRegisteredIdentities(); + + /** + * Gets the ReplicationUsagesClient object to access its operations. + * + * @return the ReplicationUsagesClient object. + */ + ReplicationUsagesClient getReplicationUsages(); + + /** + * Gets the PrivateLinkResourcesOperationsClient object to access its operations. + * + * @return the PrivateLinkResourcesOperationsClient object. + */ + PrivateLinkResourcesOperationsClient getPrivateLinkResourcesOperations(); + + /** + * Gets the RecoveryServicesClient object to access its operations. + * + * @return the RecoveryServicesClient object. + */ + RecoveryServicesClient getRecoveryServices(); + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + VaultsClient getVaults(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the VaultExtendedInfoesClient object to access its operations. + * + * @return the VaultExtendedInfoesClient object. + */ + VaultExtendedInfoesClient getVaultExtendedInfoes(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.java new file mode 100644 index 000000000000..ee406e13f77b --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/RegisteredIdentitiesClient.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.recoveryservices.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 RegisteredIdentitiesClient. */ +public interface RegisteredIdentitiesClient { + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vaultName, String identityName); + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String vaultName, String identityName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.java new file mode 100644 index 000000000000..aad20335ba81 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/ReplicationUsagesClient.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.recoveryservices.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.recoveryservices.fluent.models.ReplicationUsageInner; + +/** An instance of this class provides access to all the operations defined in ReplicationUsagesClient. */ +public interface ReplicationUsagesClient { + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.java new file mode 100644 index 000000000000..ffc34e7d1d6e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/UsagesClient.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.recoveryservices.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.recoveryservices.fluent.models.VaultUsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVaults(String resourceGroupName, String vaultName); + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.java new file mode 100644 index 000000000000..ff9506321ec4 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultCertificatesClient.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.recoveryservices.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.recoveryservices.fluent.models.VaultCertificateResponseInner; +import com.azure.resourcemanager.recoveryservices.models.CertificateRequest; + +/** An instance of this class provides access to all the operations defined in VaultCertificatesClient. */ +public interface VaultCertificatesClient { + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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. + * @return certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultCertificateResponseInner create( + String resourceGroupName, String vaultName, String certificateName, CertificateRequest certificateRequest); + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String vaultName, + String certificateName, + CertificateRequest certificateRequest, + Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.java new file mode 100644 index 000000000000..7e29f05c9a3e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultExtendedInfoesClient.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.recoveryservices.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.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; + +/** An instance of this class provides access to all the operations defined in VaultExtendedInfoesClient. */ +public interface VaultExtendedInfoesClient { + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return the vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultExtendedInfoResourceInner get(String resourceGroupName, String vaultName); + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, Context context); + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultExtendedInfoResourceInner createOrUpdate( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails); + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context); + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultExtendedInfoResourceInner update( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails); + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.java new file mode 100644 index 000000000000..146ba00f6ea3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/VaultsClient.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.recoveryservices.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.recoveryservices.fluent.models.VaultInner; +import com.azure.resourcemanager.recoveryservices.models.PatchVault; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public interface VaultsClient { + /** + * Fetches all the resources of the specified type in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return the Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner getByResourceGroup(String resourceGroupName, String vaultName); + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultInner vault); + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String vaultName, VaultInner vault, Context context); + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 delete(String resourceGroupName, String vaultName); + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 deleteWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner update(String resourceGroupName, String vaultName, PatchVault vault); + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String vaultName, PatchVault vault, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..558d40daf980 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/CheckNameAvailabilityResultInner.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.recoveryservices.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; + +/** Response for check name availability API. Resource provider will set availability as true | false. */ +@Fluent +public final class CheckNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); + + /* + * The nameAvailable property. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason property. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: The nameAvailable property. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: The nameAvailable property. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason property. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: The reason property. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The message property. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message property. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ClientDiscoveryValueForSingleApiInner.java new file mode 100644 index 000000000000..d72d790ef3bc --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay; +import com.azure.resourcemanager.recoveryservices.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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..2b62e074729b --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of the private link resource. */ +@JsonFlatten +@Immutable +public class PrivateLinkResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * e.g. Microsoft.RecoveryServices/vaults/privateLinkResources + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or + * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery) + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1] + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: e.g. Microsoft.RecoveryServices/vaults/privateLinkResources. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the groupId property: e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or + * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery). + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java new file mode 100644 index 000000000000..f66c1db514a3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/ReplicationUsageInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.models.JobsSummary; +import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication usages of a vault. */ +@Fluent +public final class ReplicationUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsageInner.class); + + /* + * Summary of the replication monitoring data for this vault. + */ + @JsonProperty(value = "monitoringSummary") + private MonitoringSummary monitoringSummary; + + /* + * Summary of the replication jobs data for this vault. + */ + @JsonProperty(value = "jobsSummary") + private JobsSummary jobsSummary; + + /* + * Number of replication protected items for this vault. + */ + @JsonProperty(value = "protectedItemCount") + private Integer protectedItemCount; + + /* + * Number of replication recovery plans for this vault. + */ + @JsonProperty(value = "recoveryPlanCount") + private Integer recoveryPlanCount; + + /* + * Number of servers registered to this vault. + */ + @JsonProperty(value = "registeredServersCount") + private Integer registeredServersCount; + + /* + * The authentication type of recovery service providers in the vault. + */ + @JsonProperty(value = "recoveryServicesProviderAuthType") + private Integer recoveryServicesProviderAuthType; + + /** + * Get the monitoringSummary property: Summary of the replication monitoring data for this vault. + * + * @return the monitoringSummary value. + */ + public MonitoringSummary monitoringSummary() { + return this.monitoringSummary; + } + + /** + * Set the monitoringSummary property: Summary of the replication monitoring data for this vault. + * + * @param monitoringSummary the monitoringSummary value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withMonitoringSummary(MonitoringSummary monitoringSummary) { + this.monitoringSummary = monitoringSummary; + return this; + } + + /** + * Get the jobsSummary property: Summary of the replication jobs data for this vault. + * + * @return the jobsSummary value. + */ + public JobsSummary jobsSummary() { + return this.jobsSummary; + } + + /** + * Set the jobsSummary property: Summary of the replication jobs data for this vault. + * + * @param jobsSummary the jobsSummary value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withJobsSummary(JobsSummary jobsSummary) { + this.jobsSummary = jobsSummary; + return this; + } + + /** + * Get the protectedItemCount property: Number of replication protected items for this vault. + * + * @return the protectedItemCount value. + */ + public Integer protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the protectedItemCount property: Number of replication protected items for this vault. + * + * @param protectedItemCount the protectedItemCount value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withProtectedItemCount(Integer protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the recoveryPlanCount property: Number of replication recovery plans for this vault. + * + * @return the recoveryPlanCount value. + */ + public Integer recoveryPlanCount() { + return this.recoveryPlanCount; + } + + /** + * Set the recoveryPlanCount property: Number of replication recovery plans for this vault. + * + * @param recoveryPlanCount the recoveryPlanCount value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withRecoveryPlanCount(Integer recoveryPlanCount) { + this.recoveryPlanCount = recoveryPlanCount; + return this; + } + + /** + * Get the registeredServersCount property: Number of servers registered to this vault. + * + * @return the registeredServersCount value. + */ + public Integer registeredServersCount() { + return this.registeredServersCount; + } + + /** + * Set the registeredServersCount property: Number of servers registered to this vault. + * + * @param registeredServersCount the registeredServersCount value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withRegisteredServersCount(Integer registeredServersCount) { + this.registeredServersCount = registeredServersCount; + return this; + } + + /** + * Get the recoveryServicesProviderAuthType property: The authentication type of recovery service providers in the + * vault. + * + * @return the recoveryServicesProviderAuthType value. + */ + public Integer recoveryServicesProviderAuthType() { + return this.recoveryServicesProviderAuthType; + } + + /** + * Set the recoveryServicesProviderAuthType property: The authentication type of recovery service providers in the + * vault. + * + * @param recoveryServicesProviderAuthType the recoveryServicesProviderAuthType value to set. + * @return the ReplicationUsageInner object itself. + */ + public ReplicationUsageInner withRecoveryServicesProviderAuthType(Integer recoveryServicesProviderAuthType) { + this.recoveryServicesProviderAuthType = recoveryServicesProviderAuthType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monitoringSummary() != null) { + monitoringSummary().validate(); + } + if (jobsSummary() != null) { + jobsSummary().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.java new file mode 100644 index 000000000000..dfcf5d161a7c --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultCertificateResponseInner.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.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.models.ResourceCertificateDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate corresponding to a vault that can be used by clients to register themselves with the vault. */ +@Fluent +public final class VaultCertificateResponseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificateResponseInner.class); + + /* + * Certificate details representing the Vault credentials. + */ + @JsonProperty(value = "properties") + private ResourceCertificateDetails properties; + + /** + * Get the properties property: Certificate details representing the Vault credentials. + * + * @return the properties value. + */ + public ResourceCertificateDetails properties() { + return this.properties; + } + + /** + * Set the properties property: Certificate details representing the Vault credentials. + * + * @param properties the properties value to set. + * @return the VaultCertificateResponseInner object itself. + */ + public VaultCertificateResponseInner withProperties(ResourceCertificateDetails properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.java new file mode 100644 index 000000000000..2a6489d1bec2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultExtendedInfoResourceInner.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.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault extended information. */ +@JsonFlatten +@Fluent +public class VaultExtendedInfoResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultExtendedInfoResourceInner.class); + + /* + * Integrity key. + */ + @JsonProperty(value = "properties.integrityKey") + private String integrityKey; + + /* + * Encryption key. + */ + @JsonProperty(value = "properties.encryptionKey") + private String encryptionKey; + + /* + * Encryption key thumbprint. + */ + @JsonProperty(value = "properties.encryptionKeyThumbprint") + private String encryptionKeyThumbprint; + + /* + * Algorithm for Vault ExtendedInfo + */ + @JsonProperty(value = "properties.algorithm") + private String algorithm; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the integrityKey property: Integrity key. + * + * @return the integrityKey value. + */ + public String integrityKey() { + return this.integrityKey; + } + + /** + * Set the integrityKey property: Integrity key. + * + * @param integrityKey the integrityKey value to set. + * @return the VaultExtendedInfoResourceInner object itself. + */ + public VaultExtendedInfoResourceInner withIntegrityKey(String integrityKey) { + this.integrityKey = integrityKey; + return this; + } + + /** + * Get the encryptionKey property: Encryption key. + * + * @return the encryptionKey value. + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: Encryption key. + * + * @param encryptionKey the encryptionKey value to set. + * @return the VaultExtendedInfoResourceInner object itself. + */ + public VaultExtendedInfoResourceInner withEncryptionKey(String encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the encryptionKeyThumbprint property: Encryption key thumbprint. + * + * @return the encryptionKeyThumbprint value. + */ + public String encryptionKeyThumbprint() { + return this.encryptionKeyThumbprint; + } + + /** + * Set the encryptionKeyThumbprint property: Encryption key thumbprint. + * + * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set. + * @return the VaultExtendedInfoResourceInner object itself. + */ + public VaultExtendedInfoResourceInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { + this.encryptionKeyThumbprint = encryptionKeyThumbprint; + return this; + } + + /** + * Get the algorithm property: Algorithm for Vault ExtendedInfo. + * + * @return the algorithm value. + */ + public String algorithm() { + return this.algorithm; + } + + /** + * Set the algorithm property: Algorithm for Vault ExtendedInfo. + * + * @param algorithm the algorithm value to set. + * @return the VaultExtendedInfoResourceInner object itself. + */ + public VaultExtendedInfoResourceInner withAlgorithm(String algorithm) { + this.algorithm = algorithm; + 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 VaultExtendedInfoResourceInner object itself. + */ + public VaultExtendedInfoResourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.java new file mode 100644 index 000000000000..7c26f78d82a6 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultInner.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.recoveryservices.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.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.Sku; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource information, as returned by the resource provider. */ +@Fluent +public final class VaultInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultInner.class); + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityData identity; + + /* + * Properties of the vault. + */ + @JsonProperty(value = "properties") + private VaultProperties properties; + + /* + * Identifies the unique system identifier for each Azure resource. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityData identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the VaultInner object itself. + */ + public VaultInner withIdentity(IdentityData identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: Properties of the vault. + * + * @return the properties value. + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the vault. + * + * @param properties the properties value to set. + * @return the VaultInner object itself. + */ + public VaultInner withProperties(VaultProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Identifies the unique system identifier for each Azure resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Identifies the unique system identifier for each Azure resource. + * + * @param sku the sku value to set. + * @return the VaultInner object itself. + */ + public VaultInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.java new file mode 100644 index 000000000000..6760967308e3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/VaultUsageInner.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.recoveryservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.models.NameInfo; +import com.azure.resourcemanager.recoveryservices.models.UsagesUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Usages of a vault. */ +@Fluent +public final class VaultUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultUsageInner.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 VaultUsageInner object itself. + */ + public VaultUsageInner 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 VaultUsageInner object itself. + */ + public VaultUsageInner 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 VaultUsageInner object itself. + */ + public VaultUsageInner 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 VaultUsageInner object itself. + */ + public VaultUsageInner 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 VaultUsageInner object itself. + */ + public VaultUsageInner 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 VaultUsageInner object itself. + */ + public VaultUsageInner 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/package-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/package-info.java new file mode 100644 index 000000000000..3d2a29c992be --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for RecoveryServicesManagementClient. Recovery Services Client. */ +package com.azure.resourcemanager.recoveryservices.fluent.models; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/package-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/package-info.java new file mode 100644 index 000000000000..f3cb8710b189 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for RecoveryServicesManagementClient. Recovery Services Client. */ +package com.azure.resourcemanager.recoveryservices.fluent; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..712bd7afc4ab --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/CheckNameAvailabilityResultImpl.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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityResult; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, RecoveryServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ClientDiscoveryValueForSingleApiImpl.java new file mode 100644 index 000000000000..1b7a3d80d01a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryDisplay; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryForProperties; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryValueForSingleApi; + +public final class ClientDiscoveryValueForSingleApiImpl implements ClientDiscoveryValueForSingleApi { + private ClientDiscoveryValueForSingleApiInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public ClientDiscoveryValueForSingleApiImpl( + ClientDiscoveryValueForSingleApiInner innerObject, RecoveryServicesManager 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 RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..ed1d7cdb0ce6 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsClientImpl.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.recoveryservices.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.recoveryservices.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryResponse; +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 RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface OperationsService { + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java new file mode 100644 index 000000000000..4ebae3e740cb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner; +import com.azure.resourcemanager.recoveryservices.models.ClientDiscoveryValueForSingleApi; +import com.azure.resourcemanager.recoveryservices.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, RecoveryServicesManager 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 OperationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..037c26a155ea --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourceImpl.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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, RecoveryServicesManager 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 groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java new file mode 100644 index 000000000000..49fde72c0b02 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsClientImpl.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.PrivateLinkResourcesOperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResources; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesOperationsClient. */ +public final class PrivateLinkResourcesOperationsClientImpl implements PrivateLinkResourcesOperationsClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesOperationsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesOperationsClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkResourcesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientPrivateLinkResourcesOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface PrivateLinkResourcesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @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 private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String privateLinkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + privateLinkResourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String privateLinkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + privateLinkResourceName, + accept, + context); + } + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, vaultName, privateLinkResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String vaultName, String privateLinkResourceName) { + return getAsync(resourceGroupName, vaultName, privateLinkResourceName).block(); + } + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, privateLinkResourceName, 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 class which represent the stamps associated with the vault. + */ + @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 class which represent the stamps associated with the vault. + */ + @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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.java new file mode 100644 index 000000000000..4e31a2abc9b6 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/PrivateLinkResourcesOperationsImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.PrivateLinkResourcesOperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResource; +import com.azure.resourcemanager.recoveryservices.models.PrivateLinkResourcesOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesOperationsImpl implements PrivateLinkResourcesOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesOperationsImpl.class); + + private final PrivateLinkResourcesOperationsClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public PrivateLinkResourcesOperationsImpl( + PrivateLinkResourcesOperationsClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, vaultName, context); + return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String vaultName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, vaultName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String privateLinkResourceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, privateLinkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesOperationsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java new file mode 100644 index 000000000000..5bfa9a60f9ca --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesClientImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.RecoveryServicesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RecoveryServicesClient. */ +public final class RecoveryServicesClientImpl implements RecoveryServicesClient { + private final ClientLogger logger = new ClientLogger(RecoveryServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RecoveryServicesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of RecoveryServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RecoveryServicesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(RecoveryServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientRecoveryServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface RecoveryServicesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("location") String location, + @BodyParam("application/json") CheckNameAvailabilityParameters input, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String location, CheckNameAvailabilityParameters input) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + location, + input, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (input == null) { + return Mono.error(new IllegalArgumentException("Parameter input is required and cannot be null.")); + } else { + input.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + location, + input, + accept, + context); + } + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String location, CheckNameAvailabilityParameters input) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, location, input) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityParameters input) { + return checkNameAvailabilityAsync(resourceGroupName, location, input).block(); + } + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, location, input, context).block(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.java new file mode 100644 index 000000000000..2f4c179924ca --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.recoveryservices.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.recoveryservices.models.RecoveryServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RecoveryServicesImpl implements RecoveryServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoveryServicesImpl.class); + + private final RecoveryServicesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public RecoveryServicesImpl(RecoveryServicesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityParameters input) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, location, input); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(resourceGroupName, location, input, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private RecoveryServicesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientBuilder.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientBuilder.java new file mode 100644 index 000000000000..46b3d69a038f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientBuilder.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.recoveryservices.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 RecoveryServicesManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {RecoveryServicesManagementClientImpl.class}) +public final class RecoveryServicesManagementClientBuilder { + /* + * The subscription Id. + */ + private String subscriptionId; + + /** + * Sets The subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder 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 RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder 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 RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder 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 RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder 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 RecoveryServicesManagementClientBuilder. + */ + public RecoveryServicesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of RecoveryServicesManagementClientImpl with the provided parameters. + * + * @return an instance of RecoveryServicesManagementClientImpl. + */ + public RecoveryServicesManagementClientImpl 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(); + } + RecoveryServicesManagementClientImpl client = + new RecoveryServicesManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java new file mode 100644 index 000000000000..73ec143fc2ce --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RecoveryServicesManagementClientImpl.java @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.OperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.PrivateLinkResourcesOperationsClient; +import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesClient; +import com.azure.resourcemanager.recoveryservices.fluent.RecoveryServicesManagementClient; +import com.azure.resourcemanager.recoveryservices.fluent.RegisteredIdentitiesClient; +import com.azure.resourcemanager.recoveryservices.fluent.ReplicationUsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.UsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.VaultCertificatesClient; +import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; +import com.azure.resourcemanager.recoveryservices.fluent.VaultsClient; +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 RecoveryServicesManagementClientImpl type. */ +@ServiceClient(builder = RecoveryServicesManagementClientBuilder.class) +public final class RecoveryServicesManagementClientImpl implements RecoveryServicesManagementClient { + private final ClientLogger logger = new ClientLogger(RecoveryServicesManagementClientImpl.class); + + /** The subscription Id. */ + private final String subscriptionId; + + /** + * Gets The subscription Id. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The VaultCertificatesClient object to access its operations. */ + private final VaultCertificatesClient vaultCertificates; + + /** + * Gets the VaultCertificatesClient object to access its operations. + * + * @return the VaultCertificatesClient object. + */ + public VaultCertificatesClient getVaultCertificates() { + return this.vaultCertificates; + } + + /** The RegisteredIdentitiesClient object to access its operations. */ + private final RegisteredIdentitiesClient registeredIdentities; + + /** + * Gets the RegisteredIdentitiesClient object to access its operations. + * + * @return the RegisteredIdentitiesClient object. + */ + public RegisteredIdentitiesClient getRegisteredIdentities() { + return this.registeredIdentities; + } + + /** The ReplicationUsagesClient object to access its operations. */ + private final ReplicationUsagesClient replicationUsages; + + /** + * Gets the ReplicationUsagesClient object to access its operations. + * + * @return the ReplicationUsagesClient object. + */ + public ReplicationUsagesClient getReplicationUsages() { + return this.replicationUsages; + } + + /** The PrivateLinkResourcesOperationsClient object to access its operations. */ + private final PrivateLinkResourcesOperationsClient privateLinkResourcesOperations; + + /** + * Gets the PrivateLinkResourcesOperationsClient object to access its operations. + * + * @return the PrivateLinkResourcesOperationsClient object. + */ + public PrivateLinkResourcesOperationsClient getPrivateLinkResourcesOperations() { + return this.privateLinkResourcesOperations; + } + + /** The RecoveryServicesClient object to access its operations. */ + private final RecoveryServicesClient recoveryServices; + + /** + * Gets the RecoveryServicesClient object to access its operations. + * + * @return the RecoveryServicesClient object. + */ + public RecoveryServicesClient getRecoveryServices() { + return this.recoveryServices; + } + + /** The VaultsClient object to access its operations. */ + private final VaultsClient vaults; + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + public VaultsClient getVaults() { + return this.vaults; + } + + /** 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 VaultExtendedInfoesClient object to access its operations. */ + private final VaultExtendedInfoesClient vaultExtendedInfoes; + + /** + * Gets the VaultExtendedInfoesClient object to access its operations. + * + * @return the VaultExtendedInfoesClient object. + */ + public VaultExtendedInfoesClient getVaultExtendedInfoes() { + return this.vaultExtendedInfoes; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** + * Initializes an instance of RecoveryServicesManagementClient 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. + */ + RecoveryServicesManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2016-06-01"; + this.vaultCertificates = new VaultCertificatesClientImpl(this); + this.registeredIdentities = new RegisteredIdentitiesClientImpl(this); + this.replicationUsages = new ReplicationUsagesClientImpl(this); + this.privateLinkResourcesOperations = new PrivateLinkResourcesOperationsClientImpl(this); + this.recoveryServices = new RecoveryServicesClientImpl(this); + this.vaults = new VaultsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.vaultExtendedInfoes = new VaultExtendedInfoesClientImpl(this); + this.usages = new UsagesClientImpl(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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.java new file mode 100644 index 000000000000..205ec3f49aee --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesClientImpl.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.recoveryservices.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +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.recoveryservices.fluent.RegisteredIdentitiesClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegisteredIdentitiesClient. */ +public final class RegisteredIdentitiesClientImpl implements RegisteredIdentitiesClient { + private final ClientLogger logger = new ClientLogger(RegisteredIdentitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegisteredIdentitiesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of RegisteredIdentitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegisteredIdentitiesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy + .create(RegisteredIdentitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientRegisteredIdentities to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface RegisteredIdentitiesService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/registeredIdentities/{identityName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("identityName") String identityName, + Context context); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String identityName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (identityName == null) { + return Mono.error(new IllegalArgumentException("Parameter identityName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + identityName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String identityName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (identityName == null) { + return Mono.error(new IllegalArgumentException("Parameter identityName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + identityName, + context); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName, String identityName) { + return deleteWithResponseAsync(resourceGroupName, vaultName, identityName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName, String identityName) { + deleteAsync(resourceGroupName, vaultName, identityName).block(); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String vaultName, String identityName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, identityName, context).block(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.java new file mode 100644 index 000000000000..b7936e9800eb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/RegisteredIdentitiesImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.RegisteredIdentitiesClient; +import com.azure.resourcemanager.recoveryservices.models.RegisteredIdentities; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegisteredIdentitiesImpl implements RegisteredIdentities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredIdentitiesImpl.class); + + private final RegisteredIdentitiesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public RegisteredIdentitiesImpl(RegisteredIdentitiesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String vaultName, String identityName) { + this.serviceClient().delete(resourceGroupName, vaultName, identityName); + } + + public Response deleteWithResponse( + String resourceGroupName, String vaultName, String identityName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, identityName, context); + } + + private RegisteredIdentitiesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.java new file mode 100644 index 000000000000..8957b2332b72 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsageImpl.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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; +import com.azure.resourcemanager.recoveryservices.models.JobsSummary; +import com.azure.resourcemanager.recoveryservices.models.MonitoringSummary; +import com.azure.resourcemanager.recoveryservices.models.ReplicationUsage; + +public final class ReplicationUsageImpl implements ReplicationUsage { + private ReplicationUsageInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public ReplicationUsageImpl(ReplicationUsageInner innerObject, RecoveryServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public MonitoringSummary monitoringSummary() { + return this.innerModel().monitoringSummary(); + } + + public JobsSummary jobsSummary() { + return this.innerModel().jobsSummary(); + } + + public Integer protectedItemCount() { + return this.innerModel().protectedItemCount(); + } + + public Integer recoveryPlanCount() { + return this.innerModel().recoveryPlanCount(); + } + + public Integer registeredServersCount() { + return this.innerModel().registeredServersCount(); + } + + public Integer recoveryServicesProviderAuthType() { + return this.innerModel().recoveryServicesProviderAuthType(); + } + + public ReplicationUsageInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java new file mode 100644 index 000000000000..8df6493090ac --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesClientImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.ReplicationUsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; +import com.azure.resourcemanager.recoveryservices.models.ReplicationUsageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationUsagesClient. */ +public final class ReplicationUsagesClientImpl implements ReplicationUsagesClient { + private final ClientLogger logger = new ClientLogger(ReplicationUsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ReplicationUsagesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of ReplicationUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationUsagesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientReplicationUsages to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface ReplicationUsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/replicationUsages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + 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 replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName)); + } + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, context)); + } + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.java new file mode 100644 index 000000000000..ef0eec19a1cf --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/ReplicationUsagesImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.ReplicationUsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; +import com.azure.resourcemanager.recoveryservices.models.ReplicationUsage; +import com.azure.resourcemanager.recoveryservices.models.ReplicationUsages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ReplicationUsagesImpl implements ReplicationUsages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsagesImpl.class); + + private final ReplicationUsagesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public ReplicationUsagesImpl(ReplicationUsagesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return inner.mapPage(inner1 -> new ReplicationUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); + return inner.mapPage(inner1 -> new ReplicationUsageImpl(inner1, this.manager())); + } + + private ReplicationUsagesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java new file mode 100644 index 000000000000..2a580ba90e53 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesClientImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.UsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; +import com.azure.resourcemanager.recoveryservices.models.VaultUsageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientUsages to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVaults( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVaultsSinglePageAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVaults( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + 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 usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVaultsSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVaults( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVaultsAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>(() -> listByVaultsSinglePageAsync(resourceGroupName, vaultName)); + } + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVaultsAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>(() -> listByVaultsSinglePageAsync(resourceGroupName, vaultName, context)); + } + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVaults(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listByVaultsAsync(resourceGroupName, vaultName)); + } + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listByVaultsAsync(resourceGroupName, vaultName, context)); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java new file mode 100644 index 000000000000..ab8988c3b995 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.UsagesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; +import com.azure.resourcemanager.recoveryservices.models.Usages; +import com.azure.resourcemanager.recoveryservices.models.VaultUsage; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public UsagesImpl(UsagesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByVaults(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().listByVaults(resourceGroupName, vaultName); + return inner.mapPage(inner1 -> new VaultUsageImpl(inner1, this.manager())); + } + + public PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = this.serviceClient().listByVaults(resourceGroupName, vaultName, context); + return inner.mapPage(inner1 -> new VaultUsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.java new file mode 100644 index 000000000000..f05bc5971179 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/Utils.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.recoveryservices.implementation; + +import java.util.Arrays; +import java.util.Iterator; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.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; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.java new file mode 100644 index 000000000000..f89e83576368 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificateResponseImpl.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.recoveryservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner; +import com.azure.resourcemanager.recoveryservices.models.CertificateRequest; +import com.azure.resourcemanager.recoveryservices.models.RawCertificateData; +import com.azure.resourcemanager.recoveryservices.models.ResourceCertificateDetails; +import com.azure.resourcemanager.recoveryservices.models.VaultCertificateResponse; + +public final class VaultCertificateResponseImpl + implements VaultCertificateResponse, VaultCertificateResponse.Definition { + private VaultCertificateResponseInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public VaultCertificateResponseImpl( + VaultCertificateResponseInner innerObject, RecoveryServicesManager 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 ResourceCertificateDetails properties() { + return this.innerModel().properties(); + } + + public VaultCertificateResponseInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String certificateName; + + private CertificateRequest createCertificateRequest; + + public VaultCertificateResponseImpl withExistingVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public VaultCertificateResponse create() { + this.innerObject = + serviceManager + .serviceClient() + .getVaultCertificates() + .createWithResponse( + resourceGroupName, vaultName, certificateName, createCertificateRequest, Context.NONE) + .getValue(); + return this; + } + + public VaultCertificateResponse create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaultCertificates() + .createWithResponse(resourceGroupName, vaultName, certificateName, createCertificateRequest, context) + .getValue(); + return this; + } + + public VaultCertificateResponseImpl(String name, RecoveryServicesManager serviceManager) { + this.innerObject = new VaultCertificateResponseInner(); + this.serviceManager = serviceManager; + this.certificateName = name; + this.createCertificateRequest = new CertificateRequest(); + } + + public VaultCertificateResponseImpl withProperties(RawCertificateData properties) { + this.createCertificateRequest.withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.java new file mode 100644 index 000000000000..063522a0f585 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesClientImpl.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.recoveryservices.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.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.recoveryservices.fluent.VaultCertificatesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner; +import com.azure.resourcemanager.recoveryservices.models.CertificateRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultCertificatesClient. */ +public final class VaultCertificatesClientImpl implements VaultCertificatesClient { + private final ClientLogger logger = new ClientLogger(VaultCertificatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VaultCertificatesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of VaultCertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultCertificatesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(VaultCertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientVaultCertificates to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface VaultCertificatesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/certificates/{certificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") CertificateRequest certificateRequest, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String vaultName, String certificateName, CertificateRequest certificateRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (certificateRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateRequest is required and cannot be null.")); + } else { + certificateRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + certificateName, + certificateRequest, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String vaultName, + String certificateName, + CertificateRequest certificateRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (certificateRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateRequest is required and cannot be null.")); + } else { + certificateRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + certificateName, + certificateRequest, + accept, + context); + } + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String vaultName, String certificateName, CertificateRequest certificateRequest) { + return createWithResponseAsync(resourceGroupName, vaultName, certificateName, certificateRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultCertificateResponseInner create( + String resourceGroupName, String vaultName, String certificateName, CertificateRequest certificateRequest) { + return createAsync(resourceGroupName, vaultName, certificateName, certificateRequest).block(); + } + + /** + * Uploads a certificate for a resource. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param certificateName Certificate friendly name. + * @param certificateRequest Details of the certificate to be uploaded to the 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 certificate corresponding to a vault that can be used by clients to register themselves with the vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String vaultName, + String certificateName, + CertificateRequest certificateRequest, + Context context) { + return createWithResponseAsync(resourceGroupName, vaultName, certificateName, certificateRequest, context) + .block(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.java new file mode 100644 index 000000000000..9d19a96a85ca --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultCertificatesImpl.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.recoveryservices.implementation; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.VaultCertificatesClient; +import com.azure.resourcemanager.recoveryservices.models.VaultCertificates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VaultCertificatesImpl implements VaultCertificates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificatesImpl.class); + + private final VaultCertificatesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public VaultCertificatesImpl(VaultCertificatesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + private VaultCertificatesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } + + public VaultCertificateResponseImpl define(String name) { + return new VaultCertificateResponseImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.java new file mode 100644 index 000000000000..f29d20f75a83 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoResourceImpl.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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; +import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoResource; + +public final class VaultExtendedInfoResourceImpl implements VaultExtendedInfoResource { + private VaultExtendedInfoResourceInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public VaultExtendedInfoResourceImpl( + VaultExtendedInfoResourceInner innerObject, RecoveryServicesManager 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 integrityKey() { + return this.innerModel().integrityKey(); + } + + public String encryptionKey() { + return this.innerModel().encryptionKey(); + } + + public String encryptionKeyThumbprint() { + return this.innerModel().encryptionKeyThumbprint(); + } + + public String algorithm() { + return this.innerModel().algorithm(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public VaultExtendedInfoResourceInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java new file mode 100644 index 000000000000..6891289e0ed2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesClientImpl.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.VaultExtendedInfoesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultExtendedInfoesClient. */ +public final class VaultExtendedInfoesClientImpl implements VaultExtendedInfoesClient { + private final ClientLogger logger = new ClientLogger(VaultExtendedInfoesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VaultExtendedInfoesService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of VaultExtendedInfoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultExtendedInfoesClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = + RestProxy.create(VaultExtendedInfoesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientVaultExtendedInfoes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface VaultExtendedInfoesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/extendedInformation/vaultExtendedInfo") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/extendedInformation/vaultExtendedInfo") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}/extendedInformation/vaultExtendedInfo") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context); + } + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName) { + return getWithResponseAsync(resourceGroupName, vaultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultExtendedInfoResourceInner get(String resourceGroupName, String vaultName) { + return getAsync(resourceGroupName, vaultName).block(); + } + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceExtendedInfoDetails == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceExtendedInfoDetails is required and cannot be null.")); + } else { + resourceExtendedInfoDetails.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + resourceExtendedInfoDetails, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceExtendedInfoDetails == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceExtendedInfoDetails is required and cannot be null.")); + } else { + resourceExtendedInfoDetails.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + resourceExtendedInfoDetails, + accept, + context); + } + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultExtendedInfoResourceInner createOrUpdate( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + return createOrUpdateAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails).block(); + } + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails, context) + .block(); + } + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceExtendedInfoDetails == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceExtendedInfoDetails is required and cannot be null.")); + } else { + resourceExtendedInfoDetails.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + resourceExtendedInfoDetails, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (resourceExtendedInfoDetails == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceExtendedInfoDetails is required and cannot be null.")); + } else { + resourceExtendedInfoDetails.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + resourceExtendedInfoDetails, + accept, + context); + } + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + return updateWithResponseAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultExtendedInfoResourceInner update( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + return updateAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails).block(); + } + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + return updateWithResponseAsync(resourceGroupName, vaultName, resourceExtendedInfoDetails, context).block(); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.java new file mode 100644 index 000000000000..98e535d471b3 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultExtendedInfoesImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.VaultExtendedInfoesClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; +import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoResource; +import com.azure.resourcemanager.recoveryservices.models.VaultExtendedInfoes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VaultExtendedInfoesImpl implements VaultExtendedInfoes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultExtendedInfoesImpl.class); + + private final VaultExtendedInfoesClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public VaultExtendedInfoesImpl(VaultExtendedInfoesClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VaultExtendedInfoResource get(String resourceGroupName, String vaultName) { + VaultExtendedInfoResourceInner inner = this.serviceClient().get(resourceGroupName, vaultName); + if (inner != null) { + return new VaultExtendedInfoResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultExtendedInfoResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultExtendedInfoResource createOrUpdate( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + VaultExtendedInfoResourceInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, vaultName, resourceExtendedInfoDetails); + if (inner != null) { + return new VaultExtendedInfoResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, vaultName, resourceExtendedInfoDetails, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultExtendedInfoResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultExtendedInfoResource update( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails) { + VaultExtendedInfoResourceInner inner = + this.serviceClient().update(resourceGroupName, vaultName, resourceExtendedInfoDetails); + if (inner != null) { + return new VaultExtendedInfoResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context) { + Response inner = + this.serviceClient().updateWithResponse(resourceGroupName, vaultName, resourceExtendedInfoDetails, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultExtendedInfoResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VaultExtendedInfoesClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.java new file mode 100644 index 000000000000..42fe6bebe11e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultImpl.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.recoveryservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import com.azure.resourcemanager.recoveryservices.models.IdentityData; +import com.azure.resourcemanager.recoveryservices.models.PatchVault; +import com.azure.resourcemanager.recoveryservices.models.Sku; +import com.azure.resourcemanager.recoveryservices.models.Vault; +import com.azure.resourcemanager.recoveryservices.models.VaultProperties; +import java.util.Collections; +import java.util.Map; + +public final class VaultImpl implements Vault, Vault.Definition, Vault.Update { + private VaultInner innerObject; + + private final RecoveryServicesManager 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 IdentityData identity() { + return this.innerModel().identity(); + } + + public VaultProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VaultInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private PatchVault updateVault; + + public VaultImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Vault create() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .createOrUpdateWithResponse(resourceGroupName, vaultName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Vault create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .createOrUpdateWithResponse(resourceGroupName, vaultName, this.innerModel(), context) + .getValue(); + return this; + } + + public VaultImpl(String name, RecoveryServicesManager serviceManager) { + this.innerObject = new VaultInner(); + this.serviceManager = serviceManager; + this.vaultName = name; + } + + public VaultImpl update() { + this.updateVault = new PatchVault(); + return this; + } + + public Vault apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .updateWithResponse(resourceGroupName, vaultName, updateVault, Context.NONE) + .getValue(); + return this; + } + + public Vault apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .updateWithResponse(resourceGroupName, vaultName, updateVault, context) + .getValue(); + return this; + } + + public VaultImpl(VaultInner innerObject, RecoveryServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + } + + public Vault refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE) + .getValue(); + return this; + } + + public Vault refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, context) + .getValue(); + return this; + } + + public VaultImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VaultImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VaultImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVault.withTags(tags); + return this; + } + } + + public VaultImpl withIdentity(IdentityData identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateVault.withIdentity(identity); + return this; + } + } + + public VaultImpl withProperties(VaultProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateVault.withProperties(properties); + return this; + } + } + + public VaultImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateVault.withSku(sku); + return this; + } + } + + public VaultImpl withEtag(String etag) { + this.updateVault.withEtag(etag); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.java new file mode 100644 index 000000000000..fc224b24e315 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultUsageImpl.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.recoveryservices.implementation; + +import com.azure.resourcemanager.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; +import com.azure.resourcemanager.recoveryservices.models.NameInfo; +import com.azure.resourcemanager.recoveryservices.models.UsagesUnit; +import com.azure.resourcemanager.recoveryservices.models.VaultUsage; +import java.time.OffsetDateTime; + +public final class VaultUsageImpl implements VaultUsage { + private VaultUsageInner innerObject; + + private final RecoveryServicesManager serviceManager; + + public VaultUsageImpl(VaultUsageInner innerObject, RecoveryServicesManager 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 VaultUsageInner innerModel() { + return this.innerObject; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java new file mode 100644 index 000000000000..825ea3e2c214 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsClientImpl.java @@ -0,0 +1,1233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.fluent.VaultsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import com.azure.resourcemanager.recoveryservices.models.PatchVault; +import com.azure.resourcemanager.recoveryservices.models.VaultList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public final class VaultsClientImpl implements VaultsClient { + private final ClientLogger logger = new ClientLogger(VaultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VaultsService service; + + /** The service client containing this operation class. */ + private final RecoveryServicesManagementClientImpl client; + + /** + * Initializes an instance of VaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultsClientImpl(RecoveryServicesManagementClientImpl client) { + this.service = RestProxy.create(VaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesManagementClientVaults to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RecoveryServicesMana") + private interface VaultsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @BodyParam("application/json") VaultInner vault, + @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}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices" + + "/vaults/{vaultName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @BodyParam("application/json") PatchVault vault, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionIdNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink)); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionIdNextSinglePageAsync(nextLink, context)); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + 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()))); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + accept, + context); + } + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) { + return getByResourceGroupAsync(resourceGroupName, vaultName).block(); + } + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, VaultInner vault) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (vault == null) { + return Mono.error(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + } else { + vault.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + vault, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, VaultInner vault, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (vault == null) { + return Mono.error(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + } else { + vault.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + vault, + accept, + context); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String vaultName, VaultInner vault) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultInner vault) { + return createOrUpdateAsync(resourceGroupName, vaultName, vault).block(); + } + + /** + * Creates or updates a Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String vaultName, VaultInner vault, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, vault, context).block(); + } + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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> deleteWithResponseAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + context); + } + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 deleteAsync(String resourceGroupName, String vaultName) { + return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 delete(String resourceGroupName, String vaultName) { + deleteAsync(resourceGroupName, vaultName).block(); + } + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, PatchVault vault) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (vault == null) { + return Mono.error(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + } else { + vault.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + vault, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, PatchVault vault, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (vault == null) { + return Mono.error(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + } else { + vault.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + vaultName, + vault, + accept, + context); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName, PatchVault vault) { + return updateWithResponseAsync(resourceGroupName, vaultName, vault) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner update(String resourceGroupName, String vaultName, PatchVault vault) { + return updateAsync(resourceGroupName, vaultName, vault).block(); + } + + /** + * Updates the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param vault Patch Resource information, as returned by the resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information, as returned by the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String vaultName, PatchVault vault, Context context) { + return updateWithResponseAsync(resourceGroupName, vaultName, vault, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionIdNextSinglePageAsync(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.listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionIdNextSinglePageAsync(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 + .listBySubscriptionIdNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.java new file mode 100644 index 000000000000..dafa2d29291a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/VaultsImpl.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.recoveryservices.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.recoveryservices.RecoveryServicesManager; +import com.azure.resourcemanager.recoveryservices.fluent.VaultsClient; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import com.azure.resourcemanager.recoveryservices.models.Vault; +import com.azure.resourcemanager.recoveryservices.models.Vaults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VaultsImpl implements Vaults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultsImpl.class); + + private final VaultsClient innerClient; + + private final RecoveryServicesManager serviceManager; + + public VaultsImpl(VaultsClient innerClient, RecoveryServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + public Vault getByResourceGroup(String resourceGroupName, String vaultName) { + VaultInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vaultName); + if (inner != null) { + return new VaultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String vaultName) { + this.serviceClient().delete(resourceGroupName, vaultName); + } + + public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, context); + } + + public Vault getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String 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))); + } + this.deleteWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String 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))); + } + return this.deleteWithResponse(resourceGroupName, vaultName, context); + } + + private VaultsClient serviceClient() { + return this.innerClient; + } + + private RecoveryServicesManager manager() { + return this.serviceManager; + } + + public VaultImpl define(String name) { + return new VaultImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/package-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/package-info.java new file mode 100644 index 000000000000..c3e937b6639a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for RecoveryServicesManagementClient. Recovery Services Client. */ +package com.azure.resourcemanager.recoveryservices.implementation; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.java new file mode 100644 index 000000000000..3767f7f31340 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/AuthType.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthType. */ +public final class AuthType extends ExpandableStringEnum { + /** Static value Invalid for AuthType. */ + public static final AuthType INVALID = fromString("Invalid"); + + /** Static value ACS for AuthType. */ + public static final AuthType ACS = fromString("ACS"); + + /** Static value AAD for AuthType. */ + public static final AuthType AAD = fromString("AAD"); + + /** Static value AccessControlService for AuthType. */ + public static final AuthType ACCESS_CONTROL_SERVICE = fromString("AccessControlService"); + + /** Static value AzureActiveDirectory for AuthType. */ + public static final AuthType AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** + * Creates or finds a AuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthType. + */ + @JsonCreator + public static AuthType fromString(String name) { + return fromString(name, AuthType.class); + } + + /** @return known AuthType values. */ + public static Collection values() { + return values(AuthType.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.java new file mode 100644 index 000000000000..8c0ed6d8051d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CertificateRequest.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.recoveryservices.models; + +import 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 the certificate to be uploaded to the vault. */ +@Fluent +public final class CertificateRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateRequest.class); + + /* + * Raw certificate data. + */ + @JsonProperty(value = "properties") + private RawCertificateData properties; + + /** + * Get the properties property: Raw certificate data. + * + * @return the properties value. + */ + public RawCertificateData properties() { + return this.properties; + } + + /** + * Set the properties property: Raw certificate data. + * + * @param properties the properties value to set. + * @return the CertificateRequest object itself. + */ + public CertificateRequest withProperties(RawCertificateData properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..30a208e751e2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityParameters.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Name availability input parameters - Resource type and resource name. */ +@Fluent +public final class CheckNameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameters.class); + + /* + * Describes the Resource type: Microsoft.RecoveryServices/Vaults + */ + @JsonProperty(value = "type") + private String type; + + /* + * Resource name for which availability needs to be checked + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: Resource name for which availability needs to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name for which availability needs to be checked. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityResult.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..7fe09ea79791 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/CheckNameAvailabilityResult.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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: The nameAvailable property. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason property. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The message property. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryDisplay.java new file mode 100644 index 000000000000..b23f032196c2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForLogSpecification.java new file mode 100644 index 000000000000..1125f2db4a8b --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import 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 of the log. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blobs created in customer storage account per hour + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @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: Blobs created in customer storage account per hour. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blobs created in customer storage account per hour. + * + * @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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForProperties.java new file mode 100644 index 000000000000..e24e3c13ef69 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryForServiceSpecification.java new file mode 100644 index 000000000000..ccb0492a4eeb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryResponse.java new file mode 100644 index 000000000000..9c5c78d27838 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.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 the 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 the response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next chunk of the 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryValueForSingleApi.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ClientDiscoveryValueForSingleApi.java new file mode 100644 index 000000000000..2020df67100a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.models.ClientDiscoveryValueForSingleApiInner + * object. + * + * @return the inner object. + */ + ClientDiscoveryValueForSingleApiInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.java new file mode 100644 index 000000000000..e1c30df92c49 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/IdentityData.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity for the resource. */ +@Fluent +public final class IdentityData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityData.class); + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private ResourceIdentityType type; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the IdentityData object itself. + */ + public IdentityData withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model IdentityData")); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.java new file mode 100644 index 000000000000..6b1221a5c5e0 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/JobsSummary.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summary of the replication job data for this vault. */ +@Fluent +public final class JobsSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsSummary.class); + + /* + * Count of failed jobs. + */ + @JsonProperty(value = "failedJobs") + private Integer failedJobs; + + /* + * Count of suspended jobs. + */ + @JsonProperty(value = "suspendedJobs") + private Integer suspendedJobs; + + /* + * Count of in-progress jobs. + */ + @JsonProperty(value = "inProgressJobs") + private Integer inProgressJobs; + + /** + * Get the failedJobs property: Count of failed jobs. + * + * @return the failedJobs value. + */ + public Integer failedJobs() { + return this.failedJobs; + } + + /** + * Set the failedJobs property: Count of failed jobs. + * + * @param failedJobs the failedJobs value to set. + * @return the JobsSummary object itself. + */ + public JobsSummary withFailedJobs(Integer failedJobs) { + this.failedJobs = failedJobs; + return this; + } + + /** + * Get the suspendedJobs property: Count of suspended jobs. + * + * @return the suspendedJobs value. + */ + public Integer suspendedJobs() { + return this.suspendedJobs; + } + + /** + * Set the suspendedJobs property: Count of suspended jobs. + * + * @param suspendedJobs the suspendedJobs value to set. + * @return the JobsSummary object itself. + */ + public JobsSummary withSuspendedJobs(Integer suspendedJobs) { + this.suspendedJobs = suspendedJobs; + return this; + } + + /** + * Get the inProgressJobs property: Count of in-progress jobs. + * + * @return the inProgressJobs value. + */ + public Integer inProgressJobs() { + return this.inProgressJobs; + } + + /** + * Set the inProgressJobs property: Count of in-progress jobs. + * + * @param inProgressJobs the inProgressJobs value to set. + * @return the JobsSummary object itself. + */ + public JobsSummary withInProgressJobs(Integer inProgressJobs) { + this.inProgressJobs = inProgressJobs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java new file mode 100644 index 000000000000..ad31d83e1bbf --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/MonitoringSummary.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summary of the replication monitoring data for this vault. */ +@Fluent +public final class MonitoringSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoringSummary.class); + + /* + * Count of unhealthy VMs. + */ + @JsonProperty(value = "unHealthyVmCount") + private Integer unHealthyVmCount; + + /* + * Count of unhealthy replication providers. + */ + @JsonProperty(value = "unHealthyProviderCount") + private Integer unHealthyProviderCount; + + /* + * Count of all critical warnings. + */ + @JsonProperty(value = "eventsCount") + private Integer eventsCount; + + /* + * Count of all deprecated recovery service providers. + */ + @JsonProperty(value = "deprecatedProviderCount") + private Integer deprecatedProviderCount; + + /* + * Count of all the supported recovery service providers. + */ + @JsonProperty(value = "supportedProviderCount") + private Integer supportedProviderCount; + + /* + * Count of all the unsupported recovery service providers. + */ + @JsonProperty(value = "unsupportedProviderCount") + private Integer unsupportedProviderCount; + + /** + * Get the unHealthyVmCount property: Count of unhealthy VMs. + * + * @return the unHealthyVmCount value. + */ + public Integer unHealthyVmCount() { + return this.unHealthyVmCount; + } + + /** + * Set the unHealthyVmCount property: Count of unhealthy VMs. + * + * @param unHealthyVmCount the unHealthyVmCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withUnHealthyVmCount(Integer unHealthyVmCount) { + this.unHealthyVmCount = unHealthyVmCount; + return this; + } + + /** + * Get the unHealthyProviderCount property: Count of unhealthy replication providers. + * + * @return the unHealthyProviderCount value. + */ + public Integer unHealthyProviderCount() { + return this.unHealthyProviderCount; + } + + /** + * Set the unHealthyProviderCount property: Count of unhealthy replication providers. + * + * @param unHealthyProviderCount the unHealthyProviderCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withUnHealthyProviderCount(Integer unHealthyProviderCount) { + this.unHealthyProviderCount = unHealthyProviderCount; + return this; + } + + /** + * Get the eventsCount property: Count of all critical warnings. + * + * @return the eventsCount value. + */ + public Integer eventsCount() { + return this.eventsCount; + } + + /** + * Set the eventsCount property: Count of all critical warnings. + * + * @param eventsCount the eventsCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withEventsCount(Integer eventsCount) { + this.eventsCount = eventsCount; + return this; + } + + /** + * Get the deprecatedProviderCount property: Count of all deprecated recovery service providers. + * + * @return the deprecatedProviderCount value. + */ + public Integer deprecatedProviderCount() { + return this.deprecatedProviderCount; + } + + /** + * Set the deprecatedProviderCount property: Count of all deprecated recovery service providers. + * + * @param deprecatedProviderCount the deprecatedProviderCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withDeprecatedProviderCount(Integer deprecatedProviderCount) { + this.deprecatedProviderCount = deprecatedProviderCount; + return this; + } + + /** + * Get the supportedProviderCount property: Count of all the supported recovery service providers. + * + * @return the supportedProviderCount value. + */ + public Integer supportedProviderCount() { + return this.supportedProviderCount; + } + + /** + * Set the supportedProviderCount property: Count of all the supported recovery service providers. + * + * @param supportedProviderCount the supportedProviderCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withSupportedProviderCount(Integer supportedProviderCount) { + this.supportedProviderCount = supportedProviderCount; + return this; + } + + /** + * Get the unsupportedProviderCount property: Count of all the unsupported recovery service providers. + * + * @return the unsupportedProviderCount value. + */ + public Integer unsupportedProviderCount() { + return this.unsupportedProviderCount; + } + + /** + * Set the unsupportedProviderCount property: Count of all the unsupported recovery service providers. + * + * @param unsupportedProviderCount the unsupportedProviderCount value to set. + * @return the MonitoringSummary object itself. + */ + public MonitoringSummary withUnsupportedProviderCount(Integer unsupportedProviderCount) { + this.unsupportedProviderCount = unsupportedProviderCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/NameInfo.java new file mode 100644 index 000000000000..6199c06ee638 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.models; + +import 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java new file mode 100644 index 000000000000..103ba94baf33 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.java new file mode 100644 index 000000000000..7375d3bcd66d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchTrackedResource.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tracked resource with location. */ +@Fluent +public class PatchTrackedResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchTrackedResource.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String etag; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the PatchTrackedResource object itself. + */ + public PatchTrackedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PatchTrackedResource object itself. + */ + public PatchTrackedResource withTags(Map tags) { + this.tags = tags; + 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 PatchTrackedResource object itself. + */ + public PatchTrackedResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.java new file mode 100644 index 000000000000..b368d235b9e7 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PatchVault.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.recoveryservices.models; + +import 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; + +/** Patch Resource information, as returned by the resource provider. */ +@Fluent +public final class PatchVault extends PatchTrackedResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PatchVault.class); + + /* + * Properties of the vault. + */ + @JsonProperty(value = "properties") + private VaultProperties properties; + + /* + * Identifies the unique system identifier for each Azure resource. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityData identity; + + /** + * Get the properties property: Properties of the vault. + * + * @return the properties value. + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the vault. + * + * @param properties the properties value to set. + * @return the PatchVault object itself. + */ + public PatchVault withProperties(VaultProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Identifies the unique system identifier for each Azure resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Identifies the unique system identifier for each Azure resource. + * + * @param sku the sku value to set. + * @return the PatchVault object itself. + */ + public PatchVault withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public IdentityData identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the PatchVault object itself. + */ + public PatchVault withIdentity(IdentityData identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchVault withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchVault withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchVault withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.java new file mode 100644 index 000000000000..3acc2d7e435d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpoint.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.recoveryservices.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 Private Endpoint network resource that is linked to the Private Endpoint connection. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Gets or sets id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Gets or sets id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..86ad609ad619 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnection.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.recoveryservices.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; + +/** Private Endpoint Connection Response Properties. */ +@Immutable +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", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The Private Endpoint network resource that is linked to the Private + * Endpoint connection. + */ + @JsonProperty(value = "privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpoint privateEndpoint; + + /* + * Gets or sets private link service connection state. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", access = JsonProperty.Access.WRITE_ONLY) + 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; + } + + /** + * Get the privateEndpoint property: The Private Endpoint network resource that is linked to the Private Endpoint + * connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: Gets or sets private link service connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionStatus.java new file mode 100644 index 000000000000..c185387b54da --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.java new file mode 100644 index 000000000000..c2b291935687 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateEndpointConnectionVaultProperties.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.recoveryservices.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; + +/** Information to be stored in Vault properties as an element of privateEndpointConnections List. */ +@Immutable +public final class PrivateEndpointConnectionVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionVaultProperties.class); + + /* + * Format of id + * subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Private Endpoint Connection Response Properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnection properties; + + /** + * Get the id property: Format of id + * subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the properties property: Private Endpoint Connection Response Properties. + * + * @return the properties value. + */ + public PrivateEndpointConnection properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResource.java new file mode 100644 index 000000000000..b08f7f151fbb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResource.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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: e.g. Microsoft.RecoveryServices/vaults/privateLinkResources. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or + * f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery). + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.java new file mode 100644 index 000000000000..e4648e45f624 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResources.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class which represent the stamps associated with the vault. */ +@Fluent +public final class PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResources.class); + + /* + * A collection of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next chunk of the response + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResources object itself. + */ + public PrivateLinkResources withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next chunk of the response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next chunk of the response. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResources object itself. + */ + public PrivateLinkResources 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.java new file mode 100644 index 000000000000..9f7d5040b29a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkResourcesOperations.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.recoveryservices.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 PrivateLinkResourcesOperations. */ +public interface PrivateLinkResourcesOperations { + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return class which represent the stamps associated with the vault. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Returns the list of private link resources that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 class which represent the stamps associated with the vault. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + PrivateLinkResource get(String resourceGroupName, String vaultName, String privateLinkResourceName); + + /** + * Returns a specified private link resource that need to be created for Backup and SiteRecovery. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param privateLinkResourceName The privateLinkResourceName 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 information of the private link resource. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String privateLinkResourceName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..b02f57cf71b7 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/PrivateLinkServiceConnectionState.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.recoveryservices.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; + +/** Gets or sets private link service connection state. */ +@Immutable +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Gets or sets the status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionStatus status; + + /* + * Gets or sets description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Gets or sets actions required. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the status property: Gets or sets the status. + * + * @return the status value. + */ + public PrivateEndpointConnectionStatus status() { + return this.status; + } + + /** + * Get the description property: Gets or sets description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the actionsRequired property: Gets or sets actions required. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ProvisioningState.java new file mode 100644 index 000000000000..0b7f7560c805 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.java new file mode 100644 index 000000000000..d8eb976c5452 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RawCertificateData.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Raw certificate data. */ +@Fluent +public final class RawCertificateData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RawCertificateData.class); + + /* + * Specifies the authentication type. + */ + @JsonProperty(value = "authType") + private AuthType authType; + + /* + * The base64 encoded certificate raw data string + */ + @JsonProperty(value = "certificate") + private byte[] certificate; + + /** + * Get the authType property: Specifies the authentication type. + * + * @return the authType value. + */ + public AuthType authType() { + return this.authType; + } + + /** + * Set the authType property: Specifies the authentication type. + * + * @param authType the authType value to set. + * @return the RawCertificateData object itself. + */ + public RawCertificateData withAuthType(AuthType authType) { + this.authType = authType; + return this; + } + + /** + * Get the certificate property: The base64 encoded certificate raw data string. + * + * @return the certificate value. + */ + public byte[] certificate() { + return CoreUtils.clone(this.certificate); + } + + /** + * Set the certificate property: The base64 encoded certificate raw data string. + * + * @param certificate the certificate value to set. + * @return the RawCertificateData object itself. + */ + public RawCertificateData withCertificate(byte[] certificate) { + this.certificate = CoreUtils.clone(certificate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.java new file mode 100644 index 000000000000..c3d416a5dcf6 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RecoveryServices.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.recoveryservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RecoveryServices. */ +public interface RecoveryServices { + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + CheckNameAvailabilityResult checkNameAvailability( + String resourceGroupName, String location, CheckNameAvailabilityParameters input); + + /** + * API to check for resource name availability. A name is available if no other resource exists that has the same + * SubscriptionId, Resource Name and Type or if one or more such resources exist, each of these must be GC'd and + * their time of deletion be more than 24 Hours Ago. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param location Location of the resource. + * @param input Resource Name availability input parameters - Resource type and resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for check name availability API. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, String location, CheckNameAvailabilityParameters input, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.java new file mode 100644 index 000000000000..26d4a5608231 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/RegisteredIdentities.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.recoveryservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RegisteredIdentities. */ +public interface RegisteredIdentities { + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vaultName, String identityName); + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param identityName Name of the protection container to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String vaultName, String identityName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsage.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsage.java new file mode 100644 index 000000000000..6bb05e18d333 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsage.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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; + +/** An immutable client-side representation of ReplicationUsage. */ +public interface ReplicationUsage { + /** + * Gets the monitoringSummary property: Summary of the replication monitoring data for this vault. + * + * @return the monitoringSummary value. + */ + MonitoringSummary monitoringSummary(); + + /** + * Gets the jobsSummary property: Summary of the replication jobs data for this vault. + * + * @return the jobsSummary value. + */ + JobsSummary jobsSummary(); + + /** + * Gets the protectedItemCount property: Number of replication protected items for this vault. + * + * @return the protectedItemCount value. + */ + Integer protectedItemCount(); + + /** + * Gets the recoveryPlanCount property: Number of replication recovery plans for this vault. + * + * @return the recoveryPlanCount value. + */ + Integer recoveryPlanCount(); + + /** + * Gets the registeredServersCount property: Number of servers registered to this vault. + * + * @return the registeredServersCount value. + */ + Integer registeredServersCount(); + + /** + * Gets the recoveryServicesProviderAuthType property: The authentication type of recovery service providers in the + * vault. + * + * @return the recoveryServicesProviderAuthType value. + */ + Integer recoveryServicesProviderAuthType(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner object. + * + * @return the inner object. + */ + ReplicationUsageInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.java new file mode 100644 index 000000000000..dfd22ab27dd4 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsageList.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Replication usages for vault. */ +@Fluent +public final class ReplicationUsageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationUsageList.class); + + /* + * The list of replication usages for the given vault. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of replication usages for the given vault. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of replication usages for the given vault. + * + * @param value the value value to set. + * @return the ReplicationUsageList object itself. + */ + public ReplicationUsageList 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.java new file mode 100644 index 000000000000..02184a089e10 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ReplicationUsages.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.recoveryservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ReplicationUsages. */ +public interface ReplicationUsages { + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return replication usages for vault. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Fetches the replication usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 replication usages for vault. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.java new file mode 100644 index 000000000000..d86dc76d5bd8 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAadDetails.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.recoveryservices.models; + +import 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; + +/** Certificate details representing the Vault credentials for AAD. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("AzureActiveDirectory") +@Fluent +public final class ResourceCertificateAndAadDetails extends ResourceCertificateDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateAndAadDetails.class); + + /* + * AAD tenant authority. + */ + @JsonProperty(value = "aadAuthority", required = true) + private String aadAuthority; + + /* + * AAD tenant Id. + */ + @JsonProperty(value = "aadTenantId", required = true) + private String aadTenantId; + + /* + * AAD service principal clientId. + */ + @JsonProperty(value = "servicePrincipalClientId", required = true) + private String servicePrincipalClientId; + + /* + * AAD service principal ObjectId. + */ + @JsonProperty(value = "servicePrincipalObjectId", required = true) + private String servicePrincipalObjectId; + + /* + * Azure Management Endpoint Audience. + */ + @JsonProperty(value = "azureManagementEndpointAudience", required = true) + private String azureManagementEndpointAudience; + + /** + * Get the aadAuthority property: AAD tenant authority. + * + * @return the aadAuthority value. + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Set the aadAuthority property: AAD tenant authority. + * + * @param aadAuthority the aadAuthority value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withAadAuthority(String aadAuthority) { + this.aadAuthority = aadAuthority; + return this; + } + + /** + * Get the aadTenantId property: AAD tenant Id. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: AAD tenant Id. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the servicePrincipalClientId property: AAD service principal clientId. + * + * @return the servicePrincipalClientId value. + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set the servicePrincipalClientId property: AAD service principal clientId. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get the servicePrincipalObjectId property: AAD service principal ObjectId. + * + * @return the servicePrincipalObjectId value. + */ + public String servicePrincipalObjectId() { + return this.servicePrincipalObjectId; + } + + /** + * Set the servicePrincipalObjectId property: AAD service principal ObjectId. + * + * @param servicePrincipalObjectId the servicePrincipalObjectId value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withServicePrincipalObjectId(String servicePrincipalObjectId) { + this.servicePrincipalObjectId = servicePrincipalObjectId; + return this; + } + + /** + * Get the azureManagementEndpointAudience property: Azure Management Endpoint Audience. + * + * @return the azureManagementEndpointAudience value. + */ + public String azureManagementEndpointAudience() { + return this.azureManagementEndpointAudience; + } + + /** + * Set the azureManagementEndpointAudience property: Azure Management Endpoint Audience. + * + * @param azureManagementEndpointAudience the azureManagementEndpointAudience value to set. + * @return the ResourceCertificateAndAadDetails object itself. + */ + public ResourceCertificateAndAadDetails withAzureManagementEndpointAudience( + String azureManagementEndpointAudience) { + this.azureManagementEndpointAudience = azureManagementEndpointAudience; + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withCertificate(byte[] certificate) { + super.withCertificate(certificate); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withIssuer(String issuer) { + super.withIssuer(issuer); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withResourceId(Long resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withSubject(String subject) { + super.withSubject(subject); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withThumbprint(String thumbprint) { + super.withThumbprint(thumbprint); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withValidFrom(OffsetDateTime validFrom) { + super.withValidFrom(validFrom); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAadDetails withValidTo(OffsetDateTime validTo) { + super.withValidTo(validTo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (aadAuthority() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aadAuthority in model ResourceCertificateAndAadDetails")); + } + if (aadTenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aadTenantId in model ResourceCertificateAndAadDetails")); + } + if (servicePrincipalClientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property servicePrincipalClientId in model" + + " ResourceCertificateAndAadDetails")); + } + if (servicePrincipalObjectId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property servicePrincipalObjectId in model" + + " ResourceCertificateAndAadDetails")); + } + if (azureManagementEndpointAudience() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureManagementEndpointAudience in model" + + " ResourceCertificateAndAadDetails")); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java new file mode 100644 index 000000000000..6a48474d3d87 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateAndAcsDetails.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import 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; + +/** Certificate details representing the Vault credentials for ACS. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("AccessControlService") +@Fluent +public final class ResourceCertificateAndAcsDetails extends ResourceCertificateDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateAndAcsDetails.class); + + /* + * ACS namespace name - tenant for our service. + */ + @JsonProperty(value = "globalAcsNamespace", required = true) + private String globalAcsNamespace; + + /* + * Acs mgmt host name to connect to. + */ + @JsonProperty(value = "globalAcsHostName", required = true) + private String globalAcsHostname; + + /* + * Global ACS namespace RP realm. + */ + @JsonProperty(value = "globalAcsRPRealm", required = true) + private String globalAcsRPRealm; + + /** + * Get the globalAcsNamespace property: ACS namespace name - tenant for our service. + * + * @return the globalAcsNamespace value. + */ + public String globalAcsNamespace() { + return this.globalAcsNamespace; + } + + /** + * Set the globalAcsNamespace property: ACS namespace name - tenant for our service. + * + * @param globalAcsNamespace the globalAcsNamespace value to set. + * @return the ResourceCertificateAndAcsDetails object itself. + */ + public ResourceCertificateAndAcsDetails withGlobalAcsNamespace(String globalAcsNamespace) { + this.globalAcsNamespace = globalAcsNamespace; + return this; + } + + /** + * Get the globalAcsHostname property: Acs mgmt host name to connect to. + * + * @return the globalAcsHostname value. + */ + public String globalAcsHostname() { + return this.globalAcsHostname; + } + + /** + * Set the globalAcsHostname property: Acs mgmt host name to connect to. + * + * @param globalAcsHostname the globalAcsHostname value to set. + * @return the ResourceCertificateAndAcsDetails object itself. + */ + public ResourceCertificateAndAcsDetails withGlobalAcsHostname(String globalAcsHostname) { + this.globalAcsHostname = globalAcsHostname; + return this; + } + + /** + * Get the globalAcsRPRealm property: Global ACS namespace RP realm. + * + * @return the globalAcsRPRealm value. + */ + public String globalAcsRPRealm() { + return this.globalAcsRPRealm; + } + + /** + * Set the globalAcsRPRealm property: Global ACS namespace RP realm. + * + * @param globalAcsRPRealm the globalAcsRPRealm value to set. + * @return the ResourceCertificateAndAcsDetails object itself. + */ + public ResourceCertificateAndAcsDetails withGlobalAcsRPRealm(String globalAcsRPRealm) { + this.globalAcsRPRealm = globalAcsRPRealm; + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withCertificate(byte[] certificate) { + super.withCertificate(certificate); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withIssuer(String issuer) { + super.withIssuer(issuer); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withResourceId(Long resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withSubject(String subject) { + super.withSubject(subject); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withThumbprint(String thumbprint) { + super.withThumbprint(thumbprint); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withValidFrom(OffsetDateTime validFrom) { + super.withValidFrom(validFrom); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceCertificateAndAcsDetails withValidTo(OffsetDateTime validTo) { + super.withValidTo(validTo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (globalAcsNamespace() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property globalAcsNamespace in model ResourceCertificateAndAcsDetails")); + } + if (globalAcsHostname() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property globalAcsHostname in model ResourceCertificateAndAcsDetails")); + } + if (globalAcsRPRealm() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property globalAcsRPRealm in model ResourceCertificateAndAcsDetails")); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.java new file mode 100644 index 000000000000..27224c81bf09 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceCertificateDetails.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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; + +/** Certificate details representing the Vault credentials. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "authType", + defaultImpl = ResourceCertificateDetails.class) +@JsonTypeName("ResourceCertificateDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureActiveDirectory", value = ResourceCertificateAndAadDetails.class), + @JsonSubTypes.Type(name = "AccessControlService", value = ResourceCertificateAndAcsDetails.class) +}) +@Fluent +public class ResourceCertificateDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceCertificateDetails.class); + + /* + * The base64 encoded certificate raw data string. + */ + @JsonProperty(value = "certificate") + private byte[] certificate; + + /* + * Certificate friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Certificate issuer. + */ + @JsonProperty(value = "issuer") + private String issuer; + + /* + * Resource ID of the vault. + */ + @JsonProperty(value = "resourceId") + private Long resourceId; + + /* + * Certificate Subject Name. + */ + @JsonProperty(value = "subject") + private String subject; + + /* + * Certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Certificate Validity start Date time. + */ + @JsonProperty(value = "validFrom") + private OffsetDateTime validFrom; + + /* + * Certificate Validity End Date time. + */ + @JsonProperty(value = "validTo") + private OffsetDateTime validTo; + + /** + * Get the certificate property: The base64 encoded certificate raw data string. + * + * @return the certificate value. + */ + public byte[] certificate() { + return CoreUtils.clone(this.certificate); + } + + /** + * Set the certificate property: The base64 encoded certificate raw data string. + * + * @param certificate the certificate value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withCertificate(byte[] certificate) { + this.certificate = CoreUtils.clone(certificate); + return this; + } + + /** + * Get the friendlyName property: Certificate friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Certificate friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the issuer property: Certificate issuer. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: Certificate issuer. + * + * @param issuer the issuer value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the resourceId property: Resource ID of the vault. + * + * @return the resourceId value. + */ + public Long resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the vault. + * + * @param resourceId the resourceId value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withResourceId(Long resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the subject property: Certificate Subject Name. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Certificate Subject Name. + * + * @param subject the subject value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the validFrom property: Certificate Validity start Date time. + * + * @return the validFrom value. + */ + public OffsetDateTime validFrom() { + return this.validFrom; + } + + /** + * Set the validFrom property: Certificate Validity start Date time. + * + * @param validFrom the validFrom value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withValidFrom(OffsetDateTime validFrom) { + this.validFrom = validFrom; + return this; + } + + /** + * Get the validTo property: Certificate Validity End Date time. + * + * @return the validTo value. + */ + public OffsetDateTime validTo() { + return this.validTo; + } + + /** + * Set the validTo property: Certificate Validity End Date time. + * + * @param validTo the validTo value to set. + * @return the ResourceCertificateDetails object itself. + */ + public ResourceCertificateDetails withValidTo(OffsetDateTime validTo) { + this.validTo = validTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.java new file mode 100644 index 000000000000..4b920cd436f8 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/ResourceIdentityType.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceIdentityType. */ +public final class ResourceIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ResourceIdentityType. */ + public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value None for ResourceIdentityType. */ + public static final ResourceIdentityType NONE = fromString("None"); + + /** + * Creates or finds a ResourceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceIdentityType. + */ + @JsonCreator + public static ResourceIdentityType fromString(String name) { + return fromString(name, ResourceIdentityType.class); + } + + /** @return known ResourceIdentityType values. */ + public static Collection values() { + return values(ResourceIdentityType.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.java new file mode 100644 index 000000000000..0f1005b290fb --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Sku.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identifies the unique system identifier for each Azure resource. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The Sku name. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Get the name property: The Sku name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The Sku name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.java new file mode 100644 index 000000000000..d4a00f458f4c --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/SkuName.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value RS0 for SkuName. */ + public static final SkuName RS0 = fromString("RS0"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.java new file mode 100644 index 000000000000..209ca90bdf09 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/TriggerType.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggerType. */ +public final class TriggerType extends ExpandableStringEnum { + /** Static value UserTriggered for TriggerType. */ + public static final TriggerType USER_TRIGGERED = fromString("UserTriggered"); + + /** Static value ForcedUpgrade for TriggerType. */ + public static final TriggerType FORCED_UPGRADE = fromString("ForcedUpgrade"); + + /** + * Creates or finds a TriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerType. + */ + @JsonCreator + public static TriggerType fromString(String name) { + return fromString(name, TriggerType.class); + } + + /** @return known TriggerType values. */ + public static Collection values() { + return values(TriggerType.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java new file mode 100644 index 000000000000..2b3f45a3da0d --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UpgradeDetails.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.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; + +/** Details for upgrading vault. */ +@Immutable +public final class UpgradeDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpgradeDetails.class); + + /* + * ID of the vault upgrade operation. + */ + @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) + private String operationId; + + /* + * UTC time at which the upgrade operation has started. + */ + @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTimeUtc; + + /* + * UTC time at which the upgrade operation status was last updated. + */ + @JsonProperty(value = "lastUpdatedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimeUtc; + + /* + * UTC time at which the upgrade operation has ended. + */ + @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTimeUtc; + + /* + * Status of the vault upgrade operation. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private VaultUpgradeState status; + + /* + * Message to the user containing information about the upgrade operation. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The way the vault upgrade was triggered. + */ + @JsonProperty(value = "triggerType", access = JsonProperty.Access.WRITE_ONLY) + private TriggerType triggerType; + + /* + * Resource ID of the upgraded vault. + */ + @JsonProperty(value = "upgradedResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String upgradedResourceId; + + /* + * Resource ID of the vault before the upgrade. + */ + @JsonProperty(value = "previousResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String previousResourceId; + + /** + * Get the operationId property: ID of the vault upgrade operation. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Get the startTimeUtc property: UTC time at which the upgrade operation has started. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the lastUpdatedTimeUtc property: UTC time at which the upgrade operation status was last updated. + * + * @return the lastUpdatedTimeUtc value. + */ + public OffsetDateTime lastUpdatedTimeUtc() { + return this.lastUpdatedTimeUtc; + } + + /** + * Get the endTimeUtc property: UTC time at which the upgrade operation has ended. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the status property: Status of the vault upgrade operation. + * + * @return the status value. + */ + public VaultUpgradeState status() { + return this.status; + } + + /** + * Get the message property: Message to the user containing information about the upgrade operation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the triggerType property: The way the vault upgrade was triggered. + * + * @return the triggerType value. + */ + public TriggerType triggerType() { + return this.triggerType; + } + + /** + * Get the upgradedResourceId property: Resource ID of the upgraded vault. + * + * @return the upgradedResourceId value. + */ + public String upgradedResourceId() { + return this.upgradedResourceId; + } + + /** + * Get the previousResourceId property: Resource ID of the vault before the upgrade. + * + * @return the previousResourceId value. + */ + public String previousResourceId() { + return this.previousResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.java new file mode 100644 index 000000000000..165dc314f90c --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Usages.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.recoveryservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return usage for vault. + */ + PagedIterable listByVaults(String resourceGroupName, String vaultName); + + /** + * Fetches the usages of the vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 usage for vault. + */ + PagedIterable listByVaults(String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/UsagesUnit.java new file mode 100644 index 000000000000..6359ab5e9a0a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/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.recoveryservices.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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java new file mode 100644 index 000000000000..2f0622fb3095 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vault.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import java.util.Map; + +/** An immutable client-side representation of Vault. */ +public interface Vault { + /** + * 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 identity property: Identity for the resource. + * + * @return the identity value. + */ + IdentityData identity(); + + /** + * Gets the properties property: Properties of the vault. + * + * @return the properties value. + */ + VaultProperties properties(); + + /** + * Gets the sku property: Identifies the unique system identifier for each Azure resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * 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.recoveryservices.fluent.models.VaultInner object. + * + * @return the inner object. + */ + VaultInner innerModel(); + + /** The entirety of the Vault definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Vault definition stages. */ + interface DefinitionStages { + /** The first stage of the Vault definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Vault definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Vault definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Vault definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithProperties, + DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + Vault create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Vault create(Context context); + } + /** The stage of the Vault 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 Vault definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityData identity); + } + /** The stage of the Vault definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the vault.. + * + * @param properties Properties of the vault. + * @return the next definition stage. + */ + WithCreate withProperties(VaultProperties properties); + } + /** The stage of the Vault definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Identifies the unique system identifier for each Azure resource.. + * + * @param sku Identifies the unique system identifier for each Azure resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + /** + * Begins update for the Vault resource. + * + * @return the stage of resource update. + */ + Vault.Update update(); + + /** The template for Vault update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEtag, + UpdateStages.WithProperties, + UpdateStages.WithSku, + UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Vault apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Vault apply(Context context); + } + /** The Vault update stages. */ + interface UpdateStages { + /** The stage of the Vault 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 Vault 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); + } + /** The stage of the Vault update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the vault.. + * + * @param properties Properties of the vault. + * @return the next definition stage. + */ + Update withProperties(VaultProperties properties); + } + /** The stage of the Vault update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Identifies the unique system identifier for each Azure resource.. + * + * @param sku Identifies the unique system identifier for each Azure resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the Vault update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + Update withIdentity(IdentityData identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Vault refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Vault refresh(Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificateResponse.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificateResponse.java new file mode 100644 index 000000000000..974c09e4d8ba --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificateResponse.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner; + +/** An immutable client-side representation of VaultCertificateResponse. */ +public interface VaultCertificateResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Certificate details representing the Vault credentials. + * + * @return the properties value. + */ + ResourceCertificateDetails properties(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.VaultCertificateResponseInner object. + * + * @return the inner object. + */ + VaultCertificateResponseInner innerModel(); + + /** The entirety of the VaultCertificateResponse definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VaultCertificateResponse definition stages. */ + interface DefinitionStages { + /** The first stage of the VaultCertificateResponse definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VaultCertificateResponse definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceGroupName, String vaultName); + } + /** + * The stage of the VaultCertificateResponse definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + VaultCertificateResponse create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VaultCertificateResponse create(Context context); + } + /** The stage of the VaultCertificateResponse definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Raw certificate data.. + * + * @param properties Raw certificate data. + * @return the next definition stage. + */ + WithCreate withProperties(RawCertificateData properties); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificates.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificates.java new file mode 100644 index 000000000000..5c16c1106185 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultCertificates.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +/** Resource collection API of VaultCertificates. */ +public interface VaultCertificates { + /** + * Begins definition for a new VaultCertificateResponse resource. + * + * @param name resource name. + * @return the first stage of the new VaultCertificateResponse definition. + */ + VaultCertificateResponse.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.java new file mode 100644 index 000000000000..a4ea1b0bbea7 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoResource.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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; + +/** An immutable client-side representation of VaultExtendedInfoResource. */ +public interface VaultExtendedInfoResource { + /** + * 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 integrityKey property: Integrity key. + * + * @return the integrityKey value. + */ + String integrityKey(); + + /** + * Gets the encryptionKey property: Encryption key. + * + * @return the encryptionKey value. + */ + String encryptionKey(); + + /** + * Gets the encryptionKeyThumbprint property: Encryption key thumbprint. + * + * @return the encryptionKeyThumbprint value. + */ + String encryptionKeyThumbprint(); + + /** + * Gets the algorithm property: Algorithm for Vault ExtendedInfo. + * + * @return the algorithm value. + */ + String algorithm(); + + /** + * Gets the etag property: Optional ETag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner object. + * + * @return the inner object. + */ + VaultExtendedInfoResourceInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java new file mode 100644 index 000000000000..c8a9e79b45d6 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultExtendedInfoes.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.recoveryservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultExtendedInfoResourceInner; + +/** Resource collection API of VaultExtendedInfoes. */ +public interface VaultExtendedInfoes { + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return the vault extended info. + */ + VaultExtendedInfoResource get(String resourceGroupName, String vaultName); + + /** + * Get the vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 vault extended info. + */ + Response getWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + VaultExtendedInfoResource createOrUpdate( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails); + + /** + * Create vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context); + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + VaultExtendedInfoResource update( + String resourceGroupName, String vaultName, VaultExtendedInfoResourceInner resourceExtendedInfoDetails); + + /** + * Update vault extended info. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of the recovery services vault. + * @param resourceExtendedInfoDetails Vault extended information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vault extended information. + */ + Response updateWithResponse( + String resourceGroupName, + String vaultName, + VaultExtendedInfoResourceInner resourceExtendedInfoDetails, + Context context); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.java new file mode 100644 index 000000000000..6767721ed238 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultList.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response model for a list of Vaults. */ +@Fluent +public final class VaultList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultList.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the VaultList object itself. + */ + public VaultList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.java new file mode 100644 index 000000000000..763efbdac76f --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultPrivateEndpointState.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VaultPrivateEndpointState. */ +public final class VaultPrivateEndpointState extends ExpandableStringEnum { + /** Static value None for VaultPrivateEndpointState. */ + public static final VaultPrivateEndpointState NONE = fromString("None"); + + /** Static value Enabled for VaultPrivateEndpointState. */ + public static final VaultPrivateEndpointState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a VaultPrivateEndpointState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VaultPrivateEndpointState. + */ + @JsonCreator + public static VaultPrivateEndpointState fromString(String name) { + return fromString(name, VaultPrivateEndpointState.class); + } + + /** @return known VaultPrivateEndpointState values. */ + public static Collection values() { + return values(VaultPrivateEndpointState.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.java new file mode 100644 index 000000000000..a094519381c2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultProperties.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.recoveryservices.models; + +import 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; + +/** Properties of the vault. */ +@Fluent +public final class VaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultProperties.class); + + /* + * Provisioning State. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Details for upgrading vault. + */ + @JsonProperty(value = "upgradeDetails") + private UpgradeDetails upgradeDetails; + + /* + * List of private endpoint connection. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Private endpoint state for backup. + */ + @JsonProperty(value = "privateEndpointStateForBackup", access = JsonProperty.Access.WRITE_ONLY) + private VaultPrivateEndpointState privateEndpointStateForBackup; + + /* + * Private endpoint state for site recovery. + */ + @JsonProperty(value = "privateEndpointStateForSiteRecovery", access = JsonProperty.Access.WRITE_ONLY) + private VaultPrivateEndpointState privateEndpointStateForSiteRecovery; + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the upgradeDetails property: Details for upgrading vault. + * + * @return the upgradeDetails value. + */ + public UpgradeDetails upgradeDetails() { + return this.upgradeDetails; + } + + /** + * Set the upgradeDetails property: Details for upgrading vault. + * + * @param upgradeDetails the upgradeDetails value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withUpgradeDetails(UpgradeDetails upgradeDetails) { + this.upgradeDetails = upgradeDetails; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the privateEndpointStateForBackup property: Private endpoint state for backup. + * + * @return the privateEndpointStateForBackup value. + */ + public VaultPrivateEndpointState privateEndpointStateForBackup() { + return this.privateEndpointStateForBackup; + } + + /** + * Get the privateEndpointStateForSiteRecovery property: Private endpoint state for site recovery. + * + * @return the privateEndpointStateForSiteRecovery value. + */ + public VaultPrivateEndpointState privateEndpointStateForSiteRecovery() { + return this.privateEndpointStateForSiteRecovery; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradeDetails() != null) { + upgradeDetails().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.java new file mode 100644 index 000000000000..dbc846dbaad2 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUpgradeState.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.recoveryservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VaultUpgradeState. */ +public final class VaultUpgradeState extends ExpandableStringEnum { + /** Static value Unknown for VaultUpgradeState. */ + public static final VaultUpgradeState UNKNOWN = fromString("Unknown"); + + /** Static value InProgress for VaultUpgradeState. */ + public static final VaultUpgradeState IN_PROGRESS = fromString("InProgress"); + + /** Static value Upgraded for VaultUpgradeState. */ + public static final VaultUpgradeState UPGRADED = fromString("Upgraded"); + + /** Static value Failed for VaultUpgradeState. */ + public static final VaultUpgradeState FAILED = fromString("Failed"); + + /** + * Creates or finds a VaultUpgradeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VaultUpgradeState. + */ + @JsonCreator + public static VaultUpgradeState fromString(String name) { + return fromString(name, VaultUpgradeState.class); + } + + /** @return known VaultUpgradeState values. */ + public static Collection values() { + return values(VaultUpgradeState.class); + } +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsage.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsage.java new file mode 100644 index 000000000000..29742d9a120a --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsage.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.recoveryservices.models; + +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of VaultUsage. */ +public interface VaultUsage { + /** + * 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.recoveryservices.fluent.models.VaultUsageInner object. + * + * @return the inner object. + */ + VaultUsageInner innerModel(); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.java new file mode 100644 index 000000000000..0ae89c92a262 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/VaultUsageList.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.recoveryservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservices.fluent.models.VaultUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Usage for vault. */ +@Fluent +public final class VaultUsageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultUsageList.class); + + /* + * The list of usages for the given vault. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of usages for the given vault. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of usages for the given vault. + * + * @param value the value value to set. + * @return the VaultUsageList object itself. + */ + public VaultUsageList 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/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.java new file mode 100644 index 000000000000..b2051bd610af --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/Vaults.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.recoveryservices.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 Vaults. */ +public interface Vaults { + /** + * Fetches all the resources of the specified type in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + PagedIterable list(); + + /** + * Fetches all the resources of the specified type in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response model for a list of Vaults. + */ + PagedIterable list(Context context); + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve a list of Vaults. + * + * @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 model for a list of Vaults. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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. + * @return the Vault details. + */ + Vault getByResourceGroup(String resourceGroupName, String vaultName); + + /** + * Get the Vault details. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 Vault details. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 delete(String resourceGroupName, String vaultName); + + /** + * Deletes a vault. + * + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param vaultName The name of 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 deleteWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * Get the Vault details. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Vault details. + */ + Vault getById(String id); + + /** + * Get the Vault details. + * + * @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 Vault details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a 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. + */ + void deleteById(String id); + + /** + * Deletes a 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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Vault resource. + * + * @param name resource name. + * @return the first stage of the new Vault definition. + */ + Vault.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/package-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/package-info.java new file mode 100644 index 000000000000..88b52f18357e --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for RecoveryServicesManagementClient. Recovery Services Client. */ +package com.azure.resourcemanager.recoveryservices.models; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/package-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/package-info.java new file mode 100644 index 000000000000..a8efeaa9e637 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for RecoveryServicesManagementClient. Recovery Services Client. */ +package com.azure.resourcemanager.recoveryservices; diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/module-info.java new file mode 100644 index 000000000000..fd875b32b968 --- /dev/null +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/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.recoveryservices { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.recoveryservices; + exports com.azure.resourcemanager.recoveryservices.fluent; + exports com.azure.resourcemanager.recoveryservices.fluent.models; + exports com.azure.resourcemanager.recoveryservices.models; + + opens com.azure.resourcemanager.recoveryservices.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.recoveryservices.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/recoveryservices/ci.yml b/sdk/recoveryservices/ci.yml new file mode 100644 index 000000000000..fc03cba8bcf5 --- /dev/null +++ b/sdk/recoveryservices/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/recoveryservices/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservices + Artifacts: + - name: azure-resourcemanager-recoveryservices + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerrecoveryservices diff --git a/sdk/recoveryservices/pom.xml b/sdk/recoveryservices/pom.xml new file mode 100644 index 000000000000..bf004857a1e5 --- /dev/null +++ b/sdk/recoveryservices/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-recoveryservices-service + pom + 1.0.0 + + azure-resourcemanager-recoveryservices + +