Skip to content

Commit ff27e9e

Browse files
authored
[Automation] Generate Fluent Lite from newrelic#package-2022-07-01 (Azure#34524)
1 parent ff5ef52 commit ff27e9e

File tree

54 files changed

+385
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+385
-217
lines changed

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.2 (2023-04-18)
44

5-
### Features Added
5+
- 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).
66

77
### Breaking Changes
88

9-
### Bugs Fixed
9+
#### `models.NewRelicMonitorResource` was modified
10+
11+
* `void switchBilling(models.SwitchBillingRequest)` -> `models.NewRelicMonitorResource switchBilling(models.SwitchBillingRequest)`
12+
13+
#### `models.Monitors` was modified
14+
15+
* `void switchBilling(java.lang.String,java.lang.String,models.SwitchBillingRequest)` -> `models.NewRelicMonitorResource switchBilling(java.lang.String,java.lang.String,models.SwitchBillingRequest)`
16+
17+
### Features Added
18+
19+
* `models.MonitorsSwitchBillingResponse` was added
1020

11-
### Other Changes
21+
* `models.MonitorsSwitchBillingHeaders` was added
1222

1323
## 1.0.0-beta.1 (2023-03-27)
1424

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager NewRelicObservability client library for Java.
44

5-
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).
5+
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).
66

77
## We'd love to hear your feedback
88

@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-newrelicobservability</artifactId>
35-
<version>1.0.0-beta.1</version>
35+
<version>1.0.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md

Lines changed: 39 additions & 39 deletions
Large diffs are not rendered by default.

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<packaging>jar</packaging>
1919

2020
<name>Microsoft Azure SDK for NewRelicObservability Management</name>
21-
<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>
21+
<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>
2222
<url>https://github.com/Azure/azure-sdk-for-java</url>
2323

2424
<licenses>

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu
224224
.append("-")
225225
.append("com.azure.resourcemanager.newrelicobservability")
226226
.append("/")
227-
.append("1.0.0-beta.1");
227+
.append("1.0.0-beta.2");
228228
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
229229
userAgentBuilder
230230
.append(" (")

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest;
2323
import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest;
2424
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest;
25+
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
2526
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate;
2627
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;
2728

@@ -358,10 +359,10 @@ PagedIterable<AppServiceInfoInner> listAppServices(
358359
* @throws IllegalArgumentException thrown if parameters fail the validation.
359360
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
360361
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
361-
* @return the {@link Response}.
362+
* @return a Monitor Resource by NewRelic.
362363
*/
363364
@ServiceMethod(returns = ReturnType.SINGLE)
364-
Response<Void> switchBillingWithResponse(
365+
MonitorsSwitchBillingResponse switchBillingWithResponse(
365366
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context);
366367

367368
/**
@@ -373,9 +374,11 @@ Response<Void> switchBillingWithResponse(
373374
* @throws IllegalArgumentException thrown if parameters fail the validation.
374375
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
375376
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
377+
* @return a Monitor Resource by NewRelic.
376378
*/
377379
@ServiceMethod(returns = ReturnType.SINGLE)
378-
void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request);
380+
NewRelicMonitorResourceInner switchBilling(
381+
String resourceGroupName, String monitorName, SwitchBillingRequest request);
379382

380383
/**
381384
* List the compute vm resources currently being monitored by the NewRelic resource.

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest;
4848
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest;
4949
import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse;
50+
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
5051
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult;
5152
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate;
5253
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;
@@ -211,9 +212,9 @@ Mono<Response<AppServicesListResponse>> listAppServices(
211212
@Headers({"Content-Type: application/json"})
212213
@Post(
213214
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling")
214-
@ExpectedResponses({204})
215+
@ExpectedResponses({200, 202, 204})
215216
@UnexpectedResponseExceptionType(ManagementException.class)
216-
Mono<Response<Void>> switchBilling(
217+
Mono<MonitorsSwitchBillingResponse> switchBilling(
217218
@HostParam("$host") String endpoint,
218219
@QueryParam("api-version") String apiVersion,
219220
@PathParam("subscriptionId") String subscriptionId,
@@ -1988,10 +1989,10 @@ public PagedIterable<AppServiceInfoInner> listAppServices(
19881989
* @throws IllegalArgumentException thrown if parameters fail the validation.
19891990
* @throws ManagementException thrown if the request is rejected by server.
19901991
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
1991-
* @return the {@link Response} on successful completion of {@link Mono}.
1992+
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
19921993
*/
19931994
@ServiceMethod(returns = ReturnType.SINGLE)
1994-
private Mono<Response<Void>> switchBillingWithResponseAsync(
1995+
private Mono<MonitorsSwitchBillingResponse> switchBillingWithResponseAsync(
19951996
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
19961997
if (this.client.getEndpoint() == null) {
19971998
return Mono
@@ -2044,10 +2045,10 @@ private Mono<Response<Void>> switchBillingWithResponseAsync(
20442045
* @throws IllegalArgumentException thrown if parameters fail the validation.
20452046
* @throws ManagementException thrown if the request is rejected by server.
20462047
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
2047-
* @return the {@link Response} on successful completion of {@link Mono}.
2048+
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
20482049
*/
20492050
@ServiceMethod(returns = ReturnType.SINGLE)
2050-
private Mono<Response<Void>> switchBillingWithResponseAsync(
2051+
private Mono<MonitorsSwitchBillingResponse> switchBillingWithResponseAsync(
20512052
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
20522053
if (this.client.getEndpoint() == null) {
20532054
return Mono
@@ -2096,11 +2097,13 @@ private Mono<Response<Void>> switchBillingWithResponseAsync(
20962097
* @throws IllegalArgumentException thrown if parameters fail the validation.
20972098
* @throws ManagementException thrown if the request is rejected by server.
20982099
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
2099-
* @return A {@link Mono} that completes when a successful response is received.
2100+
* @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
21002101
*/
21012102
@ServiceMethod(returns = ReturnType.SINGLE)
2102-
private Mono<Void> switchBillingAsync(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
2103-
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request).flatMap(ignored -> Mono.empty());
2103+
private Mono<NewRelicMonitorResourceInner> switchBillingAsync(
2104+
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
2105+
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request)
2106+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
21042107
}
21052108

21062109
/**
@@ -2113,10 +2116,10 @@ private Mono<Void> switchBillingAsync(String resourceGroupName, String monitorNa
21132116
* @throws IllegalArgumentException thrown if parameters fail the validation.
21142117
* @throws ManagementException thrown if the request is rejected by server.
21152118
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
2116-
* @return the {@link Response}.
2119+
* @return a Monitor Resource by NewRelic.
21172120
*/
21182121
@ServiceMethod(returns = ReturnType.SINGLE)
2119-
public Response<Void> switchBillingWithResponse(
2122+
public MonitorsSwitchBillingResponse switchBillingWithResponse(
21202123
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
21212124
return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block();
21222125
}
@@ -2130,10 +2133,12 @@ public Response<Void> switchBillingWithResponse(
21302133
* @throws IllegalArgumentException thrown if parameters fail the validation.
21312134
* @throws ManagementException thrown if the request is rejected by server.
21322135
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
2136+
* @return a Monitor Resource by NewRelic.
21332137
*/
21342138
@ServiceMethod(returns = ReturnType.SINGLE)
2135-
public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
2136-
switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE);
2139+
public NewRelicMonitorResourceInner switchBilling(
2140+
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
2141+
return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue();
21372142
}
21382143

21392144
/**

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse;
2727
import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource;
2828
import com.azure.resourcemanager.newrelicobservability.models.Monitors;
29+
import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse;
2930
import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource;
3031
import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest;
3132
import com.azure.resourcemanager.newrelicobservability.models.VMExtensionPayload;
@@ -162,13 +163,30 @@ public PagedIterable<AppServiceInfo> listAppServices(
162163
return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager()));
163164
}
164165

165-
public Response<Void> switchBillingWithResponse(
166+
public Response<NewRelicMonitorResource> switchBillingWithResponse(
166167
String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
167-
return this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
168+
MonitorsSwitchBillingResponse inner =
169+
this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
170+
if (inner != null) {
171+
return new SimpleResponse<>(
172+
inner.getRequest(),
173+
inner.getStatusCode(),
174+
inner.getHeaders(),
175+
new NewRelicMonitorResourceImpl(inner.getValue(), this.manager()));
176+
} else {
177+
return null;
178+
}
168179
}
169180

170-
public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
171-
this.serviceClient().switchBilling(resourceGroupName, monitorName, request);
181+
public NewRelicMonitorResource switchBilling(
182+
String resourceGroupName, String monitorName, SwitchBillingRequest request) {
183+
NewRelicMonitorResourceInner inner =
184+
this.serviceClient().switchBilling(resourceGroupName, monitorName, request);
185+
if (inner != null) {
186+
return new NewRelicMonitorResourceImpl(inner, this.manager());
187+
} else {
188+
return null;
189+
}
172190
}
173191

174192
public PagedIterable<VMInfo> listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) {

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ public PagedIterable<AppServiceInfo> listAppServices(AppServicesGetRequest reque
253253
return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context);
254254
}
255255

256-
public Response<Void> switchBillingWithResponse(SwitchBillingRequest request, Context context) {
256+
public Response<NewRelicMonitorResource> switchBillingWithResponse(SwitchBillingRequest request, Context context) {
257257
return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
258258
}
259259

260-
public void switchBilling(SwitchBillingRequest request) {
261-
serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request);
260+
public NewRelicMonitorResource switchBilling(SwitchBillingRequest request) {
261+
return serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request);
262262
}
263263

264264
public PagedIterable<VMInfo> listHosts(HostsGetRequest request) {

sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public TagRulesClient getTagRules() {
207207
this.defaultPollInterval = defaultPollInterval;
208208
this.subscriptionId = subscriptionId;
209209
this.endpoint = endpoint;
210-
this.apiVersion = "2022-07-01-preview";
210+
this.apiVersion = "2022-07-01";
211211
this.operations = new OperationsClientImpl(this);
212212
this.accounts = new AccountsClientImpl(this);
213213
this.monitors = new MonitorsClientImpl(this);

0 commit comments

Comments
 (0)