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 345e3074055e..35ec35e909a5 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 @@ -322,6 +322,142 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions": { + "get": { + "tags": [ + "Instructions" + ], + "operationId": "Instructions_ListByBillingProfile", + "description": "Lists the instructions by billing profile id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/billing/" + }, + "x-ms-examples": { + "InstructionsListByBillingProfile": { + "$ref": "./examples/InstructionsListByBillingProfile.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/InstructionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}": { + "get": { + "tags": [ + "Instructions" + ], + "x-ms-examples": { + "Instruction": { + "$ref": "./examples/Instruction.json" + } + }, + "operationId": "Instructions_Get", + "description": "Get the instruction by name.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "$ref": "#/parameters/instructionNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Instruction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Instructions" + ], + "operationId": "Instructions_Put", + "description": "The operation to create or update a instruction.", + "x-ms-examples": { + "PutInstruction": { + "$ref": "./examples/PutInstruction.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "$ref": "#/parameters/instructionNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Instruction" + }, + "description": "The new instruction." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Instruction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethods": { "get": { "tags": [ @@ -5556,6 +5692,24 @@ } } }, + "InstructionListResult": { + "description": "Result of listing instructions.", + "properties": { + "value": { + "description": "The list of instructions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Instruction" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, "BillingProfileListResult": { "description": "Result of listing billing profiles.", "properties": { @@ -5590,6 +5744,46 @@ } } }, + "Instruction": { + "description": "A instruction resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "description": "A billing instruction.", + "x-ms-client-flatten": true, + "$ref": "#/definitions/InstructionProperties" + } + } + }, + "InstructionProperties": { + "description": "A billing instruction used during invoice generation.", + "required": [ + "amount", + "startDate", + "endDate" + ], + "properties": { + "amount": { + "description": "The amount budgeted for this billing instruction.", + "type": "number" + }, + "startDate": { + "description": "The date this billing instruction goes into effect.", + "type": "string", + "format": "date-time" + }, + "endDate": { + "description": "The date this billing instruction is no longer in effect.", + "type": "string", + "format": "date-time" + } + } + }, "BillingProfileCreationRequest": { "description": "The request parameters for creating a new billing profile.", "properties": { @@ -7313,6 +7507,14 @@ "type": "string", "x-ms-parameter-location": "method" }, + "instructionNameParameter": { + "name": "instructionName", + "in": "path", + "description": "Instruction Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, "billingProfileNameParameter": { "name": "billingProfileName", "in": "path", diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/Instruction.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/Instruction.json new file mode 100644 index 000000000000..346e8be019ac --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/Instruction.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}", + "instructionName": "{instructionName}" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", + "name": "{instructionName}", + "type": "Microsoft.Billing/billingAccounts/billingProfiles/instructions", + "properties": { + "amount": 5000.0, + "startDate": "2019-12-30T21:26:47.997Z", + "endDate": "2020-12-30T21:26:47.997Z" + } + } + } + } +} diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/InstructionsListByBillingProfile.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/InstructionsListByBillingProfile.json new file mode 100644 index 000000000000..ca4723296e81 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/InstructionsListByBillingProfile.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN001", + "name": "TO1:CLIN001", + "type": "Microsoft.Billing/billingAccounts/billingProfiles/instructions", + "properties": { + "amount": 5000.0, + "startDate": "2019-12-30T21:26:47.997Z", + "endDate": "2020-12-30T21:26:47.997Z" + } + }, + { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN002", + "name": "TO1:CLIN002", + "type": "Microsoft.Billing/billingAccounts/billingProfiles/instructions", + "properties": { + "amount": 2000.0, + "startDate": "2019-12-30T21:26:47.997Z", + "endDate": "2020-12-30T21:26:47.997Z" + } + } + ] + } + } + } +} diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/PutInstruction.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/PutInstruction.json new file mode 100644 index 000000000000..741abd5c03ea --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2019-10-01-preview/examples/PutInstruction.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}", + "instructionName": "{instructionName}", + "parameters": { + "properties": { + "amount": 5000.0, + "startDate": "2019-12-30T21:26:47.997Z", + "endDate": "2020-12-30T21:26:47.997Z" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", + "name": "{instructionName}", + "type": "Microsoft.Billing/billingAccounts/billingProfiles/instructions", + "properties": { + "amount": 5000.0, + "startDate": "2019-12-30T21:26:47.997Z", + "endDate": "2020-12-30T21:26:47.997Z" + } + } + } + } +}