
com.azure.resourcemanager.billing.implementation.InvoicesClientImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.billing.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.billing.fluent.InvoicesClient;
import com.azure.resourcemanager.billing.fluent.models.DocumentDownloadResultInner;
import com.azure.resourcemanager.billing.fluent.models.InvoiceInner;
import com.azure.resourcemanager.billing.models.DocumentDownloadRequest;
import com.azure.resourcemanager.billing.models.InvoiceListResult;
import java.nio.ByteBuffer;
import java.time.LocalDate;
import java.util.List;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in InvoicesClient.
*/
public final class InvoicesClientImpl implements InvoicesClient {
/**
* The proxy service used to perform REST calls.
*/
private final InvoicesService service;
/**
* The service client containing this operation class.
*/
private final BillingManagementClientImpl client;
/**
* Initializes an instance of InvoicesClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
InvoicesClientImpl(BillingManagementClientImpl client) {
this.service = RestProxy.create(InvoicesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for BillingManagementClientInvoices to be used by the proxy service to
* perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "BillingManagementCli")
public interface InvoicesService {
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingProfile(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName,
@PathParam("billingProfileName") String billingProfileName,
@QueryParam("periodStartDate") LocalDate periodStartDate,
@QueryParam("periodEndDate") LocalDate periodEndDate, @QueryParam("api-version") String apiVersion,
@QueryParam("filter") String filter, @QueryParam("orderBy") String orderBy, @QueryParam("top") Long top,
@QueryParam("skip") Long skip, @QueryParam("count") Boolean count, @QueryParam("search") String search,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> downloadDocumentsByBillingAccount(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") List parameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/amend")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> amend(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName, @PathParam("invoiceName") String invoiceName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> downloadByBillingAccount(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName, @PathParam("invoiceName") String invoiceName,
@QueryParam("documentName") String documentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/downloadSummary")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> downloadSummaryByBillingAccount(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName, @PathParam("invoiceName") String invoiceName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByBillingAccount(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName, @PathParam("invoiceName") String invoiceName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingAccount(@HostParam("$host") String endpoint,
@PathParam("billingAccountName") String billingAccountName,
@QueryParam("periodStartDate") LocalDate periodStartDate,
@QueryParam("periodEndDate") LocalDate periodEndDate, @QueryParam("api-version") String apiVersion,
@QueryParam("filter") String filter, @QueryParam("orderBy") String orderBy, @QueryParam("top") Long top,
@QueryParam("skip") Long skip, @QueryParam("count") Boolean count, @QueryParam("search") String search,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> downloadDocumentsByBillingSubscription(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") List parameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> downloadByBillingSubscription(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @PathParam("invoiceName") String invoiceName,
@QueryParam("documentName") String documentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByBillingSubscription(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @PathParam("invoiceName") String invoiceName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingSubscription(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@QueryParam("periodStartDate") LocalDate periodStartDate,
@QueryParam("periodEndDate") LocalDate periodEndDate, @QueryParam("api-version") String apiVersion,
@QueryParam("filter") String filter, @QueryParam("orderBy") String orderBy, @QueryParam("top") Long top,
@QueryParam("skip") Long skip, @QueryParam("count") Boolean count, @QueryParam("search") String search,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@PathParam("invoiceName") String invoiceName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingProfileNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingAccountNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByBillingSubscriptionNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingProfileSinglePageAsync(String billingAccountName,
String billingProfileName, LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy,
Long top, Long skip, Boolean count, String search) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (billingProfileName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByBillingProfile(this.client.getEndpoint(), billingAccountName,
billingProfileName, periodStartDate, periodEndDate, this.client.getApiVersion(), filter, orderBy, top,
skip, count, search, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingProfileSinglePageAsync(String billingAccountName,
String billingProfileName, LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy,
Long top, Long skip, Boolean count, String search, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (billingProfileName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByBillingProfile(this.client.getEndpoint(), billingAccountName, billingProfileName, periodStartDate,
periodEndDate, this.client.getApiVersion(), filter, orderBy, top, skip, count, search, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName,
LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip,
Boolean count, String search) {
return new PagedFlux<>(
() -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search),
nextLink -> listByBillingProfileNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName) {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedFlux<>(
() -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search),
nextLink -> listByBillingProfileNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName,
LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip,
Boolean count, String search, Context context) {
return new PagedFlux<>(
() -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search, context),
nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search));
}
/**
* Lists the invoices for a billing profile for a given start date and end date. The operation is supported for
* billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName,
LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip,
Boolean count, String search, Context context) {
return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search, context));
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadDocumentsByBillingAccountWithResponseAsync(
String billingAccountName, List parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.forEach(e -> e.validate());
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.downloadDocumentsByBillingAccount(this.client.getEndpoint(),
billingAccountName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadDocumentsByBillingAccountWithResponseAsync(
String billingAccountName, List parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.forEach(e -> e.validate());
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.downloadDocumentsByBillingAccount(this.client.getEndpoint(), billingAccountName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingAccountAsync(String billingAccountName,
List parameters) {
Mono>> mono
= downloadDocumentsByBillingAccountWithResponseAsync(billingAccountName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingAccountAsync(String billingAccountName, List parameters,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= downloadDocumentsByBillingAccountWithResponseAsync(billingAccountName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
context);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingAccount(String billingAccountName, List parameters) {
return this.beginDownloadDocumentsByBillingAccountAsync(billingAccountName, parameters).getSyncPoller();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingAccount(String billingAccountName, List parameters,
Context context) {
return this.beginDownloadDocumentsByBillingAccountAsync(billingAccountName, parameters, context)
.getSyncPoller();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadDocumentsByBillingAccountAsync(String billingAccountName,
List parameters) {
return beginDownloadDocumentsByBillingAccountAsync(billingAccountName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadDocumentsByBillingAccountAsync(String billingAccountName,
List parameters, Context context) {
return beginDownloadDocumentsByBillingAccountAsync(billingAccountName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadDocumentsByBillingAccount(String billingAccountName,
List parameters) {
return downloadDocumentsByBillingAccountAsync(billingAccountName, parameters).block();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadDocumentsByBillingAccount(String billingAccountName,
List parameters, Context context) {
return downloadDocumentsByBillingAccountAsync(billingAccountName, parameters, context).block();
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> amendWithResponseAsync(String billingAccountName, String invoiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.amend(this.client.getEndpoint(), billingAccountName, invoiceName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> amendWithResponseAsync(String billingAccountName, String invoiceName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.amend(this.client.getEndpoint(), billingAccountName, invoiceName, this.client.getApiVersion(),
accept, context);
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginAmendAsync(String billingAccountName, String invoiceName) {
Mono>> mono = amendWithResponseAsync(billingAccountName, invoiceName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginAmendAsync(String billingAccountName, String invoiceName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = amendWithResponseAsync(billingAccountName, invoiceName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginAmend(String billingAccountName, String invoiceName) {
return this.beginAmendAsync(billingAccountName, invoiceName).getSyncPoller();
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginAmend(String billingAccountName, String invoiceName,
Context context) {
return this.beginAmendAsync(billingAccountName, invoiceName, context).getSyncPoller();
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono amendAsync(String billingAccountName, String invoiceName) {
return beginAmendAsync(billingAccountName, invoiceName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono amendAsync(String billingAccountName, String invoiceName, Context context) {
return beginAmendAsync(billingAccountName, invoiceName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void amend(String billingAccountName, String invoiceName) {
amendAsync(billingAccountName, invoiceName).block();
}
/**
* Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void amend(String billingAccountName, String invoiceName, Context context) {
amendAsync(billingAccountName, invoiceName, context).block();
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 URL to download an invoice document along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName, String documentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.downloadByBillingAccount(this.client.getEndpoint(), billingAccountName,
invoiceName, documentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice document along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName, String documentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.downloadByBillingAccount(this.client.getEndpoint(), billingAccountName, invoiceName,
documentName, this.client.getApiVersion(), accept, context);
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 a URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingAccountAsync(String billingAccountName, String invoiceName, String documentName) {
Mono>> mono
= downloadByBillingAccountWithResponseAsync(billingAccountName, invoiceName, documentName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingAccountAsync(String billingAccountName, String invoiceName) {
final String documentName = null;
Mono>> mono
= downloadByBillingAccountWithResponseAsync(billingAccountName, invoiceName, documentName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 a URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingAccountAsync(String billingAccountName, String invoiceName, String documentName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= downloadByBillingAccountWithResponseAsync(billingAccountName, invoiceName, documentName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
context);
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadByBillingAccount(String billingAccountName, String invoiceName) {
final String documentName = null;
return this.beginDownloadByBillingAccountAsync(billingAccountName, invoiceName, documentName).getSyncPoller();
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 a URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadByBillingAccount(String billingAccountName, String invoiceName, String documentName,
Context context) {
return this.beginDownloadByBillingAccountAsync(billingAccountName, invoiceName, documentName, context)
.getSyncPoller();
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 URL to download an invoice document on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingAccountAsync(String billingAccountName,
String invoiceName, String documentName) {
return beginDownloadByBillingAccountAsync(billingAccountName, invoiceName, documentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download an invoice document on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingAccountAsync(String billingAccountName,
String invoiceName) {
final String documentName = null;
return beginDownloadByBillingAccountAsync(billingAccountName, invoiceName, documentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice document on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingAccountAsync(String billingAccountName,
String invoiceName, String documentName, Context context) {
return beginDownloadByBillingAccountAsync(billingAccountName, invoiceName, documentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadByBillingAccount(String billingAccountName, String invoiceName) {
final String documentName = null;
return downloadByBillingAccountAsync(billingAccountName, invoiceName, documentName).block();
}
/**
* Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice document.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadByBillingAccount(String billingAccountName, String invoiceName,
String documentName, Context context) {
return downloadByBillingAccountAsync(billingAccountName, invoiceName, documentName, context).block();
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download the summary document for an invoice along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadSummaryByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.downloadSummaryByBillingAccount(this.client.getEndpoint(),
billingAccountName, invoiceName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 URL to download the summary document for an invoice along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadSummaryByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.downloadSummaryByBillingAccount(this.client.getEndpoint(), billingAccountName, invoiceName,
this.client.getApiVersion(), accept, context);
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadSummaryByBillingAccountAsync(String billingAccountName, String invoiceName) {
Mono>> mono
= downloadSummaryByBillingAccountWithResponseAsync(billingAccountName, invoiceName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 a URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadSummaryByBillingAccountAsync(String billingAccountName, String invoiceName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= downloadSummaryByBillingAccountWithResponseAsync(billingAccountName, invoiceName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
context);
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadSummaryByBillingAccount(String billingAccountName, String invoiceName) {
return this.beginDownloadSummaryByBillingAccountAsync(billingAccountName, invoiceName).getSyncPoller();
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 a URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadSummaryByBillingAccount(String billingAccountName, String invoiceName, Context context) {
return this.beginDownloadSummaryByBillingAccountAsync(billingAccountName, invoiceName, context).getSyncPoller();
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download the summary document for an invoice on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadSummaryByBillingAccountAsync(String billingAccountName,
String invoiceName) {
return beginDownloadSummaryByBillingAccountAsync(billingAccountName, invoiceName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 URL to download the summary document for an invoice on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadSummaryByBillingAccountAsync(String billingAccountName,
String invoiceName, Context context) {
return beginDownloadSummaryByBillingAccountAsync(billingAccountName, invoiceName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadSummaryByBillingAccount(String billingAccountName, String invoiceName) {
return downloadSummaryByBillingAccountAsync(billingAccountName, invoiceName).block();
}
/**
* Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with
* agreement type Enterprise Agreement.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 URL to download the summary document for an invoice.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadSummaryByBillingAccount(String billingAccountName, String invoiceName,
Context context) {
return downloadSummaryByBillingAccountAsync(billingAccountName, invoiceName, context).block();
}
/**
* Gets an invoice by billing account name and ID. The operation is supported for all billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by billing account name and ID along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getByBillingAccount(this.client.getEndpoint(), billingAccountName,
invoiceName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets an invoice by billing account name and ID. The operation is supported for all billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by billing account name and ID along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByBillingAccountWithResponseAsync(String billingAccountName,
String invoiceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByBillingAccount(this.client.getEndpoint(), billingAccountName, invoiceName,
this.client.getApiVersion(), accept, context);
}
/**
* Gets an invoice by billing account name and ID. The operation is supported for all billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by billing account name and ID on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByBillingAccountAsync(String billingAccountName, String invoiceName) {
return getByBillingAccountWithResponseAsync(billingAccountName, invoiceName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets an invoice by billing account name and ID. The operation is supported for all billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by billing account name and ID along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByBillingAccountWithResponse(String billingAccountName, String invoiceName,
Context context) {
return getByBillingAccountWithResponseAsync(billingAccountName, invoiceName, context).block();
}
/**
* Gets an invoice by billing account name and ID. The operation is supported for all billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by billing account name and ID.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public InvoiceInner getByBillingAccount(String billingAccountName, String invoiceName) {
return getByBillingAccountWithResponse(billingAccountName, invoiceName, Context.NONE).getValue();
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingAccountSinglePageAsync(String billingAccountName,
LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip,
Boolean count, String search) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByBillingAccount(this.client.getEndpoint(), billingAccountName,
periodStartDate, periodEndDate, this.client.getApiVersion(), filter, orderBy, top, skip, count, search,
accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingAccountSinglePageAsync(String billingAccountName,
LocalDate periodStartDate, LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip,
Boolean count, String search, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (billingAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByBillingAccount(this.client.getEndpoint(), billingAccountName, periodStartDate, periodEndDate,
this.client.getApiVersion(), filter, orderBy, top, skip, count, search, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingAccountAsync(String billingAccountName, LocalDate periodStartDate,
LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip, Boolean count, String search) {
return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search),
nextLink -> listByBillingAccountNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingAccountAsync(String billingAccountName) {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate,
periodEndDate, filter, orderBy, top, skip, count, search),
nextLink -> listByBillingAccountNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingAccountAsync(String billingAccountName, LocalDate periodStartDate,
LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip, Boolean count, String search,
Context context) {
return new PagedFlux<>(
() -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search, context),
nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingAccount(String billingAccountName) {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search));
}
/**
* Lists the invoices for a billing account for a given start date and end date. The operation is supported for all
* billing account types.
*
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingAccount(String billingAccountName, LocalDate periodStartDate,
LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip, Boolean count, String search,
Context context) {
return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search, context));
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>>
downloadDocumentsByBillingSubscriptionWithResponseAsync(List parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.forEach(e -> e.validate());
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.downloadDocumentsByBillingSubscription(this.client.getEndpoint(),
this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadDocumentsByBillingSubscriptionWithResponseAsync(
List parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.forEach(e -> e.validate());
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.downloadDocumentsByBillingSubscription(this.client.getEndpoint(),
this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingSubscriptionAsync(List parameters) {
Mono>> mono = downloadDocumentsByBillingSubscriptionWithResponseAsync(parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingSubscriptionAsync(List parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= downloadDocumentsByBillingSubscriptionWithResponseAsync(parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
context);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingSubscription(List parameters) {
return this.beginDownloadDocumentsByBillingSubscriptionAsync(parameters).getSyncPoller();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 a URL to download multiple invoice documents (invoice pdf, tax
* receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadDocumentsByBillingSubscription(List parameters, Context context) {
return this.beginDownloadDocumentsByBillingSubscriptionAsync(parameters, context).getSyncPoller();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono
downloadDocumentsByBillingSubscriptionAsync(List parameters) {
return beginDownloadDocumentsByBillingSubscriptionAsync(parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono
downloadDocumentsByBillingSubscriptionAsync(List parameters, Context context) {
return beginDownloadDocumentsByBillingSubscriptionAsync(parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner
downloadDocumentsByBillingSubscription(List parameters) {
return downloadDocumentsByBillingSubscriptionAsync(parameters).block();
}
/**
* Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The
* operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
* Agreement.
*
* @param parameters A list of download details for individual documents.
* @param context The context to associate with this operation.
* @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 URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadDocumentsByBillingSubscription(List parameters,
Context context) {
return downloadDocumentsByBillingSubscriptionAsync(parameters, context).block();
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 URL to download an invoice by billing subscription along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadByBillingSubscriptionWithResponseAsync(String invoiceName,
String documentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.downloadByBillingSubscription(this.client.getEndpoint(),
this.client.getSubscriptionId(), invoiceName, documentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice by billing subscription along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> downloadByBillingSubscriptionWithResponseAsync(String invoiceName,
String documentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.downloadByBillingSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(),
invoiceName, documentName, this.client.getApiVersion(), accept, context);
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 a URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingSubscriptionAsync(String invoiceName, String documentName) {
Mono>> mono
= downloadByBillingSubscriptionWithResponseAsync(invoiceName, documentName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingSubscriptionAsync(String invoiceName) {
final String documentName = null;
Mono>> mono
= downloadByBillingSubscriptionWithResponseAsync(invoiceName, documentName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
this.client.getContext());
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 a URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DocumentDownloadResultInner>
beginDownloadByBillingSubscriptionAsync(String invoiceName, String documentName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= downloadByBillingSubscriptionWithResponseAsync(invoiceName, documentName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DocumentDownloadResultInner.class, DocumentDownloadResultInner.class,
context);
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 a URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadByBillingSubscription(String invoiceName) {
final String documentName = null;
return this.beginDownloadByBillingSubscriptionAsync(invoiceName, documentName).getSyncPoller();
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 a URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DocumentDownloadResultInner>
beginDownloadByBillingSubscription(String invoiceName, String documentName, Context context) {
return this.beginDownloadByBillingSubscriptionAsync(invoiceName, documentName, context).getSyncPoller();
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @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 URL to download an invoice by billing subscription on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingSubscriptionAsync(String invoiceName,
String documentName) {
return beginDownloadByBillingSubscriptionAsync(invoiceName, documentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download an invoice by billing subscription on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingSubscriptionAsync(String invoiceName) {
final String documentName = null;
return beginDownloadByBillingSubscriptionAsync(invoiceName, documentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice by billing subscription on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono downloadByBillingSubscriptionAsync(String invoiceName,
String documentName, Context context) {
return beginDownloadByBillingSubscriptionAsync(invoiceName, documentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadByBillingSubscription(String invoiceName) {
final String documentName = null;
return downloadByBillingSubscriptionAsync(invoiceName, documentName).block();
}
/**
* Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param documentName The ID that uniquely identifies an invoice document. This ID may be an identifier for an
* invoice PDF, a credit note, or a tax receipt.
* @param context The context to associate with this operation.
* @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 URL to download an invoice by billing subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DocumentDownloadResultInner downloadByBillingSubscription(String invoiceName, String documentName,
Context context) {
return downloadByBillingSubscriptionAsync(invoiceName, documentName, context).block();
}
/**
* Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by subscription ID and invoice ID along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByBillingSubscriptionWithResponseAsync(String invoiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getByBillingSubscription(this.client.getEndpoint(),
this.client.getSubscriptionId(), invoiceName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by subscription ID and invoice ID along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByBillingSubscriptionWithResponseAsync(String invoiceName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByBillingSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), invoiceName,
this.client.getApiVersion(), accept, context);
}
/**
* Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by subscription ID and invoice ID on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByBillingSubscriptionAsync(String invoiceName) {
return getByBillingSubscriptionWithResponseAsync(invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by subscription ID and invoice ID along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByBillingSubscriptionWithResponse(String invoiceName, Context context) {
return getByBillingSubscriptionWithResponseAsync(invoiceName, context).block();
}
/**
* Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by subscription ID and invoice ID.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public InvoiceInner getByBillingSubscription(String invoiceName) {
return getByBillingSubscriptionWithResponse(invoiceName, Context.NONE).getValue();
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingSubscriptionSinglePageAsync(LocalDate periodStartDate,
LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip, Boolean count, String search) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByBillingSubscription(this.client.getEndpoint(),
this.client.getSubscriptionId(), periodStartDate, periodEndDate, this.client.getApiVersion(), filter,
orderBy, top, skip, count, search, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingSubscriptionSinglePageAsync(LocalDate periodStartDate,
LocalDate periodEndDate, String filter, String orderBy, Long top, Long skip, Boolean count, String search,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByBillingSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), periodStartDate,
periodEndDate, this.client.getApiVersion(), filter, orderBy, top, skip, count, search, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingSubscriptionAsync(LocalDate periodStartDate, LocalDate periodEndDate,
String filter, String orderBy, Long top, Long skip, Boolean count, String search) {
return new PagedFlux<>(() -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search), nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingSubscriptionAsync() {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedFlux<>(() -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search), nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByBillingSubscriptionAsync(LocalDate periodStartDate, LocalDate periodEndDate,
String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) {
return new PagedFlux<>(() -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate, filter,
orderBy, top, skip, count, search, context),
nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingSubscription() {
final LocalDate periodStartDate = null;
final LocalDate periodEndDate = null;
final String filter = null;
final String orderBy = null;
final Long top = null;
final Long skip = null;
final Boolean count = null;
final String search = null;
return new PagedIterable<>(
listByBillingSubscriptionAsync(periodStartDate, periodEndDate, filter, orderBy, top, skip, count, search));
}
/**
* Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type
* Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @param periodStartDate The start date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param periodEndDate The end date of the billing period for which the invoice is generated. The date is in
* MM-DD-YYYY format.
* @param filter The filter query option allows clients to filter a collection of resources that are addressed by a
* request URL.
* @param orderBy The orderby query option allows clients to request resources in a particular order.
* @param top The top query option requests the number of items in the queried collection to be included in the
* result. The maximum supported value for top is 50.
* @param skip The skip query option requests the number of items in the queried collection that are to be skipped
* and not included in the result.
* @param count The count query option allows clients to request a count of the matching resources included with the
* resources in the response.
* @param search The search query option allows clients to request items within a collection matching a free-text
* search expression. search is only supported for string fields.
* @param context The context to associate with this operation.
* @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 container for a list of resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByBillingSubscription(LocalDate periodStartDate, LocalDate periodEndDate,
String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) {
return new PagedIterable<>(listByBillingSubscriptionAsync(periodStartDate, periodEndDate, filter, orderBy, top,
skip, count, search, context));
}
/**
* Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by ID along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String invoiceName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), invoiceName, this.client.getApiVersion(),
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by ID along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String invoiceName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (invoiceName == null) {
return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), invoiceName, this.client.getApiVersion(), accept, context);
}
/**
* Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by ID on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String invoiceName) {
return getWithResponseAsync(invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @param context The context to associate with this operation.
* @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 an invoice by ID along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String invoiceName, Context context) {
return getWithResponseAsync(invoiceName, context).block();
}
/**
* Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement or Microsoft Customer Agreement.
*
* @param invoiceName The ID that uniquely identifies an invoice.
* @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 an invoice by ID.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public InvoiceInner get(String invoiceName) {
return getWithResponse(invoiceName, Context.NONE).getValue();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingProfileNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingAccountNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingSubscriptionNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByBillingSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @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 container for a list of resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByBillingSubscriptionNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByBillingSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy