diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json index e4b9fcd940d2..95c0890e34e7 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json @@ -150,6 +150,53 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validateAddress": { + "post": { + "tags": [ + "BillingAccounts" + ], + "x-ms-examples": { + "BillingAccountValidateAddress": { + "$ref": "./examples/BillingAccountValidateAddress.json" + }, + "BillingAccountValidateAddressInvalid": { + "$ref": "./examples/BillingAccountValidateAddressInvalid.json" + } + }, + "operationId": "BillingAccountsValidateAddress_Post", + "description": "Validates the address.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "name": "address", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Address" + } + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ValidateAddressResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default": { "get": { "tags": [ @@ -3275,6 +3322,39 @@ } } }, + "ValidateAddressResponse": { + "type":"object", + "description" :" Result of the address validation", + "properties" : { + "status": { + "description": "status of the address validation.", + "$ref": "#/definitions/AddressValidationStatus" + }, + "suggestedAddresses": { + "description": "list of suggested addresses.", + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "validationMessage" : { + "description": "Validation error message.", + "type": "string" + } + } + }, + "AddressValidationStatus": { + "type": "string", + "description": "Status of the address validation response.", + "enum": [ + "Valid", + "Invalid" + ], + "x-ms-enum": { + "name": "addressValidationStatus", + "modelAsString": true + } + }, "InitiateTransferProperties": { "type": "object", "description": "Request parameters to initiate transfer.", diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddress.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddress.json new file mode 100644 index 000000000000..24141213e1c2 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddress.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "00000000-0000-0000-0000-000000000000", + "address": { + "addressLine1": "555 110th Ave NE", + "city": "bellevue", + "region": "wa", + "postalCode": "98004", + "country": "us" + } + }, + "responses": { + "200": { + "body": { + "status": "Valid", + "suggestedAddresses": [ + { + "country": "US", + "region": "WA", + "city": "Bellevue", + "addressLine1": "555 110th Ave NE", + "postalCode": "98004-5124" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddressInvalid.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddressInvalid.json new file mode 100644 index 000000000000..fb9f4c05d3c2 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/BillingAccountValidateAddressInvalid.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "00000000-0000-0000-0000-000000000000", + "address": { + "addressLine1": "55 110th Ave NE", + "city": "bellevue", + "region": "wa", + "postalCode": "98004", + "country": "us" + } + }, + "responses": { + "200": { + "body": { + "status": "Invalid", + "suggestedAddresses": [ + { + "country": "US", + "region": "WA", + "city": "Bellevue", + "addressLine1": "100 110th Ave NE", + "postalCode": "98004" + }, + { + "country": "US", + "region": "WA", + "city": "Bellevue", + "addressLine1": "102 110th Ave NE", + "postalCode": "98004-5804" + }, + { + "country": "US", + "region": "WA", + "city": "Bellevue", + "addressLine1": "104 110th Ave NE", + "postalCode": "98004-5804" + } + ], + "validationMessage" : "Invalid address" + } + } + } +} \ No newline at end of file