Skip to content
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-03-01)

- Azure Resource Manager reservations client library for Java. This package contains Microsoft Azure SDK for reservations Management SDK. This API describe Azure Reservation. Package tag package-2022-11. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-reservations</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
8 changes: 7 additions & 1 deletion sdk/reservations/azure-resourcemanager-reservations/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
~ Licensed under the MIT License.
~ Code generated by Microsoft (R) AutoRest Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -38,7 +43,8 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner;
import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner;
import com.azure.resourcemanager.reservations.models.RefundRequest;

/** An instance of this class provides access to all the operations defined in ReturnsClient. */
Expand All @@ -24,11 +24,10 @@ public interface ReturnsClient {
* @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 SyncPoller} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link SyncPoller} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
SyncPoller<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPost(
String reservationOrderId, RefundRequest body);

/**
Expand All @@ -42,11 +41,10 @@ SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
* @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 SyncPoller} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link SyncPoller} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
SyncPoller<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPost(
String reservationOrderId, RefundRequest body, Context context);

/**
Expand All @@ -59,10 +57,10 @@ SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
* @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 response of refund request containing refund information of reservation.
* @return details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
RefundResponseInner post(String reservationOrderId, RefundRequest body);
ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body);

/**
* Return a reservation.
Expand All @@ -75,8 +73,8 @@ SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
* @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 response of refund request containing refund information of reservation.
* @return details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
RefundResponseInner post(String reservationOrderId, RefundRequest body, Context context);
ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body, Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public final class PatchProperties {
private AppliedScopeType appliedScopeType;

/*
* List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.
* List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This
* property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.
*/
@JsonProperty(value = "appliedScopes")
private List<String> appliedScopes;
Expand Down Expand Up @@ -92,7 +93,8 @@ public PatchProperties withAppliedScopeType(AppliedScopeType appliedScopeType) {

/**
* Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
* AppliedScopeType is Shared.
* AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
* Single AppliedScopeType.
*
* @return the appliedScopes value.
*/
Expand All @@ -102,7 +104,8 @@ public List<String> appliedScopes() {

/**
* Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
* AppliedScopeType is Shared.
* AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
* Single AppliedScopeType.
*
* @param appliedScopes the appliedScopes value to set.
* @return the PatchProperties object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public final class PurchaseRequestProperties {
private AppliedScopeType appliedScopeType;

/*
* List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.
* List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This
* property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.
*/
@JsonProperty(value = "appliedScopes")
private List<String> appliedScopes;
Expand Down Expand Up @@ -237,7 +238,8 @@ public PurchaseRequestProperties withAppliedScopeType(AppliedScopeType appliedSc

/**
* Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
* AppliedScopeType is Shared.
* AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
* Single AppliedScopeType.
*
* @return the appliedScopes value.
*/
Expand All @@ -247,7 +249,8 @@ public List<String> appliedScopes() {

/**
* Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
* AppliedScopeType is Shared.
* AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for
* Single AppliedScopeType.
*
* @param appliedScopes the appliedScopes value to set.
* @return the PurchaseRequestProperties object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.reservations.fluent.ReturnsClient;
import com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner;
import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner;
import com.azure.resourcemanager.reservations.models.RefundRequest;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -59,7 +59,7 @@ public final class ReturnsClientImpl implements ReturnsClient {
public interface ReturnsService {
@Headers({"Content-Type: application/json"})
@Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return")
@ExpectedResponses({202})
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> post(
@HostParam("$host") String endpoint,
Expand All @@ -80,8 +80,8 @@ Mono<Response<Flux<ByteBuffer>>> post(
* @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 response of refund request containing refund information of reservation along with {@link Response}
* on successful completion of {@link Mono}.
* @return details of a reservation order being returned along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> postWithResponseAsync(String reservationOrderId, RefundRequest body) {
Expand Down Expand Up @@ -120,8 +120,8 @@ private Mono<Response<Flux<ByteBuffer>>> postWithResponseAsync(String reservatio
* @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 response of refund request containing refund information of reservation along with {@link Response}
* on successful completion of {@link Mono}.
* @return details of a reservation order being returned along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> postWithResponseAsync(
Expand Down Expand Up @@ -157,20 +157,19 @@ private Mono<Response<Flux<ByteBuffer>>> postWithResponseAsync(
* @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 PollerFlux} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link PollerFlux} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux<PollResult<RefundResponseInner>, RefundResponseInner> beginPostAsync(
private PollerFlux<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPostAsync(
String reservationOrderId, RefundRequest body) {
Mono<Response<Flux<ByteBuffer>>> mono = postWithResponseAsync(reservationOrderId, body);
return this
.client
.<RefundResponseInner, RefundResponseInner>getLroResult(
.<ReservationOrderResponseInner, ReservationOrderResponseInner>getLroResult(
mono,
this.client.getHttpPipeline(),
RefundResponseInner.class,
RefundResponseInner.class,
ReservationOrderResponseInner.class,
ReservationOrderResponseInner.class,
this.client.getContext());
}

Expand All @@ -185,18 +184,21 @@ private PollerFlux<PollResult<RefundResponseInner>, RefundResponseInner> beginPo
* @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 PollerFlux} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link PollerFlux} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux<PollResult<RefundResponseInner>, RefundResponseInner> beginPostAsync(
private PollerFlux<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPostAsync(
String reservationOrderId, RefundRequest body, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono = postWithResponseAsync(reservationOrderId, body, context);
return this
.client
.<RefundResponseInner, RefundResponseInner>getLroResult(
mono, this.client.getHttpPipeline(), RefundResponseInner.class, RefundResponseInner.class, context);
.<ReservationOrderResponseInner, ReservationOrderResponseInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ReservationOrderResponseInner.class,
ReservationOrderResponseInner.class,
context);
}

/**
Expand All @@ -209,11 +211,10 @@ private PollerFlux<PollResult<RefundResponseInner>, RefundResponseInner> beginPo
* @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 SyncPoller} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link SyncPoller} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
public SyncPoller<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPost(
String reservationOrderId, RefundRequest body) {
return this.beginPostAsync(reservationOrderId, body).getSyncPoller();
}
Expand All @@ -229,11 +230,10 @@ public SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPos
* @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 SyncPoller} for polling of the response of refund request containing refund information of
* reservation.
* @return the {@link SyncPoller} for polling of details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPost(
public SyncPoller<PollResult<ReservationOrderResponseInner>, ReservationOrderResponseInner> beginPost(
String reservationOrderId, RefundRequest body, Context context) {
return this.beginPostAsync(reservationOrderId, body, context).getSyncPoller();
}
Expand All @@ -248,11 +248,10 @@ public SyncPoller<PollResult<RefundResponseInner>, RefundResponseInner> beginPos
* @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 response of refund request containing refund information of reservation on successful completion of
* {@link Mono}.
* @return details of a reservation order being returned on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<RefundResponseInner> postAsync(String reservationOrderId, RefundRequest body) {
private Mono<ReservationOrderResponseInner> postAsync(String reservationOrderId, RefundRequest body) {
return beginPostAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError);
}

Expand All @@ -267,11 +266,11 @@ private Mono<RefundResponseInner> postAsync(String reservationOrderId, RefundReq
* @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 response of refund request containing refund information of reservation on successful completion of
* {@link Mono}.
* @return details of a reservation order being returned on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<RefundResponseInner> postAsync(String reservationOrderId, RefundRequest body, Context context) {
private Mono<ReservationOrderResponseInner> postAsync(
String reservationOrderId, RefundRequest body, Context context) {
return beginPostAsync(reservationOrderId, body, context).last().flatMap(this.client::getLroFinalResultOrError);
}

Expand All @@ -285,10 +284,10 @@ private Mono<RefundResponseInner> postAsync(String reservationOrderId, RefundReq
* @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 response of refund request containing refund information of reservation.
* @return details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public RefundResponseInner post(String reservationOrderId, RefundRequest body) {
public ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body) {
return postAsync(reservationOrderId, body).block();
}

Expand All @@ -303,10 +302,10 @@ public RefundResponseInner post(String reservationOrderId, RefundRequest body) {
* @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 response of refund request containing refund information of reservation.
* @return details of a reservation order being returned.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public RefundResponseInner post(String reservationOrderId, RefundRequest body, Context context) {
public ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body, Context context) {
return postAsync(reservationOrderId, body, context).block();
}
}
Loading