diff --git a/sdk/billing/arm-billing/src/billingManagementClient.ts b/sdk/billing/arm-billing/src/billingManagementClient.ts index 721467ea9b7d..abf275e50c3c 100644 --- a/sdk/billing/arm-billing/src/billingManagementClient.ts +++ b/sdk/billing/arm-billing/src/billingManagementClient.ts @@ -19,7 +19,7 @@ class BillingManagementClient extends BillingManagementClientContext { // Operation groups billingAccounts: operations.BillingAccounts; paymentMethods: operations.PaymentMethods; - billingAccountsValidateAddress: operations.BillingAccountsValidateAddress; + addresses: operations.Addresses; availableBalances: operations.AvailableBalances; billingProfiles: operations.BillingProfiles; invoiceSections: operations.InvoiceSections; @@ -51,7 +51,7 @@ class BillingManagementClient extends BillingManagementClientContext { super(credentials, subscriptionId, options); this.billingAccounts = new operations.BillingAccounts(this); this.paymentMethods = new operations.PaymentMethods(this); - this.billingAccountsValidateAddress = new operations.BillingAccountsValidateAddress(this); + this.addresses = new operations.Addresses(this); this.availableBalances = new operations.AvailableBalances(this); this.billingProfiles = new operations.BillingProfiles(this); this.invoiceSections = new operations.InvoiceSections(this); diff --git a/sdk/billing/arm-billing/src/models/addressesMappers.ts b/sdk/billing/arm-billing/src/models/addressesMappers.ts new file mode 100644 index 000000000000..80e1795098b1 --- /dev/null +++ b/sdk/billing/arm-billing/src/models/addressesMappers.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + Address, + ErrorDetails, + ErrorResponse, + ValidateAddressResponse +} from "../models/mappers"; diff --git a/sdk/billing/arm-billing/src/models/index.ts b/sdk/billing/arm-billing/src/models/index.ts index ca8710774c7b..b25aa7f6988a 100644 --- a/sdk/billing/arm-billing/src/models/index.ts +++ b/sdk/billing/arm-billing/src/models/index.ts @@ -2406,9 +2406,9 @@ export type PaymentMethodsListByBillingProfileNameNextResponse = PaymentMethodsL }; /** - * Contains response data for the post operation. + * Contains response data for the validate operation. */ -export type BillingAccountsValidateAddressPostResponse = ValidateAddressResponse & { +export type AddressesValidateResponse = ValidateAddressResponse & { /** * The underlying HTTP response. */ diff --git a/sdk/billing/arm-billing/src/operations/addresses.ts b/sdk/billing/arm-billing/src/operations/addresses.ts new file mode 100644 index 000000000000..334856062b98 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/addresses.ts @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/addressesMappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClientContext } from "../billingManagementClientContext"; + +/** Class representing a Addresses. */ +export class Addresses { + private readonly client: BillingManagementClientContext; + + /** + * Create a Addresses. + * @param {BillingManagementClientContext} client Reference to the service client. + */ + constructor(client: BillingManagementClientContext) { + this.client = client; + } + + /** + * Validates the address. + * @param address + * @param [options] The optional parameters + * @returns Promise + */ + validate(address: Models.Address, options?: msRest.RequestOptionsBase): Promise; + /** + * @param address + * @param callback The callback + */ + validate(address: Models.Address, callback: msRest.ServiceCallback): void; + /** + * @param address + * @param options The optional parameters + * @param callback The callback + */ + validate(address: Models.Address, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validate(address: Models.Address, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + address, + options + }, + validateOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const validateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Billing/validateAddress", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "address", + mapper: { + ...Mappers.Address, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ValidateAddressResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/billing/arm-billing/src/operations/index.ts b/sdk/billing/arm-billing/src/operations/index.ts index b88a2653f2db..50e040af5b3b 100644 --- a/sdk/billing/arm-billing/src/operations/index.ts +++ b/sdk/billing/arm-billing/src/operations/index.ts @@ -10,7 +10,7 @@ export * from "./billingAccounts"; export * from "./paymentMethods"; -export * from "./billingAccountsValidateAddress"; +export * from "./addresses"; export * from "./availableBalances"; export * from "./billingProfiles"; export * from "./invoiceSections";