diff --git a/billing/v1/billing.proto b/billing/v1/billing.proto index 57f49bb1..92dbea30 100644 --- a/billing/v1/billing.proto +++ b/billing/v1/billing.proto @@ -806,55 +806,22 @@ service Billing { }; } - // Validates or imports monthly miscellaneous fees from CSV. - rpc BulkImportMonthlyMiscFees(BulkImportMonthlyMiscFeesRequest) returns (protos.Operation) { + // Validates or imports monthly FreeFormItems from CSV through invoice settings. + rpc BulkImportMonthlyMiscFees(BulkImportMonthlyMiscFeesRequest) returns (MonthlyMiscFeeImportResult) { option (google.api.http) = { post: "/v1/monthly-misc-fees:bulkImport" body: "*" }; } - // Lists monthly miscellaneous fee rows. + // Lists effective monthly FreeFormItems. rpc ListMonthlyMiscFees(ListMonthlyMiscFeesRequest) returns (ListMonthlyMiscFeesResponse) { option (google.api.http) = { get: "/v1/monthly-misc-fees" }; } - // Gets a monthly miscellaneous fee row. - rpc GetMonthlyMiscFee(GetMonthlyMiscFeeRequest) returns (MonthlyMiscFee) { - option (google.api.http) = { - get: "/v1/monthly-misc-fees/{row_id}" - }; - } - - // Exports monthly miscellaneous fee rows using the list filters. - rpc ExportMonthlyMiscFees(ExportMonthlyMiscFeesRequest) returns (ExportMonthlyMiscFeesResponse) { - option (google.api.http) = { - get: "/v1/monthly-misc-fees:export" - }; - } - - // Gets a completed monthly miscellaneous fee import result. - rpc GetMonthlyMiscFeeImport(GetMonthlyMiscFeeImportRequest) returns (MonthlyMiscFeeImportResult) { - option (google.api.http) = { - get: "/v1/monthly-misc-fee-imports/{import_job_id}" - }; - } - - // Creates or updates a monthly miscellaneous fee row. - rpc UpsertMonthlyMiscFee(UpsertMonthlyMiscFeeRequest) returns (MonthlyMiscFee) { - option (google.api.http) = { - put: "/v1/monthly-misc-fees/{row_id}" - body: "*" - additional_bindings: { - put: "/v1/monthly-misc-fees" - body: "*" - } - }; - } - - // Deletes a monthly miscellaneous fee row. + // Deletes one monthly FreeFormItem through invoice settings. rpc DeleteMonthlyMiscFee(DeleteMonthlyMiscFeeRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/monthly-misc-fees/{row_id}" @@ -2914,99 +2881,44 @@ message GetFreeFormatResponse { } message GetMonthlyMiscFeeImportTemplateRequest { - // Optional. Template language. Supported values are "en" and "ja". Empty uses the caller's language or server default. + // Optional. Template language. Supported values are "en" and "ja". string language = 1; } message MonthlyMiscFeeImportTemplate { - // Supported import format. Currently "csv". string format = 1; - - // Supported format version. Currently "misc_fee_import_v1". string format_version = 2; - - // CSV header columns in required order. repeated string headers = 3; - - // Example CSV row matching the current format version. repeated string sample_row = 4; - - // Supported modes: "dry-run", "replace-month", and "merge". repeated string allowed_modes = 5; - - // Maximum upload size in bytes. int64 max_file_size_bytes = 6; - - // Maximum data rows accepted per CSV file. int32 max_rows = 7; - - // Field-level validation rules for UI guidance. - repeated MonthlyMiscFeeImportFieldRule field_rules = 8; -} - -message MonthlyMiscFeeImportFieldRule { - string field = 1; - bool required = 2; - string format = 3; - string description = 4; } message BulkImportMonthlyMiscFeesRequest { - // Required. Selected billing cycle in YYYY-MM form; YYYYMM is accepted and normalized by the server. + // Required. Selected billing cycle in YYYY-MM form; YYYYMM is normalized. string billing_month = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Uploaded CSV content as normalized UTF-8 text. string csv_content = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Original upload file name for audit metadata. + // Required. Original upload file name for audit and result display. string file_name = 3 [(google.api.field_behavior) = REQUIRED]; - // Required. One of "dry-run", "replace-month", or "merge". Empty defaults to "dry-run". - string mode = 4; + // Required. "dry-run" validates only; "merge" upserts FreeFormItems by label. + string mode = 4 [(google.api.field_behavior) = REQUIRED]; - // Required. Import format. Currently "csv". string format = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Import format version. Currently "misc_fee_import_v1". string format_version = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Idempotency key for write-mode imports. - string idempotency_key = 7; } message ListMonthlyMiscFeesRequest { - // Required. Billing cycle in YYYY-MM form; YYYYMM is accepted and normalized by the server. string billing_month = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Exact billing group ID filter. string billing_group_id = 2; - - // Optional. Case-insensitive billing group name query. string billing_group_name_query = 3; - - // Optional. Case-insensitive item or fee tag query. string item_query = 4; - - // Optional. Source filter, e.g. "csv", "ui", or "migration". - string source = 5; - - // Optional. User identifier that last updated the row. - string updated_by = 6; - - // Optional. RFC3339 lower bound for updated_at. - string updated_after = 7; - - // Optional. RFC3339 upper bound for updated_at. - string updated_before = 8; - - // Optional. Page size for pagination. Default and maximum are server-defined. - int32 page_size = 9; - - // Optional. Opaque page token from a previous response. - string page_token = 10; - - // Optional. Stable sort expression. Defaults to billing_group_name, item_name, row_id. - string sort = 11; + int32 page_size = 5; + string page_token = 6; } message ListMonthlyMiscFeesResponse { @@ -3015,75 +2927,9 @@ message ListMonthlyMiscFeesResponse { int32 total_count = 3; } -message GetMonthlyMiscFeeRequest { - // Required. Server-owned row ID. - string row_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Billing month used to reject cross-month access or mutation mistakes. - string billing_month = 2 [(google.api.field_behavior) = REQUIRED]; -} - -message ExportMonthlyMiscFeesRequest { - // Required. Billing cycle in YYYY-MM form; YYYYMM is accepted and normalized by the server. - string billing_month = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Exact billing group ID filter. - string billing_group_id = 2; - - // Optional. Case-insensitive billing group name query. - string billing_group_name_query = 3; - - // Optional. Case-insensitive item or fee tag query. - string item_query = 4; - - // Optional. Source filter, e.g. "csv", "ui", or "migration". - string source = 5; - - // Optional. User identifier that last updated the row. - string updated_by = 6; - - // Optional. RFC3339 lower bound for updated_at. - string updated_after = 7; - - // Optional. RFC3339 upper bound for updated_at. - string updated_before = 8; - - // Optional. Stable sort expression. Defaults to billing_group_name, item_name, row_id. - string sort = 9; -} - -message ExportMonthlyMiscFeesResponse { - // CSV file bytes when the export is returned inline. - bytes csv_content = 1; - - // Optional staged export reference or direct download URL. - string export_ref = 2; - - // Export file name suggested to clients. - string file_name = 3; -} - -message GetMonthlyMiscFeeImportRequest { - // Required. Import job ID returned by BulkImportMonthlyMiscFees. - string import_job_id = 1 [(google.api.field_behavior) = REQUIRED]; -} - -message UpsertMonthlyMiscFeeRequest { - // Optional for create, required for updating an existing server-owned row. - string row_id = 1; - - // Required. Full row value to create or update. - MonthlyMiscFee row = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Idempotency key for UI retry safety. - string idempotency_key = 3; -} - message DeleteMonthlyMiscFeeRequest { - // Required. Server-owned row ID. + // An opaque ID returned by ListMonthlyMiscFees. string row_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Billing month used to reject cross-month deletion mistakes. string billing_month = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -3092,60 +2938,41 @@ message MonthlyMiscFee { string billing_month = 2; string billing_group_id = 3; string billing_group_name = 4; - string item_name = 5; - string quantity = 6; - string unit_cost = 7; - string amount = 8; - string source = 9; - string import_job_id = 10; - string created_by = 11; - string created_at = 12; - string updated_by = 13; - string updated_at = 14; + string vendor = 5; + string item_name = 6; + uint32 quantity = 7; + int64 unit_cost = 8; + int64 amount = 9; + bool enabled = 10; + // One of "saved", "created", or "default". + string source = 11; } message MonthlyMiscFeeImportResult { - string import_job_id = 1; - string status = 2; - string mode = 3; - string billing_month = 4; - string file_name = 5; - string file_hash = 6; - int32 total_rows = 7; - int32 valid_rows = 8; - int32 inserted_rows = 9; - int32 updated_rows = 10; - int32 unchanged_rows = 11; - int32 deleted_rows = 12; - int32 failed_rows = 13; - int32 replace_month_existing_rows = 14; - string export_ref = 15; - repeated MonthlyMiscFeeImportRowResult row_results = 16; - string created_by = 17; - string created_at = 18; - string updated_at = 19; + string status = 1; + string billing_month = 2; + string file_name = 3; + int32 total_rows = 4; + int32 valid_rows = 5; + int32 inserted_rows = 6; + int32 updated_rows = 7; + int32 unchanged_rows = 8; + int32 failed_rows = 9; + repeated MonthlyMiscFeeImportRowResult row_results = 10; } message MonthlyMiscFeeImportRowResult { int32 csv_row_number = 1; string action = 2; - string row_id = 3; - string billing_month = 4; - string billing_group_id = 5; - string billing_group_name = 6; - string item_name = 7; - string quantity = 8; - string unit_cost = 9; - string amount = 10; - MonthlyMiscFeeImportPreviousValue previous_value = 11; - repeated MonthlyMiscFeeValidationError validation_errors = 12; - string note = 13; -} - -message MonthlyMiscFeeImportPreviousValue { - string quantity = 1; - string unit_cost = 2; - string amount = 3; + string billing_group_id = 3; + string billing_group_name = 4; + string vendor = 5; + string item_name = 6; + uint32 quantity = 7; + int64 unit_cost = 8; + int64 amount = 9; + bool enabled = 10; + repeated MonthlyMiscFeeValidationError validation_errors = 11; } message MonthlyMiscFeeValidationError { diff --git a/openapiv2/apidocs.swagger.json b/openapiv2/apidocs.swagger.json index 6ab49df8..6ef43c4d 100644 --- a/openapiv2/apidocs.swagger.json +++ b/openapiv2/apidocs.swagger.json @@ -12338,38 +12338,6 @@ ] } }, - "/v1/monthly-misc-fee-imports/{importJobId}": { - "get": { - "summary": "Gets a completed monthly miscellaneous fee import result.", - "operationId": "Billing_GetMonthlyMiscFeeImport", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1MonthlyMiscFeeImportResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "importJobId", - "description": "Required. Import job ID returned by BulkImportMonthlyMiscFees.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Billing" - ] - } - }, "/v1/monthly-misc-fees": { "get": { "summary": "Lists monthly miscellaneous fee rows.", @@ -12417,34 +12385,6 @@ "required": false, "type": "string" }, - { - "name": "source", - "description": "Optional. Source filter, e.g. \"csv\", \"ui\", or \"migration\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedBy", - "description": "Optional. User identifier that last updated the row.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedAfter", - "description": "Optional. RFC3339 lower bound for updated_at.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedBefore", - "description": "Optional. RFC3339 upper bound for updated_at.", - "in": "query", - "required": false, - "type": "string" - }, { "name": "pageSize", "description": "Optional. Page size for pagination. Default and maximum are server-defined.", @@ -12459,44 +12399,6 @@ "in": "query", "required": false, "type": "string" - }, - { - "name": "sort", - "description": "Optional. Stable sort expression. Defaults to billing_group_name, item_name, row_id.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "Billing" - ] - }, - "put": { - "summary": "Creates or updates a monthly miscellaneous fee row.", - "operationId": "Billing_UpsertMonthlyMiscFee2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1MonthlyMiscFee" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpsertMonthlyMiscFeeRequest" - } } ], "tags": [ @@ -12505,43 +12407,6 @@ } }, "/v1/monthly-misc-fees/{rowId}": { - "get": { - "summary": "Gets a monthly miscellaneous fee row.", - "operationId": "Billing_GetMonthlyMiscFee", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1MonthlyMiscFee" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "rowId", - "description": "Required. Server-owned row ID.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "billingMonth", - "description": "Required. Billing month used to reject cross-month access or mutation mistakes.", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "Billing" - ] - }, "delete": { "summary": "Deletes a monthly miscellaneous fee row.", "operationId": "Billing_DeleteMonthlyMiscFee", @@ -12579,44 +12444,6 @@ "tags": [ "Billing" ] - }, - "put": { - "summary": "Creates or updates a monthly miscellaneous fee row.", - "operationId": "Billing_UpsertMonthlyMiscFee", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1MonthlyMiscFee" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "rowId", - "description": "Optional for create, required for updating an existing server-owned row.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/BillingUpsertMonthlyMiscFeeBody" - } - } - ], - "tags": [ - "Billing" - ] } }, "/v1/monthly-misc-fees:bulkImport": { @@ -12627,7 +12454,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/protosOperation" + "$ref": "#/definitions/v1MonthlyMiscFeeImportResult" } }, "default": { @@ -12652,94 +12479,6 @@ ] } }, - "/v1/monthly-misc-fees:export": { - "get": { - "summary": "Exports monthly miscellaneous fee rows using the list filters.", - "operationId": "Billing_ExportMonthlyMiscFees", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ExportMonthlyMiscFeesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "billingMonth", - "description": "Required. Billing cycle in YYYY-MM form; YYYYMM is accepted and normalized by the server.", - "in": "query", - "required": true, - "type": "string" - }, - { - "name": "billingGroupId", - "description": "Optional. Exact billing group ID filter.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "billingGroupNameQuery", - "description": "Optional. Case-insensitive billing group name query.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "itemQuery", - "description": "Optional. Case-insensitive item or fee tag query.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "source", - "description": "Optional. Source filter, e.g. \"csv\", \"ui\", or \"migration\".", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedBy", - "description": "Optional. User identifier that last updated the row.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedAfter", - "description": "Optional. RFC3339 lower bound for updated_at.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "updatedBefore", - "description": "Optional. RFC3339 upper bound for updated_at.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "sort", - "description": "Optional. Stable sort expression. Defaults to billing_group_name, item_name, row_id.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "Billing" - ] - } - }, "/v1/monthly-misc-fees:importTemplate": { "get": { "summary": "Gets the CSV template metadata for monthly miscellaneous fees.", @@ -23941,22 +23680,6 @@ }, "title": "BillingGroup tags adding setting" }, - "BillingUpsertMonthlyMiscFeeBody": { - "type": "object", - "properties": { - "row": { - "$ref": "#/definitions/v1MonthlyMiscFee", - "description": "Required. Full row value to create or update." - }, - "idempotencyKey": { - "type": "string", - "description": "Optional. Idempotency key for UI retry safety." - } - }, - "required": [ - "row" - ] - }, "ContainerCostUsageRequestFilterCriteria": { "type": "object", "properties": { @@ -36694,6 +36417,7 @@ "billingMonth", "csvContent", "fileName", + "mode", "format", "formatVersion" ] @@ -40838,24 +40562,6 @@ }, "description": "Response message for the ExportBillingGroupCsv rpc." }, - "v1ExportMonthlyMiscFeesResponse": { - "type": "object", - "properties": { - "csvContent": { - "type": "string", - "format": "byte", - "description": "CSV file bytes when the export is returned inline." - }, - "exportRef": { - "type": "string", - "description": "Optional staged export reference or direct download URL." - }, - "fileName": { - "type": "string", - "description": "Export file name suggested to clients." - } - } - }, "v1ExportReportRequest": { "type": "object", "properties": { @@ -44840,65 +44546,28 @@ "billingGroupName": { "type": "string" }, + "vendor": { + "type": "string" + }, "itemName": { "type": "string" }, "quantity": { - "type": "string" + "type": "integer", + "format": "int64" }, "unitCost": { - "type": "string" + "type": "string", + "format": "int64" }, "amount": { - "type": "string" - }, - "source": { - "type": "string" - }, - "importJobId": { - "type": "string" - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedBy": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "v1MonthlyMiscFeeImportFieldRule": { - "type": "object", - "properties": { - "field": { - "type": "string" + "type": "string", + "format": "int64" }, - "required": { + "enabled": { "type": "boolean" }, - "format": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "v1MonthlyMiscFeeImportPreviousValue": { - "type": "object", - "properties": { - "quantity": { - "type": "string" - }, - "unitCost": { - "type": "string" - }, - "amount": { + "source": { "type": "string" } } @@ -44906,24 +44575,15 @@ "v1MonthlyMiscFeeImportResult": { "type": "object", "properties": { - "importJobId": { - "type": "string" - }, "status": { "type": "string" }, - "mode": { - "type": "string" - }, "billingMonth": { "type": "string" }, "fileName": { "type": "string" }, - "fileHash": { - "type": "string" - }, "totalRows": { "type": "integer", "format": "int32" @@ -44944,36 +44604,16 @@ "type": "integer", "format": "int32" }, - "deletedRows": { - "type": "integer", - "format": "int32" - }, "failedRows": { "type": "integer", "format": "int32" }, - "replaceMonthExistingRows": { - "type": "integer", - "format": "int32" - }, - "exportRef": { - "type": "string" - }, "rowResults": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v1MonthlyMiscFeeImportRowResult" } - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" } } }, @@ -44987,32 +44627,32 @@ "action": { "type": "string" }, - "rowId": { - "type": "string" - }, - "billingMonth": { - "type": "string" - }, "billingGroupId": { "type": "string" }, "billingGroupName": { "type": "string" }, + "vendor": { + "type": "string" + }, "itemName": { "type": "string" }, "quantity": { - "type": "string" + "type": "integer", + "format": "int64" }, "unitCost": { - "type": "string" + "type": "string", + "format": "int64" }, "amount": { - "type": "string" + "type": "string", + "format": "int64" }, - "previousValue": { - "$ref": "#/definitions/v1MonthlyMiscFeeImportPreviousValue" + "enabled": { + "type": "boolean" }, "validationErrors": { "type": "array", @@ -45020,9 +44660,6 @@ "type": "object", "$ref": "#/definitions/v1MonthlyMiscFeeValidationError" } - }, - "note": { - "type": "string" } } }, @@ -45067,14 +44704,6 @@ "type": "integer", "format": "int32", "description": "Maximum data rows accepted per CSV file." - }, - "fieldRules": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1MonthlyMiscFeeImportFieldRule" - }, - "description": "Field-level validation rules for UI guidance." } } }, @@ -48596,26 +48225,6 @@ }, "description": "Response message for the Iam.UpsertExperimentalUIPreference rpc." }, - "v1UpsertMonthlyMiscFeeRequest": { - "type": "object", - "properties": { - "rowId": { - "type": "string", - "description": "Optional for create, required for updating an existing server-owned row." - }, - "row": { - "$ref": "#/definitions/v1MonthlyMiscFee", - "description": "Required. Full row value to create or update." - }, - "idempotencyKey": { - "type": "string", - "description": "Optional. Idempotency key for UI retry safety." - } - }, - "required": [ - "row" - ] - }, "v1UsageCostDetails": { "type": "object", "properties": {