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-newrelicobservability] Adding new version 2024-01-01-preview for updating monitor Properties #9072

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2024-01-19)

- Azure Resource Manager NewRelicObservability client library for Java. This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2024-01-01-preview. 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 NewRelicObservability client library for Java.

This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2022-07-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 NewRelicObservability Management SDK. Package tag package-2024-01-01-preview. 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-newrelicobservability</artifactId>
<version>1.0.0</version>
<version>1.1.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 @@ -94,7 +94,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 All @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fnewrelicobservability%2Fazure-resourcemanager-newrelicobservability%2FREADME.png)

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 NewRelicObservability Management</name>
<description>This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-07-01.</description>
<description>This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-01-01-preview.</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 @@ -25,13 +25,19 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.newrelicobservability.fluent.NewRelicObservability;
import com.azure.resourcemanager.newrelicobservability.implementation.AccountsImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.MonitorsImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.NewRelicObservabilityBuilder;
import com.azure.resourcemanager.newrelicobservability.implementation.OperationsImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.PlansImpl;
import com.azure.resourcemanager.newrelicobservability.implementation.TagRulesImpl;
import com.azure.resourcemanager.newrelicobservability.models.Accounts;
import com.azure.resourcemanager.newrelicobservability.models.BillingInfoes;
import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResources;
import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptions;
import com.azure.resourcemanager.newrelicobservability.models.Monitors;
import com.azure.resourcemanager.newrelicobservability.models.Operations;
import com.azure.resourcemanager.newrelicobservability.models.Organizations;
Expand All @@ -44,7 +50,9 @@
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to NewRelicObservabilityManager. */
/**
* Entry point to NewRelicObservabilityManager.
*/
public final class NewRelicObservabilityManager {
private Operations operations;

Expand All @@ -56,26 +64,28 @@ public final class NewRelicObservabilityManager {

private Plans plans;

private BillingInfoes billingInfoes;

private ConnectedPartnerResources connectedPartnerResources;

private TagRules tagRules;

private MonitoredSubscriptions monitoredSubscriptions;

private final NewRelicObservability clientObject;

private NewRelicObservabilityManager(
HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
private NewRelicObservabilityManager(HttpPipeline httpPipeline, AzureProfile profile,
Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject =
new NewRelicObservabilityBuilder()
.pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
.buildClient();
this.clientObject = new NewRelicObservabilityBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval).buildClient();
}

/**
* Creates an instance of NewRelicObservability service API entry point.
*
*
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the NewRelicObservability service API instance.
Expand All @@ -88,7 +98,7 @@ public static NewRelicObservabilityManager authenticate(TokenCredential credenti

/**
* Creates an instance of NewRelicObservability service API entry point.
*
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the NewRelicObservability service API instance.
Expand All @@ -101,14 +111,16 @@ public static NewRelicObservabilityManager authenticate(HttpPipeline httpPipelin

/**
* Gets a Configurable instance that can be used to create NewRelicObservabilityManager with optional configuration.
*
*
* @return the Configurable instance allowing configurations.
*/
public static Configurable configure() {
return new NewRelicObservabilityManager.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 @@ -180,8 +192,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 @@ -198,8 +210,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 @@ -219,21 +231,12 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder
.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.newrelicobservability")
.append("/")
.append("1.0.0");
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.newrelicobservability")
.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 @@ -252,38 +255,25 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu
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 NewRelicObservabilityManager(httpPipeline, profile, defaultPollInterval);
}
}

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

/**
* Gets the resource collection API of Accounts.
*
*
* @return Resource collection API of Accounts.
*/
public Accounts accounts() {
Expand All @@ -307,7 +297,7 @@ public Accounts accounts() {

/**
* Gets the resource collection API of Monitors. It manages NewRelicMonitorResource.
*
*
* @return Resource collection API of Monitors.
*/
public Monitors monitors() {
Expand All @@ -319,7 +309,7 @@ public Monitors monitors() {

/**
* Gets the resource collection API of Organizations.
*
*
* @return Resource collection API of Organizations.
*/
public Organizations organizations() {
Expand All @@ -331,7 +321,7 @@ public Organizations organizations() {

/**
* Gets the resource collection API of Plans.
*
*
* @return Resource collection API of Plans.
*/
public Plans plans() {
Expand All @@ -341,9 +331,34 @@ public Plans plans() {
return plans;
}

/**
* Gets the resource collection API of BillingInfoes.
*
* @return Resource collection API of BillingInfoes.
*/
public BillingInfoes billingInfoes() {
if (this.billingInfoes == null) {
this.billingInfoes = new BillingInfoesImpl(clientObject.getBillingInfoes(), this);
}
return billingInfoes;
}

/**
* Gets the resource collection API of ConnectedPartnerResources.
*
* @return Resource collection API of ConnectedPartnerResources.
*/
public ConnectedPartnerResources connectedPartnerResources() {
if (this.connectedPartnerResources == null) {
this.connectedPartnerResources
= new ConnectedPartnerResourcesImpl(clientObject.getConnectedPartnerResources(), this);
}
return connectedPartnerResources;
}

/**
* Gets the resource collection API of TagRules. It manages TagRule.
*
*
* @return Resource collection API of TagRules.
*/
public TagRules tagRules() {
Expand All @@ -354,8 +369,23 @@ public TagRules tagRules() {
}

/**
* @return Wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
* Gets the resource collection API of MonitoredSubscriptions. It manages MonitoredSubscriptionProperties.
*
* @return Resource collection API of MonitoredSubscriptions.
*/
public MonitoredSubscriptions monitoredSubscriptions() {
if (this.monitoredSubscriptions == null) {
this.monitoredSubscriptions
= new MonitoredSubscriptionsImpl(clientObject.getMonitoredSubscriptions(), this);
}
return monitoredSubscriptions;
}

/**
* Gets wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
*
* @return Wrapped service client NewRelicObservability.
*/
public NewRelicObservability serviceClient() {
return this.clientObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner;

/** An instance of this class provides access to all the operations defined in AccountsClient. */
/**
* An instance of this class provides access to all the operations defined in AccountsClient.
*/
public interface AccountsClient {
/**
* List all the existing accounts.
*
*
* @param userEmail User Email.
* @param location Location for NewRelic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
Expand All @@ -27,7 +29,7 @@ public interface AccountsClient {

/**
* List all the existing accounts.
*
*
* @param userEmail User Email.
* @param location Location for NewRelic.
* @param context The context to associate with this operation.
Expand Down
Loading
Loading