Skip to content

Commit 2aba484

Browse files
Google APIscopybara-github
authored andcommitted
feat: a new field base64_encoded_name is added to the Product message
feat: new fields - `base64_encoded_name` and `base64_encoded_product` added to the `ProductInput` message docs: A comment for field `name` in message `.google.shopping.merchant.products.v1.ProductInput` is changed docs: A comment for field `name` in message `.google.shopping.merchant.products.v1.Product` is changed PiperOrigin-RevId: 896968813
1 parent 9a832cc commit 2aba484

3 files changed

Lines changed: 53 additions & 19 deletions

File tree

google/shopping/merchant/products/v1/productinputs.proto

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ message ProductInput {
138138
// MUST be used if any part of the product identifier (like `offer_id`)
139139
// contains characters such as `/`, `%`, or `~`.
140140
// * Example: To represent the product ID `en~US~sku/123`, the
141-
// `{productinput}` segment must be the base64url encoding of this
142-
// string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name
141+
// `{productinput}` segment must be the unpadded base64url encoding of
142+
// this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
143143
// for the product would be
144-
// `accounts/123/productinputs/ZW5-VVMtc2t1LzEyMw`.
144+
// `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw`.
145145
//
146146
// 2. **Plain Format**: The `{productinput}` segment is the tilde-separated
147147
// string
@@ -153,16 +153,36 @@ message ProductInput {
153153
// correct parsing, especially those containing special characters. The
154154
// presence of tilde (`~`) characters in the `{productinput}` segment is used
155155
// to differentiate between the two formats.
156-
//
157-
// Note: For calls to the v1beta version, the plain format is
158-
// `channel~content_language~feed_label~offer_id`, for example:
159-
// `accounts/123/productinputs/online~en~US~sku123`.
160156
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
161157

158+
// Output only. The **unpadded base64url encoded name** of the product input.
159+
// Format:
160+
// `accounts/{account}/productInputs/{productinput}` where the last
161+
// section `productinput` is the unpadded base64url encoding of the
162+
// `content_language~feed_label~offer_id` name.
163+
// Example: `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw` for the decoded
164+
// product input name `accounts/123/productInputs/en~US~sku/123`. This field
165+
// can be used directly as input to the API methods that require the product
166+
// input name to be encoded if it contains special characters, for example
167+
// [`GetProductInput`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/get).
168+
string base64_encoded_name = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
169+
162170
// Output only. The name of the processed product.
163171
// Format: `accounts/{account}/products/{product}`
164172
string product = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
165173

174+
// Output only. The **unpadded base64url encoded name** of the processed
175+
// product. Format: `accounts/{account}/products/{product}` where the last
176+
// section `product` is the unpadded base64url encoding of the
177+
// `content_language~feed_label~offer_id` name.
178+
// Example: `accounts/123/products/ZW5-VVN-c2t1LzEyMw` for the decoded
179+
// product name `accounts/123/products/en~US~sku/123`. This field can be used
180+
// directly as input to the API methods that require the product name to be
181+
// encoded if it contains special characters, for example
182+
// [`GetProduct`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products/get).
183+
string base64_encoded_product = 13
184+
[(google.api.field_behavior) = OUTPUT_ONLY];
185+
166186
// Immutable. Determines whether the product is **only** targeting
167187
// local destinations and whether the product name should be distinguished
168188
// with a `local~` prefix. For example,
@@ -326,10 +346,10 @@ message DeleteProductInputRequest {
326346
// MUST be used if any part of the product identifier (like `offer_id`)
327347
// contains characters such as `/`, `%`, or `~`.
328348
// * Example: To represent the product ID `en~US~sku/123`, the
329-
// `{productInput}` segment must be the base64url encoding of this
330-
// string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name
349+
// `{productInput}` segment must be the unpadded base64url encoding of
350+
// this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
331351
// for the product would be
332-
// `accounts/123/productInputs/ZW5-VVMtc2t1LzEyMw`.
352+
// `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw`.
333353
//
334354
// 2. **Plain Format**: The `{productInput}` segment is the tilde-separated
335355
// string
@@ -341,10 +361,6 @@ message DeleteProductInputRequest {
341361
// correct parsing, especially those containing special characters. The
342362
// presence of tilde (`~`) characters in the `{productInput}` segment is used
343363
// to differentiate between the two formats.
344-
//
345-
// Note: For calls to the v1beta version, the plain format is
346-
// `channel~content_language~feed_label~offer_id`, for example:
347-
// `accounts/123/productinputs/online~en~US~sku123`.
348364
string name = 1 [
349365
(google.api.field_behavior) = REQUIRED,
350366
(google.api.resource_reference) = {

google/shopping/merchant/products/v1/products.proto

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ message Product {
9696
// `accounts/123/products/online~en~US~sku123`.
9797
string name = 1;
9898

99+
// Output only. The **unpadded base64url encoded name** of the product.
100+
// Format:
101+
// `accounts/{account}/products/{product}` where the last
102+
// section `product` is the unpadded base64url encoding of the
103+
// `content_language~feed_label~offer_id` name.
104+
// Example: `accounts/123/products/ZW5-VVN-c2t1LzEyMw` for the decoded product
105+
// name `accounts/123/products/en~US~sku/123`. This field can be used directly
106+
// as input to the API methods that require the product name to be encoded if
107+
// it contains special characters, for example
108+
// [`GetProduct`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products/get).
109+
string base64_encoded_name = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
110+
99111
// Output only. Determines whether the product is **only** targeting
100112
// local destinations and whether the product name should be distinguished
101113
// with a `local~` prefix. For example,
@@ -182,10 +194,10 @@ message GetProductRequest {
182194
// MUST be used if any part of the product identifier (like `offer_id`)
183195
// contains characters such as `/`, `%`, or `~`.
184196
// * Example: To represent the product ID `en~US~sku/123`, the
185-
// `{product}` segment must be the base64url encoding of this
186-
// string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name
197+
// `{product}` segment must be the unpadded base64url encoding of this
198+
// string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
187199
// for the product would be
188-
// `accounts/123/products/ZW5-VVMtc2t1LzEyMw`.
200+
// `accounts/123/products/ZW5-VVN-c2t1LzEyMw`.
189201
//
190202
// 2. **Plain Format**: The `{product}` segment is the tilde-separated string
191203
// `content_language~feed_label~offer_id`. This format is suitable only

google/shopping/merchant/products/v1/products_common.proto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,16 @@ message ProductAttributes {
10141014
// The handling cutoff times for shipping.
10151015
repeated HandlingCutoffTime handling_cutoff_times = 141;
10161016

1017-
// The shipping label of the product, used to group product in account-level
1018-
// shipping rules.
1017+
// The shipping label of the product, used to group products in account-level
1018+
// shipping rules. Max. 100 characters. For more information, see
1019+
// [Shipping label](https://support.google.com/merchants/answer/6324504).
10191020
optional string shipping_label = 46;
10201021

1022+
// The return label of the product, used to group products in account-level
1023+
// return policies. Max. 100 characters. For more information, see
1024+
// [Return policy label](https://support.google.com/merchants/answer/9445425).
1025+
optional string return_policy_label = 170;
1026+
10211027
// The transit time label of the product, used to group product in
10221028
// account-level transit time tables.
10231029
optional string transit_time_label = 47;

0 commit comments

Comments
 (0)