Skip to content

Commit

Permalink
CodeGen from PR 18588 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 84105ef4e3ceba538a1901055ae1f430207d4449 into f8811b7dd784712c3fb0941e04d9042f59a4d367
  • Loading branch information
SDKAuto committed Apr 7, 2022
1 parent ebe60c2 commit 89c31d3
Show file tree
Hide file tree
Showing 120 changed files with 7,832 additions and 784 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-04-07)

- Azure Resource Manager AzureArcData client library for Java. This package contains Microsoft Azure SDK for AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03. 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
4 changes: 2 additions & 2 deletions sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager AzureArcData client library for Java.

This package contains Microsoft Azure SDK for AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-2021-08-01. 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 AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03. 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-azurearcdata</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
383 changes: 359 additions & 24 deletions sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md

Large diffs are not rendered by default.

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

<name>Microsoft Azure SDK for AzureArcData Management</name>
<description>This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-2021-08-01.</description>
<description>This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand All @@ -21,20 +22,25 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.azurearcdata.fluent.AzureArcDataManagementClient;
import com.azure.resourcemanager.azurearcdata.implementation.ActiveDirectoryConnectorsImpl;
import com.azure.resourcemanager.azurearcdata.implementation.AzureArcDataManagementClientBuilder;
import com.azure.resourcemanager.azurearcdata.implementation.DataControllersImpl;
import com.azure.resourcemanager.azurearcdata.implementation.OperationsImpl;
import com.azure.resourcemanager.azurearcdata.implementation.PostgresInstancesImpl;
import com.azure.resourcemanager.azurearcdata.implementation.SqlManagedInstancesImpl;
import com.azure.resourcemanager.azurearcdata.implementation.SqlServerInstancesImpl;
import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectors;
import com.azure.resourcemanager.azurearcdata.models.DataControllers;
import com.azure.resourcemanager.azurearcdata.models.Operations;
import com.azure.resourcemanager.azurearcdata.models.PostgresInstances;
import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstances;
import com.azure.resourcemanager.azurearcdata.models.SqlServerInstances;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful set of web APIs to manage
Expand All @@ -49,6 +55,10 @@ public final class AzureArcDataManager {

private DataControllers dataControllers;

private ActiveDirectoryConnectors activeDirectoryConnectors;

private PostgresInstances postgresInstances;

private final AzureArcDataManagementClient clientObject;

private AzureArcDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Expand Down Expand Up @@ -87,7 +97,7 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -161,9 +171,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -185,7 +197,7 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.azurearcdata")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -208,11 +220,24 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
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);
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 =
Expand Down Expand Up @@ -256,6 +281,23 @@ public DataControllers dataControllers() {
return dataControllers;
}

/** @return Resource collection API of ActiveDirectoryConnectors. */
public ActiveDirectoryConnectors activeDirectoryConnectors() {
if (this.activeDirectoryConnectors == null) {
this.activeDirectoryConnectors =
new ActiveDirectoryConnectorsImpl(clientObject.getActiveDirectoryConnectors(), this);
}
return activeDirectoryConnectors;
}

/** @return Resource collection API of PostgresInstances. */
public PostgresInstances postgresInstances() {
if (this.postgresInstances == null) {
this.postgresInstances = new PostgresInstancesImpl(clientObject.getPostgresInstances(), this);
}
return postgresInstances;
}

/**
* @return Wrapped service client AzureArcDataManagementClient providing direct access to the underlying
* auto-generated API implementation, based on Azure REST API.
Expand Down
Loading

0 comments on commit 89c31d3

Please sign in to comment.