Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-chaos] move common type definition to pick up from latest official typing file #10321

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/chaos/azure-resourcemanager-chaos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.2.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2024-04-26)

- Azure Resource Manager Chaos client library for Java. This package contains Microsoft Azure SDK for Chaos Management SDK. Chaos Management Client. Package tag package-preview-2024-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/chaos/azure-resourcemanager-chaos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager Chaos client library for Java.

This package contains Microsoft Azure SDK for Chaos Management SDK. Chaos Management Client. Package tag package-2024-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 Chaos Management SDK. Chaos Management Client. Package tag package-preview-2024-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-chaos</artifactId>
<version>1.1.0</version>
<version>1.2.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
472 changes: 378 additions & 94 deletions sdk/chaos/azure-resourcemanager-chaos/SAMPLE.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion sdk/chaos/azure-resourcemanager-chaos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Chaos Management</name>
<description>This package contains Microsoft Azure SDK for Chaos Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Chaos Management Client. Package tag package-2024-01.</description>
<description>This package contains Microsoft Azure SDK for Chaos Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Chaos Management Client. Package tag package-preview-2024-03.</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
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 @@ -28,17 +28,19 @@
import com.azure.resourcemanager.chaos.implementation.CapabilityTypesImpl;
import com.azure.resourcemanager.chaos.implementation.ChaosManagementClientBuilder;
import com.azure.resourcemanager.chaos.implementation.ExperimentsImpl;
import com.azure.resourcemanager.chaos.implementation.OperationStatusesImpl;
import com.azure.resourcemanager.chaos.implementation.OperationsImpl;
import com.azure.resourcemanager.chaos.implementation.TargetTypesImpl;
import com.azure.resourcemanager.chaos.implementation.OperationStatusesImpl;
import com.azure.resourcemanager.chaos.implementation.PrivateAccessesImpl;
import com.azure.resourcemanager.chaos.implementation.TargetsImpl;
import com.azure.resourcemanager.chaos.implementation.TargetTypesImpl;
import com.azure.resourcemanager.chaos.models.Capabilities;
import com.azure.resourcemanager.chaos.models.CapabilityTypes;
import com.azure.resourcemanager.chaos.models.Experiments;
import com.azure.resourcemanager.chaos.models.OperationStatuses;
import com.azure.resourcemanager.chaos.models.Operations;
import com.azure.resourcemanager.chaos.models.TargetTypes;
import com.azure.resourcemanager.chaos.models.OperationStatuses;
import com.azure.resourcemanager.chaos.models.PrivateAccesses;
import com.azure.resourcemanager.chaos.models.Targets;
import com.azure.resourcemanager.chaos.models.TargetTypes;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
Expand All @@ -61,6 +63,8 @@ public final class ChaosManager {

private Operations operations;

private PrivateAccesses privateAccesses;

private TargetTypes targetTypes;

private Targets targets;
Expand All @@ -71,8 +75,10 @@ private ChaosManager(HttpPipeline httpPipeline, AzureProfile profile, Duration d
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject = new ChaosManagementClientBuilder().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 @@ -223,12 +229,19 @@ public ChaosManager authenticate(TokenCredential credential, AzureProfile profil
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.chaos").append("/")
.append("1.1.0");
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.chaos")
.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 @@ -247,18 +260,21 @@ public ChaosManager authenticate(TokenCredential credential, AzureProfile profil
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 ChaosManager(httpPipeline, profile, defaultPollInterval);
}
}
Expand Down Expand Up @@ -323,6 +339,18 @@ public Operations operations() {
return operations;
}

/**
* Gets the resource collection API of PrivateAccesses. It manages PrivateAccess.
*
* @return Resource collection API of PrivateAccesses.
*/
public PrivateAccesses privateAccesses() {
if (this.privateAccesses == null) {
this.privateAccesses = new PrivateAccessesImpl(clientObject.getPrivateAccesses(), this);
}
return privateAccesses;
}

/**
* Gets the resource collection API of TargetTypes.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ public interface ChaosManagementClient {
*/
OperationsClient getOperations();

/**
* Gets the PrivateAccessesClient object to access its operations.
*
* @return the PrivateAccessesClient object.
*/
PrivateAccessesClient getPrivateAccesses();

/**
* Gets the TargetTypesClient object to access its operations.
*
Expand Down
Loading