From 28a807036c5ecc6ba1b19c359490289269ed57c6 Mon Sep 17 00:00:00 2001 From: Anirban Sarkar Date: Fri, 2 Oct 2020 13:03:04 -0700 Subject: [PATCH 1/3] Adding AddBillingRoleAssignment API in 2020-05-01 version Adding AddBillingRoleAssignment API in 2020-05-01 version --- .../stable/2020-05-01/billing.json | 157 ++++++++++++++++++ .../AddRoleAssignmentToBillingAccount.json | 28 ++++ .../AddRoleAssignmentToBillingProfile.json | 29 ++++ .../AddRoleAssignmentToInvoiceSection.json | 30 ++++ 4 files changed, 244 insertions(+) create mode 100644 specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json create mode 100644 specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json create mode 100644 specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json index 65048a244a9f..baf6935a993b 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json @@ -3460,6 +3460,150 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment": { + "post": { + "tags": [ + "BillingRoleAssignments" + ], + "operationId": "BillingRoleAssignments_AddByBillingAccount", + "description": "Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", + "x-ms-examples": { + "AddRoleAssignmentToBillingAccount": { + "$ref": "./examples/AddRoleAssignmentToBillingAccount.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BillingRoleAssignmentRequestProperties" + }, + "description": "Request parameters that are provided to the create billing role assignment operation." + } + ], + "responses": { + "201": { + "description": "Role assignment is successfully created", + "schema": { + "$ref": "#/definitions/BillingRoleAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment": { + "post": { + "tags": [ + "BillingRoleAssignments" + ], + "operationId": "BillingRoleAssignments_AddByInvoiceSection", + "description": "Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", + "x-ms-examples": { + "AddRoleAssignmentToInvoiceSection": { + "$ref": "./examples/AddRoleAssignmentToInvoiceSection.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "$ref": "#/parameters/invoiceSectionNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BillingRoleAssignmentRequestProperties" + }, + "description": "Request parameters that are provided to the create billing role assignment operation." + } + ], + "responses": { + "201": { + "description": "Role assignment is successfully created", + "schema": { + "$ref": "#/definitions/BillingRoleAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment": { + "post": { + "tags": [ + "BillingRoleAssignments" + ], + "operationId": "BillingRoleAssignments_AddByBillingProfile", + "description": "Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", + "x-ms-examples": { + "AddRoleAssignmentToBillingProfile": { + "$ref": "./examples/AddRoleAssignmentToBillingProfile.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BillingRoleAssignmentRequestProperties" + }, + "description": "Request parameters that are provided to the create billing role assignment operation." + } + ], + "responses": { + "201": { + "description": "Role assignment is successfully created", + "schema": { + "$ref": "#/definitions/BillingRoleAssignment" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements": { "get": { "tags": [ @@ -6026,6 +6170,19 @@ } } }, + "BillingRoleAssignmentRequestProperties": { + "description": "The request parameters to add the role assignment on a scope", + "properties": { + "principalId": { + "description": "The user's principal id that the role gets assigned to", + "type": "string" + }, + "billingRoleDefinitionId": { + "description": "The role definition id", + "type": "string" + } + } + }, "BillingRoleDefinitionListResult": { "description": "The list of role definitions.", "properties": { diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json new file mode 100644 index 000000000000..2f54da73a5ae --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "parameters": { + "principalId": "00000000-0000-0000-0000-000000000000", + "roleDefinitionId": "{roleDefinitionId}" + } + }, + "responses": { + "201": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", + "name": "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", + "properties": { + "createdOn": "2018-06-21T21:34:12.2363515+00:00", + "createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", + "createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", + "principalId": "00000000-0000-0000-0000-000000000000", + "scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", + "principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", + "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" + }, + "type": "Microsoft.Billing/billingAccounts/billingRoleAssignments" + } + } + } +} diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json new file mode 100644 index 000000000000..ed94bac03649 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}", + "parameters": { + "principalId": "00000000-0000-0000-0000-000000000000", + "roleDefinitionId": "{roleDefinitionId}" + } + }, + "responses": { + "201": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47", + "name": "10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47", + "properties": { + "createdOn": "2018-06-21T21:58:19.9073876+00:00", + "scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", + "createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", + "createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", + "principalId": "00000000-0000-0000-0000-000000000000", + "principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", + "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" + }, + "type": "Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments" + } + } + } +} diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json new file mode 100644 index 000000000000..14828a4d94be --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2019-10-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}", + "invoiceSectionName": "{invoiceSectionName}", + "parameters": { + "principalId": "00000000-0000-0000-0000-000000000000", + "roleDefinitionId": "{roleDefinitionId}" + } + }, + "responses": { + "201": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", + "name": "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", + "properties": { + "createdOn": "2018-06-21T21:34:12.2363515+00:00", + "scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", + "createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", + "createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", + "principalId": "00000000-0000-0000-0000-000000000000", + "principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", + "roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" + }, + "type": "Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments" + } + } + } +} From ea6d94bc759fe32cbc31c8b40eb42017bd2bb0ab Mon Sep 17 00:00:00 2001 From: Anirban Sarkar Date: Fri, 2 Oct 2020 13:09:48 -0700 Subject: [PATCH 2/3] Fixed build errors --- .../Microsoft.Billing/stable/2020-05-01/billing.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json index baf6935a993b..2042daec260a 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/billing.json @@ -6177,7 +6177,7 @@ "description": "The user's principal id that the role gets assigned to", "type": "string" }, - "billingRoleDefinitionId": { + "roleDefinitionId": { "description": "The role definition id", "type": "string" } From 8b50b26e6bbd972263f7f97ef879d57dc8f78738 Mon Sep 17 00:00:00 2001 From: Anirban Sarkar Date: Fri, 2 Oct 2020 15:44:22 -0700 Subject: [PATCH 3/3] Corrected the version number --- .../2020-05-01/examples/AddRoleAssignmentToBillingAccount.json | 2 +- .../2020-05-01/examples/AddRoleAssignmentToBillingProfile.json | 2 +- .../2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json index 2f54da73a5ae..8141ec0ad1fc 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingAccount.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-10-01-preview", + "api-version": "2020-05-01", "billingAccountName": "{billingAccountName}", "parameters": { "principalId": "00000000-0000-0000-0000-000000000000", diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json index ed94bac03649..33fc83cd034d 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToBillingProfile.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-10-01-preview", + "api-version": "2020-05-01", "billingAccountName": "{billingAccountName}", "billingProfileName": "{billingProfileName}", "parameters": { diff --git a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json index 14828a4d94be..662c68878d7e 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json +++ b/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddRoleAssignmentToInvoiceSection.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-10-01-preview", + "api-version": "2020-05-01", "billingAccountName": "{billingAccountName}", "billingProfileName": "{billingProfileName}", "invoiceSectionName": "{invoiceSectionName}",