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] Update Monitors_Delete_MinimumSet_Gen.json #4921

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.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2023-04-17)

- 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).

### 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-preview. 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-2022-07-01. 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-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down

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-preview.</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-2022-07-01.</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 @@ -22,6 +22,7 @@
import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest;
import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest;
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest;
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate;
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;

Expand Down Expand Up @@ -358,10 +359,10 @@ PagedIterable<AppServiceInfoInner> listAppServices(
* @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 the {@link Response}.
* @return a Monitor Resource by NewRelic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> switchBillingWithResponse(
MonitorsSwitchBillingResponse switchBillingWithResponse(
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context);

/**
Expand All @@ -373,9 +374,11 @@ Response<Void> switchBillingWithResponse(
* @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 a Monitor Resource by NewRelic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request);
NewRelicMonitorResourceInner switchBilling(
String resourceGroupName, String monitorName, SwitchBillingRequest request);

/**
* List the compute vm resources currently being monitored by the NewRelic resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest;
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest;
import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse;
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult;
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate;
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;
Expand Down Expand Up @@ -211,9 +212,9 @@ Mono<Response<AppServicesListResponse>> listAppServices(
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling")
@ExpectedResponses({204})
@ExpectedResponses({200, 202, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Void>> switchBilling(
Mono<MonitorsSwitchBillingResponse> switchBilling(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
Expand Down Expand Up @@ -1988,10 +1989,10 @@ public PagedIterable<AppServiceInfoInner> listAppServices(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Void>> switchBillingWithResponseAsync(
private Mono<MonitorsSwitchBillingResponse> switchBillingWithResponseAsync(
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
if (this.client.getEndpoint() == null) {
return Mono
Expand Down Expand Up @@ -2044,10 +2045,10 @@ private Mono<Response<Void>> switchBillingWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Void>> switchBillingWithResponseAsync(
private Mono<MonitorsSwitchBillingResponse> switchBillingWithResponseAsync(
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
Expand Down Expand Up @@ -2096,11 +2097,13 @@ private Mono<Response<Void>> switchBillingWithResponseAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> switchBillingAsync(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request).flatMap(ignored -> Mono.empty());
private Mono<NewRelicMonitorResourceInner> switchBillingAsync(
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand All @@ -2113,10 +2116,10 @@ private Mono<Void> switchBillingAsync(String resourceGroupName, String monitorNa
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response}.
* @return a Monitor Resource by NewRelic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> switchBillingWithResponse(
public MonitorsSwitchBillingResponse switchBillingWithResponse(
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block();
}
Expand All @@ -2130,10 +2133,12 @@ public Response<Void> switchBillingWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Monitor Resource by NewRelic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE);
public NewRelicMonitorResourceInner switchBilling(
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse;
import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource;
import com.azure.resourcemanager.newrelicobservability.models.Monitors;
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource;
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;
import com.azure.resourcemanager.newrelicobservability.models.VMExtensionPayload;
Expand Down Expand Up @@ -162,13 +163,30 @@ public PagedIterable<AppServiceInfo> listAppServices(
return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager()));
}

public Response<Void> switchBillingWithResponse(
public Response<NewRelicMonitorResource> switchBillingWithResponse(
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
return this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
MonitorsSwitchBillingResponse inner =
this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new NewRelicMonitorResourceImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}

public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
this.serviceClient().switchBilling(resourceGroupName, monitorName, request);
public NewRelicMonitorResource switchBilling(
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
NewRelicMonitorResourceInner inner =
this.serviceClient().switchBilling(resourceGroupName, monitorName, request);
if (inner != null) {
return new NewRelicMonitorResourceImpl(inner, this.manager());
} else {
return null;
}
}

public PagedIterable<VMInfo> listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ public PagedIterable<AppServiceInfo> listAppServices(AppServicesGetRequest reque
return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context);
}

public Response<Void> switchBillingWithResponse(SwitchBillingRequest request, Context context) {
public Response<NewRelicMonitorResource> switchBillingWithResponse(SwitchBillingRequest request, Context context) {
return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
}

public void switchBilling(SwitchBillingRequest request) {
serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request);
public NewRelicMonitorResource switchBilling(SwitchBillingRequest request) {
return serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request);
}

public PagedIterable<VMInfo> listHosts(HostsGetRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public TagRulesClient getTagRules() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
this.apiVersion = "2022-07-01-preview";
this.apiVersion = "2022-07-01";
this.operations = new OperationsClientImpl(this);
this.accounts = new AccountsClientImpl(this);
this.monitors = new MonitorsClientImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ PagedIterable<AppServiceInfo> listAppServices(
* @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 the {@link Response}.
* @return a Monitor Resource by NewRelic.
*/
Response<Void> switchBillingWithResponse(
Response<NewRelicMonitorResource> switchBillingWithResponse(
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context);

/**
Expand All @@ -217,8 +217,9 @@ Response<Void> switchBillingWithResponse(
* @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 a Monitor Resource by NewRelic.
*/
void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request);
NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request);

/**
* List the compute vm resources currently being monitored by the NewRelic resource.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.newrelicobservability.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.HttpHeaders;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The MonitorsSwitchBillingHeaders model. */
@Fluent
public final class MonitorsSwitchBillingHeaders {
/*
* The Retry-After property.
*/
@JsonProperty(value = "Retry-After")
private Integer retryAfter;

// HttpHeaders containing the raw property values.
/**
* Creates an instance of MonitorsSwitchBillingHeaders class.
*
* @param rawHeaders The raw HttpHeaders that will be used to create the property values.
*/
public MonitorsSwitchBillingHeaders(HttpHeaders rawHeaders) {
String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER);
if (retryAfter != null) {
this.retryAfter = Integer.parseInt(retryAfter);
}
}

/**
* Get the retryAfter property: The Retry-After property.
*
* @return the retryAfter value.
*/
public Integer retryAfter() {
return this.retryAfter;
}

/**
* Set the retryAfter property: The Retry-After property.
*
* @param retryAfter the retryAfter value to set.
* @return the MonitorsSwitchBillingHeaders object itself.
*/
public MonitorsSwitchBillingHeaders withRetryAfter(Integer retryAfter) {
this.retryAfter = retryAfter;
return this;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.newrelicobservability.models;

import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;
import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner;

/** Contains all response data for the switchBilling operation. */
public final class MonitorsSwitchBillingResponse
extends ResponseBase<MonitorsSwitchBillingHeaders, NewRelicMonitorResourceInner> {
/**
* Creates an instance of MonitorsSwitchBillingResponse.
*
* @param request the request which resulted in this MonitorsSwitchBillingResponse.
* @param statusCode the status code of the HTTP response.
* @param rawHeaders the raw headers of the HTTP response.
* @param value the deserialized value of the HTTP response.
* @param headers the deserialized headers of the HTTP response.
*/
public MonitorsSwitchBillingResponse(
HttpRequest request,
int statusCode,
HttpHeaders rawHeaders,
NewRelicMonitorResourceInner value,
MonitorsSwitchBillingHeaders headers) {
super(request, statusCode, rawHeaders, value, headers);
}

/**
* Gets the deserialized response body.
*
* @return the deserialized response body.
*/
@Override
public NewRelicMonitorResourceInner getValue() {
return super.getValue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ interface WithAccountCreationSource {
* @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 the {@link Response}.
* @return a Monitor Resource by NewRelic.
*/
Response<Void> switchBillingWithResponse(SwitchBillingRequest request, Context context);
Response<NewRelicMonitorResource> switchBillingWithResponse(SwitchBillingRequest request, Context context);

/**
* Switches the billing for NewRelic monitor resource.
Expand All @@ -513,8 +513,9 @@ interface WithAccountCreationSource {
* @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 a Monitor Resource by NewRelic.
*/
void switchBilling(SwitchBillingRequest request);
NewRelicMonitorResource switchBilling(SwitchBillingRequest request);

/**
* List the compute vm resources currently being monitored by the NewRelic resource.
Expand Down
Loading