Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/billing/arm-billing/src/billingManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions sdk/billing/arm-billing/src/models/addressesMappers.ts
Original file line number Diff line number Diff line change
@@ -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";
4 changes: 2 additions & 2 deletions sdk/billing/arm-billing/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
85 changes: 85 additions & 0 deletions sdk/billing/arm-billing/src/operations/addresses.ts
Original file line number Diff line number Diff line change
@@ -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<Models.AddressesValidateResponse>
*/
validate(address: Models.Address, options?: msRest.RequestOptionsBase): Promise<Models.AddressesValidateResponse>;
/**
* @param address
* @param callback The callback
*/
validate(address: Models.Address, callback: msRest.ServiceCallback<Models.ValidateAddressResponse>): void;
/**
* @param address
* @param options The optional parameters
* @param callback The callback
*/
validate(address: Models.Address, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ValidateAddressResponse>): void;
validate(address: Models.Address, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ValidateAddressResponse>, callback?: msRest.ServiceCallback<Models.ValidateAddressResponse>): Promise<Models.AddressesValidateResponse> {
return this.client.sendOperationRequest(
{
address,
options
},
validateOperationSpec,
callback) as Promise<Models.AddressesValidateResponse>;
}
}

// 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
};
2 changes: 1 addition & 1 deletion sdk/billing/arm-billing/src/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down