diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/billing.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/billing.json index a2135901457b..dabd80c28418 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/billing.json +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/billing.json @@ -2629,6 +2629,94 @@ } } } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default": { + "get": { + "tags": [ + "Policies" + ], + "operationId": "Policies_GetByCustomer", + "description": "The policy for a given billing account name and customer name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/billing/" + }, + "x-ms-examples": { + "PolicyByCustomer": { + "$ref": "./examples/CustomerPolicy.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/customerNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CustomerPolicy" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Policies" + ], + "operationId": "Policies_UpdateCustomer", + "description": "The operation to update a Customer policy.", + "x-ms-examples": { + "UpdateCustomer": { + "$ref": "./examples/UpdateCustomerPolicy.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/customerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomerPolicy" + }, + "description": "Parameters supplied to the update customer policy operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CustomerPolicy" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default": { "get": { @@ -6452,6 +6540,39 @@ } } } + }, + "CustomerPolicy": { + "description": "The Customer's Policy.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/CustomerPolicyProperties", + "title": "Customer Policy properties" + } + } + }, + "CustomerPolicyProperties": { + "description": "The properties of a Customer's policy.", + "properties": { + "viewCharges": { + "description": "Customer can view retail prices.", + "type": "string", + "enum": [ + "Allowed", + "NotAllowed" + ], + "x-ms-enum": { + "name": "ViewCharges", + "modelAsString": true + } + } + } }, "AvailableBalance": { "description": "Latest available balance on Monetary Credit PI.", diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/CustomerPolicy.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/CustomerPolicy.json new file mode 100644 index 000000000000..c7560944a6e2 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/CustomerPolicy.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "customerName": "{customerName}" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", + "name": "default", + "type": "Microsoft.Billing/billingAccounts/customers/policies", + "properties": { + "viewCharges": "Allowed" + } + } + } + } +} diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/UpdateCustomerPolicy.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/UpdateCustomerPolicy.json new file mode 100644 index 000000000000..8d96d102afda --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/UpdateCustomerPolicy.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "customerName": "{customerName}", + "eTag": "\"1d34d012214127f\"", + "parameters": { + "properties": { + "viewCharges": "NotAllowed" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", + "name": "default", + "type": "Microsoft.Billing/billingAccounts/customers/policies", + "properties": { + "viewCharges": "NotAllowed" + } + } + } + } +}