Skip to content

Commit

Permalink
CodeGen from PR 28597 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 35ebfaae55a54b5afb705f3b735991b0631f0176 into 2897e4040dd3d922061ae55bc002358aeaded619
  • Loading branch information
SDKAuto committed Apr 16, 2024
1 parent a39f3d7 commit 3b9887a
Show file tree
Hide file tree
Showing 243 changed files with 4,730 additions and 6,757 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.3.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2024-04-16)

- Azure Resource Manager RecoveryServices client library for Java. This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager RecoveryServices client library for Java.

This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for RecoveryServices Management SDK. Recovery Services Client. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-recoveryservices</artifactId>
<version>1.2.0</version>
<version>1.3.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.
By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand Down Expand Up @@ -113,7 +113,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://docs.microsoft.com/java/azure/jdk/
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
Expand Down
644 changes: 340 additions & 304 deletions sdk/recoveryservices/azure-resourcemanager-recoveryservices/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for RecoveryServices Management</name>
<description>This package contains Microsoft Azure SDK for RecoveryServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Recovery Services Client. Package tag package-2023-04.</description>
<description>This package contains Microsoft Azure SDK for RecoveryServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Recovery Services Client. Package tag package-2024-04.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -45,6 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -87,8 +88,6 @@
<version>4.11.0</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
<scope>test</scope>
</dependency>
<!-- bytebuddy dependencies are required for mockito 4.11.0 to work with Java 21. Mockito 4.11.0 is the last release -->
<!-- of Mockito supporting Java 8 as a baseline. -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
Expand Down Expand Up @@ -52,7 +52,10 @@
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to RecoveryServicesManager. Recovery Services Client. */
/**
* Entry point to RecoveryServicesManager.
* Recovery Services Client.
*/
public final class RecoveryServicesManager {
private VaultCertificates vaultCertificates;

Expand All @@ -79,18 +82,16 @@ public final class RecoveryServicesManager {
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();
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.
Expand All @@ -103,7 +104,7 @@ public static RecoveryServicesManager authenticate(TokenCredential credential, A

/**
* Creates an instance of RecoveryServices service API entry point.
*
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the RecoveryServices service API instance.
Expand All @@ -116,14 +117,16 @@ public static RecoveryServicesManager authenticate(HttpPipeline httpPipeline, Az

/**
* 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. */
/**
* The Configurable allowing configurations to be set.
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

Expand Down Expand Up @@ -195,8 +198,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
* <p>
* This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
Expand All @@ -213,8 +216,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
this.defaultPollInterval
= Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
Expand All @@ -234,15 +237,13 @@ public RecoveryServicesManager authenticate(TokenCredential credential, AzurePro
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder
.append("azsdk-java")
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.recoveryservices")
.append("/")
.append("1.2.0");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.name"))
Expand All @@ -267,38 +268,28 @@ public RecoveryServicesManager authenticate(TokenCredential credential, AzurePro
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
new HttpPipelineBuilder()
.httpClient(httpClient)
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
return new RecoveryServicesManager(httpPipeline, profile, defaultPollInterval);
}
}

/**
* Gets the resource collection API of VaultCertificates. It manages VaultCertificateResponse.
*
*
* @return Resource collection API of VaultCertificates.
*/
public VaultCertificates vaultCertificates() {
Expand All @@ -310,7 +301,7 @@ public VaultCertificates vaultCertificates() {

/**
* Gets the resource collection API of RegisteredIdentities.
*
*
* @return Resource collection API of RegisteredIdentities.
*/
public RegisteredIdentities registeredIdentities() {
Expand All @@ -322,7 +313,7 @@ public RegisteredIdentities registeredIdentities() {

/**
* Gets the resource collection API of ReplicationUsages.
*
*
* @return Resource collection API of ReplicationUsages.
*/
public ReplicationUsages replicationUsages() {
Expand All @@ -334,20 +325,20 @@ public ReplicationUsages replicationUsages() {

/**
* Gets the resource collection API of PrivateLinkResourcesOperations.
*
*
* @return Resource collection API of PrivateLinkResourcesOperations.
*/
public PrivateLinkResourcesOperations privateLinkResourcesOperations() {
if (this.privateLinkResourcesOperations == null) {
this.privateLinkResourcesOperations =
new PrivateLinkResourcesOperationsImpl(clientObject.getPrivateLinkResourcesOperations(), this);
this.privateLinkResourcesOperations
= new PrivateLinkResourcesOperationsImpl(clientObject.getPrivateLinkResourcesOperations(), this);
}
return privateLinkResourcesOperations;
}

/**
* Gets the resource collection API of RecoveryServices.
*
*
* @return Resource collection API of RecoveryServices.
*/
public RecoveryServices recoveryServices() {
Expand All @@ -359,7 +350,7 @@ public RecoveryServices recoveryServices() {

/**
* Gets the resource collection API of Vaults. It manages Vault.
*
*
* @return Resource collection API of Vaults.
*/
public Vaults vaults() {
Expand All @@ -371,7 +362,7 @@ public Vaults vaults() {

/**
* Gets the resource collection API of Operations.
*
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
Expand All @@ -383,7 +374,7 @@ public Operations operations() {

/**
* Gets the resource collection API of VaultExtendedInfoes.
*
*
* @return Resource collection API of VaultExtendedInfoes.
*/
public VaultExtendedInfoes vaultExtendedInfoes() {
Expand All @@ -395,7 +386,7 @@ public VaultExtendedInfoes vaultExtendedInfoes() {

/**
* Gets the resource collection API of ResourceProviders.
*
*
* @return Resource collection API of ResourceProviders.
*/
public ResourceProviders resourceProviders() {
Expand All @@ -407,7 +398,7 @@ public ResourceProviders resourceProviders() {

/**
* Gets the resource collection API of Usages.
*
*
* @return Resource collection API of Usages.
*/
public Usages usages() {
Expand All @@ -420,7 +411,7 @@ public Usages usages() {
/**
* Gets wrapped service client RecoveryServicesManagementClient providing direct access to the underlying
* auto-generated API implementation, based on Azure REST API.
*
*
* @return Wrapped service client RecoveryServicesManagementClient.
*/
public RecoveryServicesManagementClient serviceClient() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,30 @@
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. */
/**
* 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 as paginated response with {@link
* PagedIterable}.
* @return operations List response which contains list of available APIs as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ClientDiscoveryValueForSingleApiInner> 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 as paginated response with {@link
* PagedIterable}.
* @return operations List response which contains list of available APIs as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ClientDiscoveryValueForSingleApiInner> list(Context context);
Expand Down
Loading

0 comments on commit 3b9887a

Please sign in to comment.