Skip to content

Commit

Permalink
CodeGen from PR 30292 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 6bac0f4dbcfc991421131ede5f55b1e875eb5a26 into 30d040e41a4cea0d31a6c7e56726ea2df17fdcc5
  • Loading branch information
SDKAuto committed Aug 26, 2024
1 parent 6a1dcab commit f40c999
Show file tree
Hide file tree
Showing 212 changed files with 13,554 additions and 8,407 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2024-08-26)

- Azure Resource Manager Workloads Sap Virtual Instance client library for Java. This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. Package tag package-2024-09. 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 Workloads Sap Virtual Instance client library for Java.

This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. Package tag package-preview-2023-10. 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 Workloads Sap Virtual Instance Management SDK. Workloads client provides access to various workload operations. Package tag package-2024-09. 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-workloadssapvirtualinstance</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.

- `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.
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated using the following code:
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[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_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Expand Down
2,894 changes: 1,713 additions & 1,181 deletions ...ssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/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 Workloads Sap Virtual Instance Management</name>
<description>This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Workloads client provides access to various workload operations. Package tag package-preview-2023-10.</description>
<description>This package contains Microsoft Azure SDK for Workloads Sap Virtual Instance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Workloads client provides access to various workload operations. Package tag package-2024-09.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -48,6 +48,11 @@
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</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 All @@ -25,16 +25,14 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.workloadssapvirtualinstance.fluent.WorkloadsClient;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.OperationsImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.ResourceProvidersImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapApplicationServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapCentralInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapCentralServerInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapDatabaseInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.SapVirtualInstancesImpl;
import com.azure.resourcemanager.workloadssapvirtualinstance.implementation.WorkloadsClientBuilder;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.Operations;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.ResourceProviders;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapApplicationServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapCentralServerInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapDatabaseInstances;
import com.azure.resourcemanager.workloadssapvirtualinstance.models.SapVirtualInstances;
import java.time.Duration;
Expand All @@ -49,15 +47,13 @@
* Workloads client provides access to various workload operations.
*/
public final class WorkloadsSapVirtualInstanceManager {
private ResourceProviders resourceProviders;

private SapVirtualInstances sapVirtualInstances;

private SapCentralInstances sapCentralInstances;
private SapApplicationServerInstances sapApplicationServerInstances;

private SapDatabaseInstances sapDatabaseInstances;
private SapCentralServerInstances sapCentralServerInstances;

private SapApplicationServerInstances sapApplicationServerInstances;
private SapDatabaseInstances sapDatabaseInstances;

private Operations operations;

Expand All @@ -68,8 +64,10 @@ private WorkloadsSapVirtualInstanceManager(HttpPipeline httpPipeline, AzureProfi
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject = new WorkloadsClientBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval).buildClient();
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
.buildClient();
}

/**
Expand Down Expand Up @@ -221,12 +219,19 @@ public WorkloadsSapVirtualInstanceManager authenticate(TokenCredential credentia
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java").append("-")
.append("com.azure.resourcemanager.workloadssapvirtualinstance").append("/").append("1.0.0-beta.1");
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.workloadssapvirtualinstance")
.append("/")
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")
.append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)");
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.name"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.version"))
.append("; auto-generated)");
} else {
userAgentBuilder.append(" (auto-generated)");
}
Expand All @@ -245,34 +250,25 @@ public WorkloadsSapVirtualInstanceManager authenticate(TokenCredential credentia
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)
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()));
.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();
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
return new WorkloadsSapVirtualInstanceManager(httpPipeline, profile, defaultPollInterval);
}
}

/**
* Gets the resource collection API of ResourceProviders.
*
* @return Resource collection API of ResourceProviders.
*/
public ResourceProviders resourceProviders() {
if (this.resourceProviders == null) {
this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
}
return resourceProviders;
}

/**
* Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance.
*
Expand All @@ -286,40 +282,41 @@ public SapVirtualInstances sapVirtualInstances() {
}

/**
* Gets the resource collection API of SapCentralInstances. It manages SapCentralServerInstance.
* Gets the resource collection API of SapApplicationServerInstances. It manages SapApplicationServerInstance.
*
* @return Resource collection API of SapCentralInstances.
* @return Resource collection API of SapApplicationServerInstances.
*/
public SapCentralInstances sapCentralInstances() {
if (this.sapCentralInstances == null) {
this.sapCentralInstances = new SapCentralInstancesImpl(clientObject.getSapCentralInstances(), this);
public SapApplicationServerInstances sapApplicationServerInstances() {
if (this.sapApplicationServerInstances == null) {
this.sapApplicationServerInstances
= new SapApplicationServerInstancesImpl(clientObject.getSapApplicationServerInstances(), this);
}
return sapCentralInstances;
return sapApplicationServerInstances;
}

/**
* Gets the resource collection API of SapDatabaseInstances. It manages SapDatabaseInstance.
* Gets the resource collection API of SapCentralServerInstances. It manages SapCentralServerInstance.
*
* @return Resource collection API of SapDatabaseInstances.
* @return Resource collection API of SapCentralServerInstances.
*/
public SapDatabaseInstances sapDatabaseInstances() {
if (this.sapDatabaseInstances == null) {
this.sapDatabaseInstances = new SapDatabaseInstancesImpl(clientObject.getSapDatabaseInstances(), this);
public SapCentralServerInstances sapCentralServerInstances() {
if (this.sapCentralServerInstances == null) {
this.sapCentralServerInstances
= new SapCentralServerInstancesImpl(clientObject.getSapCentralServerInstances(), this);
}
return sapDatabaseInstances;
return sapCentralServerInstances;
}

/**
* Gets the resource collection API of SapApplicationServerInstances. It manages SapApplicationServerInstance.
* Gets the resource collection API of SapDatabaseInstances. It manages SapDatabaseInstance.
*
* @return Resource collection API of SapApplicationServerInstances.
* @return Resource collection API of SapDatabaseInstances.
*/
public SapApplicationServerInstances sapApplicationServerInstances() {
if (this.sapApplicationServerInstances == null) {
this.sapApplicationServerInstances
= new SapApplicationServerInstancesImpl(clientObject.getSapApplicationServerInstances(), this);
public SapDatabaseInstances sapDatabaseInstances() {
if (this.sapDatabaseInstances == null) {
this.sapDatabaseInstances = new SapDatabaseInstancesImpl(clientObject.getSapDatabaseInstances(), this);
}
return sapApplicationServerInstances;
return sapDatabaseInstances;
}

/**
Expand Down
Loading

0 comments on commit f40c999

Please sign in to comment.