diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index e89ca196c2d8..1c4e0b6eae48 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -1596,7 +1596,7 @@ } } }, - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events": { + "/{scope}/providers/Microsoft.Consumption/events": { "get": { "tags": [ "Events" @@ -1609,15 +1609,12 @@ "x-ms-examples": { "EventsListByBillingProfile": { "$ref": "./examples/EventsListByBillingProfile.json" + }, + "EventsList-Modern": { + "$ref": "./examples/EventsListByCustomer.json" } }, "parameters": [ - { - "$ref": "#/parameters/billingAccountIdParameter" - }, - { - "$ref": "#/parameters/billingProfileIdParameter" - }, { "$ref": "#/parameters/apiVersionParameter" }, @@ -1626,6 +1623,9 @@ }, { "$ref": "#/parameters/endDateParameter" + }, + { + "$ref": "#/parameters/scopeEventsParameter" } ], "responses": { @@ -1647,7 +1647,7 @@ } } }, - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots": { + "/{scope}/providers/Microsoft.Consumption/lots": { "get": { "tags": [ "Lots" @@ -1658,16 +1658,16 @@ "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" }, "x-ms-examples": { - "EventsListByBillingProfile": { + "LotsListByBillingProfile": { "$ref": "./examples/LotsListByBillingProfile.json" + }, + "LotsList-Modern": { + "$ref": "./examples/LotsListByCustomer.json" } }, "parameters": [ { - "$ref": "#/parameters/billingAccountIdParameter" - }, - { - "$ref": "#/parameters/billingProfileIdParameter" + "$ref": "#/parameters/scopeLotsParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -1692,7 +1692,7 @@ } } }, - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary": { + "/{scope}/providers/Microsoft.Consumption/credits/balanceSummary": { "get": { "tags": [ "Credits" @@ -1703,19 +1703,19 @@ "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" }, "x-ms-examples": { - "CreditSummaryByBillingProfile": { + "CreditsBalanceSummaryByBillingProfile": { "$ref": "./examples/CreditSummaryByBillingProfile.json" + }, + "CreditsBalanceSummary-Modern": { + "$ref": "./examples/CreditSummaryByCustomer.json" } }, "parameters": [ { - "$ref": "#/parameters/billingAccountIdParameter" - }, - { - "$ref": "#/parameters/billingProfileIdParameter" + "$ref": "#/parameters/apiVersionParameter" }, { - "$ref": "#/parameters/apiVersionParameter" + "$ref": "#/parameters/scopeCreditsParameter" } ], "responses": { @@ -4796,6 +4796,16 @@ "EventProperties": { "description": "The event properties.", "properties": { + "creditCurrency": { + "description": "Credit Currency", + "type": "string", + "readOnly": true + }, + "billingCurrency": { + "description": "Billing Currency.", + "type": "string", + "readOnly": true + }, "transactionDate": { "description": "Transaction date.", "type": "string", @@ -4812,26 +4822,51 @@ "readOnly": true, "$ref": "#/definitions/amount" }, + "newCreditInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "adjustments": { "description": "Adjustments amount.", "readOnly": true, "$ref": "#/definitions/amount" }, + "adjustmentsInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "creditExpired": { "description": "Credit expired.", "readOnly": true, "$ref": "#/definitions/amount" }, + "creditExpiredInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "charges": { "description": "Charges amount.", "readOnly": true, "$ref": "#/definitions/amount" }, + "chargesInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "closedBalance": { "description": "Closed balance.", "readOnly": true, "$ref": "#/definitions/amount" }, + "closedBalanceInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "eventType": { "description": "The type of event.", "type": "string", @@ -4853,6 +4888,11 @@ "description": "Invoice number.", "type": "string", "readOnly": true + }, + "reseller": { + "description": "Reseller details.", + "readOnly": true, + "$ref": "#/definitions/Reseller" } } }, @@ -4893,16 +4933,36 @@ "LotProperties": { "description": "The lot properties.", "properties": { + "creditCurrency": { + "description": "Credit Currency", + "type": "string", + "readOnly": true + }, + "billingCurrency": { + "description": "Billing Currency.", + "type": "string", + "readOnly": true + }, "originalAmount": { "description": "Original amount.", "readOnly": true, "$ref": "#/definitions/amount" }, + "originalAmountInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "closedBalance": { "description": "Closed balance.", "readOnly": true, "$ref": "#/definitions/amount" }, + "closedBalanceInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, "source": { "description": "Lot source.", "type": "string", @@ -4932,6 +4992,11 @@ "description": "PO number.", "type": "string", "readOnly": true + }, + "reseller": { + "description": "Reseller details.", + "readOnly": true, + "$ref": "#/definitions/Reseller" } } }, @@ -4955,6 +5020,16 @@ "description": "The properties of the credit summary.", "type": "object", "properties": { + "creditCurrency": { + "description": "Credit Currency", + "type": "string", + "readOnly": true + }, + "billingCurrency": { + "description": "Billing Currency.", + "type": "string", + "readOnly": true + }, "balanceSummary": { "description": "Summary of balances associated with this credit summary.", "readOnly": true, @@ -4974,6 +5049,11 @@ "description": "Pending eligible charges.", "readOnly": true, "$ref": "#/definitions/amount" + }, + "reseller": { + "description": "Reseller details.", + "readOnly": true, + "$ref": "#/definitions/Reseller" } } }, @@ -4989,6 +5069,16 @@ "description": "Current balance.", "readOnly": true, "$ref": "#/definitions/amount" + }, + "estimatedBalanceInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" + }, + "currentBalanceInBillingCurrency": { + "description": "Current balance.", + "readOnly": true, + "$ref": "#/definitions/AmountWithExchangeRate" } } }, @@ -5008,6 +5098,42 @@ } } }, + "AmountWithExchangeRate": { + "description": "Reseller details", + "allOf": [ + { + "$ref": "#/definitions/amount" + } + ], + "properties": { + "exchangeRate": { + "description": "Exchange Rate.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "exchangeRateMonth": { + "description": "Exchange rate month.", + "type": "number", + "readOnly": true + } + } + }, + "Reseller": { + "description": "Reseller details", + "properties": { + "resellerId": { + "description": "Reseller id.", + "type": "string", + "readOnly": true + }, + "resellerDescription": { + "description": "Reseller Description.", + "type": "string", + "readOnly": true + } + } + }, "Resource": { "description": "The Resource model definition.", "properties": { @@ -5122,6 +5248,33 @@ "x-ms-parameter-location": "method", "x-ms-skip-url-encoding": true }, + "scopeCreditsParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with credits operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for Billing Profile scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "scopeEventsParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with events operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for Billing Profile scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "scopeLotsParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with Lots operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for Billing Profile scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, "scopeUsageDetailsParameter": { "name": "scope", "in": "path", diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json index 77dd075699c9..d1a10bbde661 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json @@ -1,8 +1,7 @@ { "parameters": { "api-version": "2019-10-01", - "billingAccountId": "1234:5678", - "billingProfileId": "2468" + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468" }, "responses": { "200": { diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json new file mode 100644 index 000000000000..0dc6315f17fe --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json @@ -0,0 +1,57 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/customers/2468" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/customers/2468/providers/Microsoft.Consumption/credits/balanceSummary1", + "name": "balanceSummary1", + "type": "Microsoft.Consumption/credits/balanceSummary", + "properties": { + "creditCurrency": "USD", + "billingCurrency": "USD", + "balanceSummary": { + "estimatedBalance": { + "currency": "USD", + "value": 600.00 + }, + "estimatedBalanceInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "", + "value": 5486.739600000003 + }, + "currentBalance": { + "currency": "USD", + "value": 100.00 + }, + "currentBalanceInBillingCurrency": { + "exchangeRate": 0, + "exchangeRateMonth": 202101, + "currency": "", + "value": 7342.250000000026 + } + }, + "pendingCreditAdjustments": { + "currency": "USD", + "value": 500.00 + }, + "expiredCredit": { + "currency": "USD", + "value": 0.00 + }, + "pendingEligibleCharges": { + "currency": "USD", + "value": 0.00 + }, + "reseller": { + "resellerId": "55258", + "resellerDescription": "Reseller" + } + } + } + } + } +} diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByBillingProfile.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByBillingProfile.json index 636924d3b392..c19fbf0f2a98 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByBillingProfile.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByBillingProfile.json @@ -1,8 +1,7 @@ { "parameters": { "api-version": "2019-10-01", - "billingAccountId": "1234:5678", - "billingProfileId": "4268", + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/4268", "startDate": "2019-09-01", "endDate": "2019-10-31" }, diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByCustomer.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByCustomer.json new file mode 100644 index 000000000000..a5ff114bfa66 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/EventsListByCustomer.json @@ -0,0 +1,150 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/customers/4268", + "startDate": "2019-09-01", + "endDate": "2019-10-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/customers/4268/providers/Microsoft.Consumption/events/event1", + "name": "event1", + "type": "Microsoft.Consumption/events", + "properties": { + "transactionDate": "2021-03-09T00:00:00Z", + "description": "", + "creditCurrency": "USD", + "billingCurrency": "USD", + "reseller": { + "resellerId": "123558", + "resellerDescription": "Reseller" + }, + "newCredit": { + "currency": "USD", + "value": 0 + }, + "newCreditInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "adjustments": { + "currency": "USD", + "value": 0 + }, + "adjustmentsInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "creditExpired": { + "currency": "USD", + "value": 0 + }, + "creditExpiredInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "charges": { + "currency": "USD", + "value": -24.16 + }, + "chargesInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": -1747.8854000000008 + }, + "closedBalance": { + "currency": "USD", + "value": 75.84 + }, + "closedBalanceInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 5594.364600000025 + }, + "eventType": "PendingCharges", + "invoiceNumber": "D9875F908" + } + }, + { + "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/customers/4268/providers/Microsoft.Consumption/events/event2", + "name": "event2", + "type": "Microsoft.Consumption/events", + "properties": { + "transactionDate": "2021-03-09T00:00:00Z", + "description": "", + "creditCurrency": "USD", + "billingCurrency": "USD", + "reseller": { + "resellerId": "123558", + "resellerDescription": "Reseller" + }, + "newCredit": { + "currency": "USD", + "value": 0 + }, + "newCreditInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "adjustments": { + "currency": "USD", + "value": 0 + }, + "adjustmentsInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "creditExpired": { + "currency": "USD", + "value": 0 + }, + "creditExpiredInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 0 + }, + "charges": { + "currency": "USD", + "value": -24.16 + }, + "chargesInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": -1747.8854000000008 + }, + "closedBalance": { + "currency": "USD", + "value": 75.84 + }, + "closedBalanceInBillingCurrency": { + "exchangeRate": 72.34625000000003, + "exchangeRateMonth": 202103, + "currency": "USD", + "value": 5594.364600000025 + }, + "eventType": "PendingCharges", + "invoiceNumber": "D9875F908" + } + } + ] + } + } + } +} diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByBillingProfile.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByBillingProfile.json index 323660d282cd..6a158689af87 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByBillingProfile.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByBillingProfile.json @@ -1,8 +1,7 @@ { "parameters": { "api-version": "2019-10-01", - "billingAccountId": "1234:5678", - "billingProfileId": "2468" + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468" }, "responses": { "200": { diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByCustomer.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByCustomer.json new file mode 100644 index 000000000000..5e66e677f170 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/LotsListByCustomer.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "scope": "providers/Microsoft.Billing/billingAccounts/1234:5678/customers/2468" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProficustomersles/2468/providers/Microsoft.Consumption/lots/lot1", + "name": "lot1", + "type": "Microsoft.Consumption/lots", + "properties": { + "originalAmount": { + "currency": "USD", + "value": 5000.00 + }, + "originalAmountInBillingCurrency": { + "exchangeRate": 73.42250000000027, + "exchangeRateMonth": 202101, + "currency": "", + "value": 7342.250000000026 + }, + "closedBalance": { + "currency": "USD", + "value": 60.90 + }, + "closedBalanceInBillingCurrency": { + "exchangeRate": 73.42250000000027, + "exchangeRateMonth": 202101, + "currency": "", + "value": 7342.250000000026 + }, + "source": "PurchasedCredit", + "startDate": "2019-10-01T00:00:00Z", + "expirationDate": "2019-11-01T00:00:00Z", + "poNumber": "3524" + } + }, + { + "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/lots/lot2", + "name": "lot2", + "type": "Microsoft.Consumption/lots", + "properties": { + "originalAmount": { + "currency": "USD", + "value": 6000.00 + }, + "originalAmountInBillingCurrency": { + "exchangeRate": 73.42250000000027, + "exchangeRateMonth": 202101, + "currency": "", + "value": 7342.250000000026 + }, + "closedBalance": { + "currency": "USD", + "value": 80.90 + }, + "closedBalanceInBillingCurrency": { + "exchangeRate": 73.42250000000027, + "exchangeRateMonth": 202101, + "currency": "", + "value": 7342.250000000026 + }, + "source": "PurchasedCredit", + "startDate": "2019-11-01T00:00:00Z", + "expirationDate": "2019-12-31T00:00:00Z", + "poNumber": "31224" + } + } + ] + } + } + } +}