diff --git a/cost/v1/cost.proto b/cost/v1/cost.proto index 9bac5e14..b9d055d8 100644 --- a/cost/v1/cost.proto +++ b/cost/v1/cost.proto @@ -582,6 +582,13 @@ service Cost { }; } + // Synchronously checks billing readiness without triggering an export, email, or long-running operation. + rpc GetInvoiceReadiness(GetInvoiceReadinessRequest) returns (GetInvoiceReadinessResponse) { + option (google.api.http) = { + get: "/v1/{vendor}/reports/invoicereadiness" + }; + } + // Get the utilization details for an organization (or MSP). rpc GetUtilization(GetUtilizationRequest) returns (GetUtilizationResponse) { option (google.api.http) = { @@ -1905,6 +1912,25 @@ message AwsExportReportOptions { map columns_by_query = 5; } +// Request message for GetInvoiceReadiness. +message GetInvoiceReadinessRequest { + // Required. Bound from the URL path, so it cannot be empty/omitted. + // Accepted values: "aws", "gcp", "azure". + string vendor = 1; + + // Required. Billing month in YYYY-MM format. + string month = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for GetInvoiceReadiness. +message GetInvoiceReadinessResponse { + // True if all usage for the requested month has an invoice ID (billing is finalized). + bool ready = 1; + + // Human-readable explanation when ready is false. Empty when ready is true. + string reason = 2; +} + // Request message for GetUtilization message GetUtilizationRequest { // Required. At the moment, only `aws` is supported. diff --git a/openapiv2/apidocs.swagger.json b/openapiv2/apidocs.swagger.json index e418ecf4..a0ccbacb 100644 --- a/openapiv2/apidocs.swagger.json +++ b/openapiv2/apidocs.swagger.json @@ -21636,6 +21636,45 @@ ] } }, + "/v1/{vendor}/reports/invoicereadiness": { + "get": { + "summary": "Synchronously checks billing readiness without triggering an export, email, or long-running operation.", + "operationId": "Cost_GetInvoiceReadiness", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetInvoiceReadinessResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "vendor", + "description": "Required. Bound from the URL path, so it cannot be empty/omitted.\nAccepted values: \"aws\", \"gcp\", \"azure\".", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "month", + "description": "Required. Billing month in YYYY-MM format.", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": [ + "Cost" + ] + } + }, "/v1/{vendor}/services": { "get": { "summary": "Lists available cloud services and their associated SKUs for a given vendor.\nUse this to retrieve service codes and names that can be referenced in exclude service settings.", @@ -41945,6 +41984,20 @@ }, "description": "Response message for GetInvoiceDisplaySettings rpc." }, + "v1GetInvoiceReadinessResponse": { + "type": "object", + "properties": { + "ready": { + "type": "boolean", + "description": "True if all usage for the requested month has an invoice ID (billing is finalized)." + }, + "reason": { + "type": "string", + "description": "Human-readable explanation when ready is false. Empty when ready is true." + } + }, + "description": "Response message for GetInvoiceReadiness." + }, "v1GetMSPDefaultMetaResponse": { "type": "object", "properties": {