/* * 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 { BillingAccount } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { SubscriptionClient } from "../subscriptionClient"; import { BillingAccountGetPolicyOptionalParams, BillingAccountGetPolicyResponse } from "../models"; /** Class containing BillingAccount operations. */ export class BillingAccountImpl implements BillingAccount { private readonly client: SubscriptionClient; /** * Initialize a new instance of the class BillingAccount class. * @param client Reference to the service client */ constructor(client: SubscriptionClient) { this.client = client; } /** * Get Billing Account Policy. * @param billingAccountId Billing Account Id. * @param options The options parameters. */ getPolicy( billingAccountId: string, options?: BillingAccountGetPolicyOptionalParams ): Promise { return this.client.sendOperationRequest( { billingAccountId, options }, getPolicyOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getPolicyOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.BillingAccountPoliciesResponse }, default: { bodyMapper: Mappers.ErrorResponseBody } }, queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.billingAccountId], headerParameters: [Parameters.accept], serializer };