Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions billing/v1/billing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ service Billing {
};
}

// Create billing group in bulk
// Create billing group in bulk from CSV file
rpc BulkCreateBillingGroup(BulkCreateBillingGroupRequest) returns (stream BulkCreateBillingGroupResponse) {
option (google.api.http) = {
post: "/v1/billinggroups:bulkCreate"
Expand Down Expand Up @@ -3431,8 +3431,14 @@ message SetChildBillingGroupInvoiceServiceDiscountsRequest {
}

message BulkCreateBillingGroupRequest {
// Required. The list of billing group to create.
repeated CreateBillingGroupRequest request = 1;
// Required. The CSV file content as bytes.
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this RPC is exposed over HTTP/JSON (google.api.http with body: "*"), bytes csvContent will be base64-encoded in JSON requests. The field comment currently reads like raw CSV can be sent directly; consider clarifying the JSON/base64 requirement (and/or using a more upload-oriented pattern like google.api.HttpBody if the intent is to accept raw CSV via REST).

Suggested change
// Required. The CSV file content as bytes.
// Required. The CSV file content as bytes.
//
// Note: When this RPC is called over HTTP/JSON (for example, using
// `google.api.http` with `body: "*"`) this field MUST be sent as a
// base64-encoded string in the JSON request body, as per protobuf JSON
// mapping rules for `bytes` fields.

Copilot uses AI. Check for mistakes.
bytes csvContent = 1;

// Optional. The delimiter used in the CSV file. Defaults to comma (,).
string delimiter = 2;

// Optional. Whether the CSV file has a header row. Defaults to true.
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says hasHeader defaults to true, but in proto3 a plain bool defaults to false and you cannot detect “unset” vs “false” without presence. If you need a default of true, make this field optional bool hasHeader = 3; (and treat unset as true), or use google.protobuf.BoolValue, or update the documentation to reflect the actual default behavior.

Suggested change
// Optional. Whether the CSV file has a header row. Defaults to true.
// Optional. Whether the CSV file has a header row. Defaults to false.

Copilot uses AI. Check for mistakes.
bool hasHeader = 3;
Comment on lines +3434 to +3441
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BulkCreateBillingGroupRequest reuses field number 1 but changes its type/meaning from repeated CreateBillingGroupRequest request = 1 to bytes csvContent = 1. This is wire-incompatible: existing clients will still send length-delimited field 1 values that will now be interpreted as raw bytes (serialized sub-messages), likely causing CSV parsing failures. Keep the old field number/type (or reserve it) and introduce new CSV-related fields with new numbers, or use a oneof to support both formats without breaking existing clients.

Suggested change
// Required. The CSV file content as bytes.
bytes csvContent = 1;
// Optional. The delimiter used in the CSV file. Defaults to comma (,).
string delimiter = 2;
// Optional. Whether the CSV file has a header row. Defaults to true.
bool hasHeader = 3;
// Supported input formats for bulk creation.
oneof input {
// Backward-compatible: list of individual create requests.
repeated CreateBillingGroupRequest requests = 1;
// Required. The CSV file content as bytes.
bytes csvContent = 2;
}
// Optional. The delimiter used in the CSV file. Defaults to comma (,).
string delimiter = 3;
// Optional. Whether the CSV file has a header row. Defaults to true.
bool hasHeader = 4;

Copilot uses AI. Check for mistakes.
}

message BulkCreateBillingGroupResponse {
Expand Down
Loading