sdk/billing/arm-billing/src/operations/billingRoleAssignments.ts (2,615 lines of code) (raw):
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
import { setContinuationToken } from "../pagingHelper.js";
import { BillingRoleAssignments } from "../operationsInterfaces/index.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
import { BillingManagementClient } from "../billingManagementClient.js";
import {
SimplePollerLike,
OperationState,
createHttpPoller,
} from "@azure/core-lro";
import { createLroSpec } from "../lroImpl.js";
import {
BillingRoleAssignment,
BillingRoleAssignmentsListByBillingProfileNextOptionalParams,
BillingRoleAssignmentsListByBillingProfileOptionalParams,
BillingRoleAssignmentsListByBillingProfileResponse,
BillingRoleAssignmentsListByCustomerNextOptionalParams,
BillingRoleAssignmentsListByCustomerOptionalParams,
BillingRoleAssignmentsListByCustomerResponse,
BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams,
BillingRoleAssignmentsListByInvoiceSectionOptionalParams,
BillingRoleAssignmentsListByInvoiceSectionResponse,
BillingRoleAssignmentsListByBillingAccountNextOptionalParams,
BillingRoleAssignmentsListByBillingAccountOptionalParams,
BillingRoleAssignmentsListByBillingAccountResponse,
BillingRoleAssignmentsListByDepartmentNextOptionalParams,
BillingRoleAssignmentsListByDepartmentOptionalParams,
BillingRoleAssignmentsListByDepartmentResponse,
BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams,
BillingRoleAssignmentsListByEnrollmentAccountOptionalParams,
BillingRoleAssignmentsListByEnrollmentAccountResponse,
BillingRoleAssignmentsDeleteByBillingProfileOptionalParams,
BillingRoleAssignmentsGetByBillingProfileOptionalParams,
BillingRoleAssignmentsGetByBillingProfileResponse,
BillingRoleAssignmentProperties,
BillingRoleAssignmentsCreateByBillingProfileOptionalParams,
BillingRoleAssignmentsCreateByBillingProfileResponse,
BillingRoleAssignmentsDeleteByCustomerOptionalParams,
BillingRoleAssignmentsGetByCustomerOptionalParams,
BillingRoleAssignmentsGetByCustomerResponse,
BillingRoleAssignmentsCreateByCustomerOptionalParams,
BillingRoleAssignmentsCreateByCustomerResponse,
BillingRoleAssignmentsResolveByCustomerOptionalParams,
BillingRoleAssignmentsResolveByCustomerResponse,
BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams,
BillingRoleAssignmentsGetByInvoiceSectionOptionalParams,
BillingRoleAssignmentsGetByInvoiceSectionResponse,
BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams,
BillingRoleAssignmentsCreateByInvoiceSectionResponse,
BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams,
BillingRoleAssignmentsResolveByInvoiceSectionResponse,
BillingRoleAssignmentsResolveByBillingProfileOptionalParams,
BillingRoleAssignmentsResolveByBillingProfileResponse,
BillingRoleAssignmentsDeleteByBillingAccountOptionalParams,
BillingRoleAssignmentsGetByBillingAccountOptionalParams,
BillingRoleAssignmentsGetByBillingAccountResponse,
BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams,
BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse,
BillingRoleAssignmentsCreateByBillingAccountOptionalParams,
BillingRoleAssignmentsCreateByBillingAccountResponse,
BillingRoleAssignmentsDeleteByDepartmentOptionalParams,
BillingRoleAssignmentsGetByDepartmentOptionalParams,
BillingRoleAssignmentsGetByDepartmentResponse,
BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams,
BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse,
BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams,
BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams,
BillingRoleAssignmentsGetByEnrollmentAccountResponse,
BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams,
BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse,
BillingRoleAssignmentsResolveByBillingAccountOptionalParams,
BillingRoleAssignmentsResolveByBillingAccountResponse,
BillingRoleAssignmentsListByBillingProfileNextResponse,
BillingRoleAssignmentsListByCustomerNextResponse,
BillingRoleAssignmentsListByInvoiceSectionNextResponse,
BillingRoleAssignmentsListByBillingAccountNextResponse,
BillingRoleAssignmentsListByDepartmentNextResponse,
BillingRoleAssignmentsListByEnrollmentAccountNextResponse,
} from "../models/index.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing BillingRoleAssignments operations. */
export class BillingRoleAssignmentsImpl implements BillingRoleAssignments {
private readonly client: BillingManagementClient;
/**
* Initialize a new instance of the class BillingRoleAssignments class.
* @param client Reference to the service client
*/
constructor(client: BillingManagementClient) {
this.client = client;
}
/**
* Lists the role assignments for the caller on a billing profile. 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 options The options parameters.
*/
public listByBillingProfile(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsListByBillingProfileOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByBillingProfilePagingAll(
billingAccountName,
billingProfileName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByBillingProfilePagingPage(
billingAccountName,
billingProfileName,
options,
settings,
);
},
};
}
private async *listByBillingProfilePagingPage(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsListByBillingProfileOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByBillingProfileResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByBillingProfile(
billingAccountName,
billingProfileName,
options,
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByBillingProfileNext(
billingAccountName,
billingProfileName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByBillingProfilePagingAll(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsListByBillingProfileOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByBillingProfilePagingPage(
billingAccountName,
billingProfileName,
options,
)) {
yield* page;
}
}
/**
* Lists the role assignments for the caller on customer. The operation is supported for billing
* accounts with agreement type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param options The options parameters.
*/
public listByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsListByCustomerOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByCustomerPagingAll(
billingAccountName,
billingProfileName,
customerName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByCustomerPagingPage(
billingAccountName,
billingProfileName,
customerName,
options,
settings,
);
},
};
}
private async *listByCustomerPagingPage(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsListByCustomerOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByCustomerResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByCustomer(
billingAccountName,
billingProfileName,
customerName,
options,
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByCustomerNext(
billingAccountName,
billingProfileName,
customerName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByCustomerPagingAll(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsListByCustomerOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByCustomerPagingPage(
billingAccountName,
billingProfileName,
customerName,
options,
)) {
yield* page;
}
}
/**
* Lists the role assignments for the caller on an invoice section. The operation is supported for
* billing accounts with agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param options The options parameters.
*/
public listByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByInvoiceSectionPagingAll(
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByInvoiceSectionPagingPage(
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
settings,
);
},
};
}
private async *listByInvoiceSectionPagingPage(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByInvoiceSectionResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByInvoiceSection(
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByInvoiceSectionNext(
billingAccountName,
billingProfileName,
invoiceSectionName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByInvoiceSectionPagingAll(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByInvoiceSectionPagingPage(
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
)) {
yield* page;
}
}
/**
* Lists the role assignments for the caller on a billing account. 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 options The options parameters.
*/
public listByBillingAccount(
billingAccountName: string,
options?: BillingRoleAssignmentsListByBillingAccountOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByBillingAccountPagingAll(
billingAccountName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByBillingAccountPagingPage(
billingAccountName,
options,
settings,
);
},
};
}
private async *listByBillingAccountPagingPage(
billingAccountName: string,
options?: BillingRoleAssignmentsListByBillingAccountOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByBillingAccountResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByBillingAccount(billingAccountName, options);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByBillingAccountNext(
billingAccountName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByBillingAccountPagingAll(
billingAccountName: string,
options?: BillingRoleAssignmentsListByBillingAccountOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByBillingAccountPagingPage(
billingAccountName,
options,
)) {
yield* page;
}
}
/**
* Lists the role assignments for the caller on a department. The operation is supported for billing
* accounts of type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param options The options parameters.
*/
public listByDepartment(
billingAccountName: string,
departmentName: string,
options?: BillingRoleAssignmentsListByDepartmentOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByDepartmentPagingAll(
billingAccountName,
departmentName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByDepartmentPagingPage(
billingAccountName,
departmentName,
options,
settings,
);
},
};
}
private async *listByDepartmentPagingPage(
billingAccountName: string,
departmentName: string,
options?: BillingRoleAssignmentsListByDepartmentOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByDepartmentResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByDepartment(
billingAccountName,
departmentName,
options,
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByDepartmentNext(
billingAccountName,
departmentName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByDepartmentPagingAll(
billingAccountName: string,
departmentName: string,
options?: BillingRoleAssignmentsListByDepartmentOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByDepartmentPagingPage(
billingAccountName,
departmentName,
options,
)) {
yield* page;
}
}
/**
* Lists the role assignments for the caller on a enrollment account. The operation is supported for
* billing accounts of type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param options The options parameters.
*/
public listByEnrollmentAccount(
billingAccountName: string,
enrollmentAccountName: string,
options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams,
): PagedAsyncIterableIterator<BillingRoleAssignment> {
const iter = this.listByEnrollmentAccountPagingAll(
billingAccountName,
enrollmentAccountName,
options,
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByEnrollmentAccountPagingPage(
billingAccountName,
enrollmentAccountName,
options,
settings,
);
},
};
}
private async *listByEnrollmentAccountPagingPage(
billingAccountName: string,
enrollmentAccountName: string,
options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams,
settings?: PageSettings,
): AsyncIterableIterator<BillingRoleAssignment[]> {
let result: BillingRoleAssignmentsListByEnrollmentAccountResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByEnrollmentAccount(
billingAccountName,
enrollmentAccountName,
options,
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByEnrollmentAccountNext(
billingAccountName,
enrollmentAccountName,
continuationToken,
options,
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByEnrollmentAccountPagingAll(
billingAccountName: string,
enrollmentAccountName: string,
options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams,
): AsyncIterableIterator<BillingRoleAssignment> {
for await (const page of this.listByEnrollmentAccountPagingPage(
billingAccountName,
enrollmentAccountName,
options,
)) {
yield* page;
}
}
/**
* Deletes a role assignment on a billing profile. 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByBillingProfile(
billingAccountName: string,
billingProfileName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
billingRoleAssignmentName,
options,
},
deleteByBillingProfileOperationSpec,
);
}
/**
* Gets a role assignment for the caller on a billing profile. 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByBillingProfile(
billingAccountName: string,
billingProfileName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams,
): Promise<BillingRoleAssignmentsGetByBillingProfileResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
billingRoleAssignmentName,
options,
},
getByBillingProfileOperationSpec,
);
}
/**
* Lists the role assignments for the caller on a billing profile. 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 options The options parameters.
*/
private _listByBillingProfile(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsListByBillingProfileOptionalParams,
): Promise<BillingRoleAssignmentsListByBillingProfileResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, billingProfileName, options },
listByBillingProfileOperationSpec,
);
}
/**
* Adds a role assignment on a billing profile. 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 parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByBillingProfile(
billingAccountName: string,
billingProfileName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateByBillingProfileResponse>,
BillingRoleAssignmentsCreateByBillingProfileResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateByBillingProfileResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { billingAccountName, billingProfileName, parameters, options },
spec: createByBillingProfileOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateByBillingProfileResponse,
OperationState<BillingRoleAssignmentsCreateByBillingProfileResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Adds a role assignment on a billing profile. 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 parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByBillingProfileAndWait(
billingAccountName: string,
billingProfileName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams,
): Promise<BillingRoleAssignmentsCreateByBillingProfileResponse> {
const poller = await this.beginCreateByBillingProfile(
billingAccountName,
billingProfileName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Deletes a role assignment on a customer. The operation is supported for billing accounts with
* agreement type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByCustomerOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
customerName,
billingRoleAssignmentName,
options,
},
deleteByCustomerOperationSpec,
);
}
/**
* Gets a role assignment for the caller on a customer. The operation is supported for billing accounts
* with agreement type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByCustomerOptionalParams,
): Promise<BillingRoleAssignmentsGetByCustomerResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
customerName,
billingRoleAssignmentName,
options,
},
getByCustomerOperationSpec,
);
}
/**
* Lists the role assignments for the caller on customer. The operation is supported for billing
* accounts with agreement type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param options The options parameters.
*/
private _listByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsListByCustomerOptionalParams,
): Promise<BillingRoleAssignmentsListByCustomerResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, billingProfileName, customerName, options },
listByCustomerOperationSpec,
);
}
/**
* Adds a role assignment on a customer. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByCustomerOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateByCustomerResponse>,
BillingRoleAssignmentsCreateByCustomerResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateByCustomerResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
billingProfileName,
customerName,
parameters,
options,
},
spec: createByCustomerOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateByCustomerResponse,
OperationState<BillingRoleAssignmentsCreateByCustomerResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Adds a role assignment on a customer. The operation is supported for billing accounts with agreement
* type Microsoft Partner Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByCustomerAndWait(
billingAccountName: string,
billingProfileName: string,
customerName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByCustomerOptionalParams,
): Promise<BillingRoleAssignmentsCreateByCustomerResponse> {
const poller = await this.beginCreateByCustomer(
billingAccountName,
billingProfileName,
customerName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on a customer while fetching user info for each role
* assignment. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param options The options parameters.
*/
async beginResolveByCustomer(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsResolveByCustomerOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsResolveByCustomerResponse>,
BillingRoleAssignmentsResolveByCustomerResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsResolveByCustomerResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { billingAccountName, billingProfileName, customerName, options },
spec: resolveByCustomerOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsResolveByCustomerResponse,
OperationState<BillingRoleAssignmentsResolveByCustomerResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Lists the role assignments for the caller on a customer while fetching user info for each role
* assignment. The operation is supported for billing accounts with agreement type Microsoft Partner
* Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param options The options parameters.
*/
async beginResolveByCustomerAndWait(
billingAccountName: string,
billingProfileName: string,
customerName: string,
options?: BillingRoleAssignmentsResolveByCustomerOptionalParams,
): Promise<BillingRoleAssignmentsResolveByCustomerResponse> {
const poller = await this.beginResolveByCustomer(
billingAccountName,
billingProfileName,
customerName,
options,
);
return poller.pollUntilDone();
}
/**
* Deletes a role assignment on an invoice section. The operation is supported for billing accounts
* with agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
invoiceSectionName,
billingRoleAssignmentName,
options,
},
deleteByInvoiceSectionOperationSpec,
);
}
/**
* Gets a role assignment for the caller on an invoice section. The operation is supported for billing
* accounts with agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams,
): Promise<BillingRoleAssignmentsGetByInvoiceSectionResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
invoiceSectionName,
billingRoleAssignmentName,
options,
},
getByInvoiceSectionOperationSpec,
);
}
/**
* Lists the role assignments for the caller on an invoice section. The operation is supported for
* billing accounts with agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param options The options parameters.
*/
private _listByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams,
): Promise<BillingRoleAssignmentsListByInvoiceSectionResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, billingProfileName, invoiceSectionName, options },
listByInvoiceSectionOperationSpec,
);
}
/**
* Adds a role assignment on an invoice section. The operation is supported for billing accounts with
* agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateByInvoiceSectionResponse>,
BillingRoleAssignmentsCreateByInvoiceSectionResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateByInvoiceSectionResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
billingProfileName,
invoiceSectionName,
parameters,
options,
},
spec: createByInvoiceSectionOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateByInvoiceSectionResponse,
OperationState<BillingRoleAssignmentsCreateByInvoiceSectionResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Adds a role assignment on an invoice section. The operation is supported for billing accounts with
* agreement type Microsoft Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByInvoiceSectionAndWait(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams,
): Promise<BillingRoleAssignmentsCreateByInvoiceSectionResponse> {
const poller = await this.beginCreateByInvoiceSection(
billingAccountName,
billingProfileName,
invoiceSectionName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on an invoice section while fetching user info for each
* role assignment. The operation is supported for billing accounts with agreement type Microsoft
* Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param options The options parameters.
*/
async beginResolveByInvoiceSection(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsResolveByInvoiceSectionResponse>,
BillingRoleAssignmentsResolveByInvoiceSectionResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsResolveByInvoiceSectionResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
},
spec: resolveByInvoiceSectionOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsResolveByInvoiceSectionResponse,
OperationState<BillingRoleAssignmentsResolveByInvoiceSectionResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Lists the role assignments for the caller on an invoice section while fetching user info for each
* role assignment. The operation is supported for billing accounts with agreement type Microsoft
* Customer Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param options The options parameters.
*/
async beginResolveByInvoiceSectionAndWait(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams,
): Promise<BillingRoleAssignmentsResolveByInvoiceSectionResponse> {
const poller = await this.beginResolveByInvoiceSection(
billingAccountName,
billingProfileName,
invoiceSectionName,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on an billing profile while fetching user info for each
* role assignment. 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 options The options parameters.
*/
async beginResolveByBillingProfile(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsResolveByBillingProfileResponse>,
BillingRoleAssignmentsResolveByBillingProfileResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsResolveByBillingProfileResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { billingAccountName, billingProfileName, options },
spec: resolveByBillingProfileOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsResolveByBillingProfileResponse,
OperationState<BillingRoleAssignmentsResolveByBillingProfileResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Lists the role assignments for the caller on an billing profile while fetching user info for each
* role assignment. 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 options The options parameters.
*/
async beginResolveByBillingProfileAndWait(
billingAccountName: string,
billingProfileName: string,
options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams,
): Promise<BillingRoleAssignmentsResolveByBillingProfileResponse> {
const poller = await this.beginResolveByBillingProfile(
billingAccountName,
billingProfileName,
options,
);
return poller.pollUntilDone();
}
/**
* Deletes a role assignment on a billing account. 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByBillingAccount(
billingAccountName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{ billingAccountName, billingRoleAssignmentName, options },
deleteByBillingAccountOperationSpec,
);
}
/**
* Gets a role assignment for the caller on a billing account. 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByBillingAccount(
billingAccountName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams,
): Promise<BillingRoleAssignmentsGetByBillingAccountResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, billingRoleAssignmentName, options },
getByBillingAccountOperationSpec,
);
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByBillingAccount(
billingAccountName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse>,
BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
billingRoleAssignmentName,
parameters,
options,
},
spec: createOrUpdateByBillingAccountOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse,
OperationState<BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
});
await poller.poll();
return poller;
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByBillingAccountAndWait(
billingAccountName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams,
): Promise<BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse> {
const poller = await this.beginCreateOrUpdateByBillingAccount(
billingAccountName,
billingRoleAssignmentName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on a billing account. 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 options The options parameters.
*/
private _listByBillingAccount(
billingAccountName: string,
options?: BillingRoleAssignmentsListByBillingAccountOptionalParams,
): Promise<BillingRoleAssignmentsListByBillingAccountResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, options },
listByBillingAccountOperationSpec,
);
}
/**
* Adds a role assignment on a billing account. 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 The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByBillingAccount(
billingAccountName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateByBillingAccountResponse>,
BillingRoleAssignmentsCreateByBillingAccountResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateByBillingAccountResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { billingAccountName, parameters, options },
spec: createByBillingAccountOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateByBillingAccountResponse,
OperationState<BillingRoleAssignmentsCreateByBillingAccountResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Adds a role assignment on a billing account. 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 The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateByBillingAccountAndWait(
billingAccountName: string,
parameters: BillingRoleAssignmentProperties,
options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams,
): Promise<BillingRoleAssignmentsCreateByBillingAccountResponse> {
const poller = await this.beginCreateByBillingAccount(
billingAccountName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Deletes a role assignment on a department. The operation is supported only for billing accounts with
* agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByDepartment(
billingAccountName: string,
departmentName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByDepartmentOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{
billingAccountName,
departmentName,
billingRoleAssignmentName,
options,
},
deleteByDepartmentOperationSpec,
);
}
/**
* Gets a role assignment for the caller on a department. The operation is supported only for billing
* accounts with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByDepartment(
billingAccountName: string,
departmentName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByDepartmentOptionalParams,
): Promise<BillingRoleAssignmentsGetByDepartmentResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
departmentName,
billingRoleAssignmentName,
options,
},
getByDepartmentOperationSpec,
);
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByDepartment(
billingAccountName: string,
departmentName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse>,
BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
departmentName,
billingRoleAssignmentName,
parameters,
options,
},
spec: createOrUpdateByDepartmentOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse,
OperationState<BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
});
await poller.poll();
return poller;
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByDepartmentAndWait(
billingAccountName: string,
departmentName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams,
): Promise<BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse> {
const poller = await this.beginCreateOrUpdateByDepartment(
billingAccountName,
departmentName,
billingRoleAssignmentName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on a department. The operation is supported for billing
* accounts of type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param options The options parameters.
*/
private _listByDepartment(
billingAccountName: string,
departmentName: string,
options?: BillingRoleAssignmentsListByDepartmentOptionalParams,
): Promise<BillingRoleAssignmentsListByDepartmentResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, departmentName, options },
listByDepartmentOperationSpec,
);
}
/**
* Deletes a role assignment on a enrollment Account. The operation is supported only for billing
* accounts with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
deleteByEnrollmentAccount(
billingAccountName: string,
enrollmentAccountName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams,
): Promise<void> {
return this.client.sendOperationRequest(
{
billingAccountName,
enrollmentAccountName,
billingRoleAssignmentName,
options,
},
deleteByEnrollmentAccountOperationSpec,
);
}
/**
* Gets a role assignment for the caller on a enrollment Account. The operation is supported only for
* billing accounts with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param options The options parameters.
*/
getByEnrollmentAccount(
billingAccountName: string,
enrollmentAccountName: string,
billingRoleAssignmentName: string,
options?: BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams,
): Promise<BillingRoleAssignmentsGetByEnrollmentAccountResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
enrollmentAccountName,
billingRoleAssignmentName,
options,
},
getByEnrollmentAccountOperationSpec,
);
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByEnrollmentAccount(
billingAccountName: string,
enrollmentAccountName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse>,
BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: {
billingAccountName,
enrollmentAccountName,
billingRoleAssignmentName,
parameters,
options,
},
spec: createOrUpdateByEnrollmentAccountOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse,
OperationState<BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
});
await poller.poll();
return poller;
}
/**
* Create or update a billing role assignment. The operation is supported only for billing accounts
* with agreement type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param billingRoleAssignmentName The ID that uniquely identifies a role assignment.
* @param parameters The properties of the billing role assignment.
* @param options The options parameters.
*/
async beginCreateOrUpdateByEnrollmentAccountAndWait(
billingAccountName: string,
enrollmentAccountName: string,
billingRoleAssignmentName: string,
parameters: BillingRoleAssignment,
options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams,
): Promise<BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse> {
const poller = await this.beginCreateOrUpdateByEnrollmentAccount(
billingAccountName,
enrollmentAccountName,
billingRoleAssignmentName,
parameters,
options,
);
return poller.pollUntilDone();
}
/**
* Lists the role assignments for the caller on a enrollment account. The operation is supported for
* billing accounts of type Enterprise Agreement.
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param options The options parameters.
*/
private _listByEnrollmentAccount(
billingAccountName: string,
enrollmentAccountName: string,
options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams,
): Promise<BillingRoleAssignmentsListByEnrollmentAccountResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, enrollmentAccountName, options },
listByEnrollmentAccountOperationSpec,
);
}
/**
* Lists the role assignments for the caller on a billing account while fetching user info for each
* role assignment. 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 options The options parameters.
*/
async beginResolveByBillingAccount(
billingAccountName: string,
options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams,
): Promise<
SimplePollerLike<
OperationState<BillingRoleAssignmentsResolveByBillingAccountResponse>,
BillingRoleAssignmentsResolveByBillingAccountResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
): Promise<BillingRoleAssignmentsResolveByBillingAccountResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec,
) => {
let currentRawResponse: coreClient.FullOperationResponse | undefined =
undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown,
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback,
},
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON(),
},
};
};
const lro = createLroSpec({
sendOperationFn,
args: { billingAccountName, options },
spec: resolveByBillingAccountOperationSpec,
});
const poller = await createHttpPoller<
BillingRoleAssignmentsResolveByBillingAccountResponse,
OperationState<BillingRoleAssignmentsResolveByBillingAccountResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
resourceLocationConfig: "location",
});
await poller.poll();
return poller;
}
/**
* Lists the role assignments for the caller on a billing account while fetching user info for each
* role assignment. 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 options The options parameters.
*/
async beginResolveByBillingAccountAndWait(
billingAccountName: string,
options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams,
): Promise<BillingRoleAssignmentsResolveByBillingAccountResponse> {
const poller = await this.beginResolveByBillingAccount(
billingAccountName,
options,
);
return poller.pollUntilDone();
}
/**
* ListByBillingProfileNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method.
* @param options The options parameters.
*/
private _listByBillingProfileNext(
billingAccountName: string,
billingProfileName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByBillingProfileNextOptionalParams,
): Promise<BillingRoleAssignmentsListByBillingProfileNextResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, billingProfileName, nextLink, options },
listByBillingProfileNextOperationSpec,
);
}
/**
* ListByCustomerNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param customerName The ID that uniquely identifies a customer.
* @param nextLink The nextLink from the previous successful call to the ListByCustomer method.
* @param options The options parameters.
*/
private _listByCustomerNext(
billingAccountName: string,
billingProfileName: string,
customerName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByCustomerNextOptionalParams,
): Promise<BillingRoleAssignmentsListByCustomerNextResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
customerName,
nextLink,
options,
},
listByCustomerNextOperationSpec,
);
}
/**
* ListByInvoiceSectionNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param billingProfileName The ID that uniquely identifies a billing profile.
* @param invoiceSectionName The ID that uniquely identifies an invoice section.
* @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method.
* @param options The options parameters.
*/
private _listByInvoiceSectionNext(
billingAccountName: string,
billingProfileName: string,
invoiceSectionName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams,
): Promise<BillingRoleAssignmentsListByInvoiceSectionNextResponse> {
return this.client.sendOperationRequest(
{
billingAccountName,
billingProfileName,
invoiceSectionName,
nextLink,
options,
},
listByInvoiceSectionNextOperationSpec,
);
}
/**
* ListByBillingAccountNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method.
* @param options The options parameters.
*/
private _listByBillingAccountNext(
billingAccountName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByBillingAccountNextOptionalParams,
): Promise<BillingRoleAssignmentsListByBillingAccountNextResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, nextLink, options },
listByBillingAccountNextOperationSpec,
);
}
/**
* ListByDepartmentNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param departmentName The name of the department.
* @param nextLink The nextLink from the previous successful call to the ListByDepartment method.
* @param options The options parameters.
*/
private _listByDepartmentNext(
billingAccountName: string,
departmentName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByDepartmentNextOptionalParams,
): Promise<BillingRoleAssignmentsListByDepartmentNextResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, departmentName, nextLink, options },
listByDepartmentNextOperationSpec,
);
}
/**
* ListByEnrollmentAccountNext
* @param billingAccountName The ID that uniquely identifies a billing account.
* @param enrollmentAccountName The name of the enrollment account.
* @param nextLink The nextLink from the previous successful call to the ListByEnrollmentAccount
* method.
* @param options The options parameters.
*/
private _listByEnrollmentAccountNext(
billingAccountName: string,
enrollmentAccountName: string,
nextLink: string,
options?: BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams,
): Promise<BillingRoleAssignmentsListByEnrollmentAccountNextResponse> {
return this.client.sendOperationRequest(
{ billingAccountName, enrollmentAccountName, nextLink, options },
listByEnrollmentAccountNextOperationSpec,
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const deleteByBillingProfileOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByBillingProfileOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByBillingProfileOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.top,
Parameters.skip,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createByBillingProfileOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters9,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const deleteByCustomerOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.customerName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByCustomerOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.customerName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByCustomerOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.top,
Parameters.skip,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.customerName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createByCustomerOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/createBillingRoleAssignment",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters9,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.customerName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const resolveByCustomerOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/resolveBillingRoleAssignments",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
201: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
202: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
204: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.resolveScopeDisplayNames,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.customerName,
],
headerParameters: [Parameters.accept],
serializer,
};
const deleteByInvoiceSectionOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByInvoiceSectionOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.top,
Parameters.skip,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createByInvoiceSectionOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters9,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const resolveByInvoiceSectionOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/resolveBillingRoleAssignments",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
201: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
202: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
204: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.resolveScopeDisplayNames,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
],
headerParameters: [Parameters.accept],
serializer,
};
const resolveByBillingProfileOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/resolveBillingRoleAssignments",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
201: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
202: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
204: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.resolveScopeDisplayNames,
],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingProfileName,
],
headerParameters: [Parameters.accept],
serializer,
};
const deleteByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createOrUpdateByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters10,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const listByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.top,
Parameters.skip,
],
urlParameters: [Parameters.$host, Parameters.billingAccountName],
headerParameters: [Parameters.accept],
serializer,
};
const createByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters9,
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.billingAccountName],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const deleteByDepartmentOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.departmentName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByDepartmentOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.departmentName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createOrUpdateByDepartmentOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters10,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.departmentName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const listByDepartmentOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.departmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const deleteByEnrollmentAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.enrollmentAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const getByEnrollmentAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.enrollmentAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const createOrUpdateByEnrollmentAccountOperationSpec: coreClient.OperationSpec =
{
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignment,
},
201: {
bodyMapper: Mappers.BillingRoleAssignment,
},
202: {
bodyMapper: Mappers.BillingRoleAssignment,
},
204: {
bodyMapper: Mappers.BillingRoleAssignment,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.parameters10,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.enrollmentAccountName,
Parameters.billingRoleAssignmentName,
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer,
};
const listByEnrollmentAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.enrollmentAccountName,
],
headerParameters: [Parameters.accept],
serializer,
};
const resolveByBillingAccountOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/resolveBillingRoleAssignments",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
201: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
202: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
204: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.resolveScopeDisplayNames,
],
urlParameters: [Parameters.$host, Parameters.billingAccountName],
headerParameters: [Parameters.accept],
serializer,
};
const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
Parameters.billingProfileName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByCustomerNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
Parameters.billingProfileName,
Parameters.customerName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
Parameters.billingProfileName,
Parameters.invoiceSectionName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByDepartmentNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
Parameters.departmentName,
],
headerParameters: [Parameters.accept],
serializer,
};
const listByEnrollmentAccountNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BillingRoleAssignmentListResult,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
urlParameters: [
Parameters.$host,
Parameters.billingAccountName,
Parameters.nextLink,
Parameters.enrollmentAccountName,
],
headerParameters: [Parameters.accept],
serializer,
};