Skip to content

Commit f56dc14

Browse files
feat: [merchantapi] a new field base64_encoded_name is added to the Product message (#7997)
* 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 Source-Link: googleapis/googleapis@2aba484 Source-Link: googleapis/googleapis-gen@820077f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LXByb2R1Y3RzLy5Pd2xCb3QueWFtbCIsImgiOiI4MjAwNzdmOGY5ZDdkZGUwZGEyYzA3MTk3MjA2OGVlOWM1NzQyMWE4In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Gabe Pearhill <86282859+pearigee@users.noreply.github.com>
1 parent 35ba856 commit f56dc14

11 files changed

Lines changed: 225 additions & 39 deletions

File tree

packages/google-shopping-merchant-products/protos/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) = {

packages/google-shopping-merchant-products/protos/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

packages/google-shopping-merchant-products/protos/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;

packages/google-shopping-merchant-products/protos/protos.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,15 @@ export namespace google {
122122
/** ProductInput name */
123123
name?: (string|null);
124124

125+
/** ProductInput base64EncodedName */
126+
base64EncodedName?: (string|null);
127+
125128
/** ProductInput product */
126129
product?: (string|null);
127130

131+
/** ProductInput base64EncodedProduct */
132+
base64EncodedProduct?: (string|null);
133+
128134
/** ProductInput legacyLocal */
129135
legacyLocal?: (boolean|null);
130136

@@ -159,9 +165,15 @@ export namespace google {
159165
/** ProductInput name. */
160166
public name: string;
161167

168+
/** ProductInput base64EncodedName. */
169+
public base64EncodedName: string;
170+
162171
/** ProductInput product. */
163172
public product: string;
164173

174+
/** ProductInput base64EncodedProduct. */
175+
public base64EncodedProduct: string;
176+
165177
/** ProductInput legacyLocal. */
166178
public legacyLocal: boolean;
167179

@@ -934,6 +946,9 @@ export namespace google {
934946
/** ProductAttributes shippingLabel */
935947
shippingLabel?: (string|null);
936948

949+
/** ProductAttributes returnPolicyLabel */
950+
returnPolicyLabel?: (string|null);
951+
937952
/** ProductAttributes transitTimeLabel */
938953
transitTimeLabel?: (string|null);
939954

@@ -1232,6 +1247,9 @@ export namespace google {
12321247
/** ProductAttributes shippingLabel. */
12331248
public shippingLabel?: (string|null);
12341249

1250+
/** ProductAttributes returnPolicyLabel. */
1251+
public returnPolicyLabel?: (string|null);
1252+
12351253
/** ProductAttributes transitTimeLabel. */
12361254
public transitTimeLabel?: (string|null);
12371255

@@ -4521,6 +4539,9 @@ export namespace google {
45214539
/** Product name */
45224540
name?: (string|null);
45234541

4542+
/** Product base64EncodedName */
4543+
base64EncodedName?: (string|null);
4544+
45244545
/** Product legacyLocal */
45254546
legacyLocal?: (boolean|null);
45264547

@@ -4564,6 +4585,9 @@ export namespace google {
45644585
/** Product name. */
45654586
public name: string;
45664587

4588+
/** Product base64EncodedName. */
4589+
public base64EncodedName: string;
4590+
45674591
/** Product legacyLocal. */
45684592
public legacyLocal: boolean;
45694593

0 commit comments

Comments
 (0)