Skip to content

Commit 20581e0

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added the product_id_base64_url_encoded field to InsertProductInputRequest, DeleteProductInputRequest, and GetProductRequest. This allows for product IDs containing special characters to be correctly handled when unpadded base64url-encoded
feat: Added `handling_cutoff_time` and `handling_cutoff_timezone` fields to the `Shipping` message within `Attributes` feat: Added C#, PHP, and Ruby namespace options to ProductInputs, Products, and ProductsCommon proto files for improved client library generation docs: Updated comments for several fields, including product name formats, data source creation, destination field descriptions (now also referred to as Marketing Methods), and the default page size for `ListProductsRequest` PiperOrigin-RevId: 830818171
1 parent 3568ce2 commit 20581e0

File tree

3 files changed

+115
-32
lines changed

3 files changed

+115
-32
lines changed

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

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,29 @@ import "google/protobuf/field_mask.proto";
2525
import "google/shopping/merchant/products/v1beta/products_common.proto";
2626
import "google/shopping/type/types.proto";
2727

28+
option csharp_namespace = "Google.Shopping.Merchant.Products.V1Beta";
2829
option go_package = "cloud.google.com/go/shopping/merchant/products/apiv1beta/productspb;productspb";
2930
option java_multiple_files = true;
3031
option java_outer_classname = "ProductInputsProto";
3132
option java_package = "com.google.shopping.merchant.products.v1beta";
33+
option php_namespace = "Google\\Shopping\\Merchant\\Products\\V1beta";
34+
option ruby_package = "Google::Shopping::Merchant::Products::V1beta";
3235

3336
// Service to use ProductInput resource.
34-
// This service works for products with online channel only.
3537
service ProductInputsService {
3638
option (google.api.default_host) = "merchantapi.googleapis.com";
3739
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
3840

3941
// [Uploads a product input to your Merchant Center
40-
// account](/merchant/api/guides/products/overview#upload-product-input). You
41-
// must have a products data source to be able to insert a product. The unique
42-
// identifier of the data source is passed as a query parameter in the request
43-
// URL.
42+
// account](/merchant/api/guides/products/add-manage#add_a_product). You
43+
// must have a products [data
44+
// source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source)
45+
// to be able to insert a product. The unique identifier of the data source is
46+
// passed as a query parameter in the request URL.
4447
//
45-
// If an input with the same contentLanguage, offerId, and dataSource already
46-
// exists, this method replaces that entry.
48+
// If a product input with the same contentLanguage, offerId, and dataSource
49+
// already exists, then the product input inserted by this method replaces
50+
// that entry.
4751
//
4852
// After inserting, updating, or deleting a product input, it may take several
4953
// minutes before the processed product can be retrieved.
@@ -115,10 +119,14 @@ message ProductInput {
115119

116120
// Identifier. The name of the product input.
117121
// Format: `accounts/{account}/productInputs/{productinput}`
118-
// where the last section `productinput` consists of 4 parts:
119-
// `channel~content_language~feed_label~offer_id`
122+
// where the last section `productinput` consists of:
123+
// `content_language~feed_label~offer_id`
120124
// example for product input name is
121-
// `accounts/123/productInputs/online~en~US~sku123`
125+
// `accounts/123/productInputs/en~US~sku123`. A legacy local product input
126+
// name would be `accounts/123/productInputs/local~en~US~sku123`.
127+
// Note: For calls to the v1beta version, the `productInput` section consists
128+
// of: `channel~content_language~feed_label~offer_id`, for example:
129+
// `accounts/123/productInputs/online~en~US~sku123`.
122130
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
123131

124132
// Output only. The name of the processed product.
@@ -150,8 +158,8 @@ message ProductInput {
150158
(google.api.field_behavior) = IMMUTABLE
151159
];
152160

153-
// Required. Immutable. The label that lets you categorize and identify your
154-
// products. The maximum allowed characters are 20, and the supported
161+
// Required. Immutable. The feed label that lets you categorize and identify
162+
// your products. The maximum allowed characters are 20, and the supported
155163
// characters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must
156164
// not include any spaces. For more information, see [Using feed
157165
// labels](//support.google.com/merchants/answer/14994087).
@@ -215,8 +223,8 @@ message InsertProductInputRequest {
215223
// Required. The primary or supplemental product data source name. If the
216224
// product already exists and data source provided is different, then the
217225
// product will be moved to a new data source. For more information, see
218-
// [Overview of Data sources
219-
// sub-API](/merchant/api/guides/data-sources/overview).
226+
// [Create a primary data
227+
// source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source).
220228
//
221229
// Only API data sources are supported.
222230
//
@@ -260,16 +268,30 @@ message UpdateProductInputRequest {
260268
// Format: `accounts/{account}/dataSources/{datasource}`. For example,
261269
// `accounts/123456/dataSources/104628`.
262270
string data_source = 3 [(google.api.field_behavior) = REQUIRED];
271+
272+
// Optional. If true, the `{productInput}` in the `name` field of the request
273+
// will be interpreted as unpadded base64url-encoded and decoded during
274+
// request processing to match the decoded value. Default value is `false`.
275+
// Use this if your `{productInput}` contains special characters, such as
276+
// forward slash
277+
// `/` or other characters that are unpadded base64url-encoded (as per RFC
278+
// 7515: https://datatracker.ietf.org/doc/html/rfc7515#section-2).
279+
//
280+
// Note that future versions of the API will only accept unpadded
281+
// base64url-encoded product ids, so we strongly recommend proactively setting
282+
// this to `true` and encoding the product ids.
283+
bool product_id_base64_url_encoded = 4
284+
[(google.api.field_behavior) = OPTIONAL];
263285
}
264286

265287
// Request message for the DeleteProductInput method.
266288
message DeleteProductInputRequest {
267289
// Required. The name of the product input resource to delete.
268290
// Format: `accounts/{account}/productInputs/{product}`
269-
// where the last section `product` consists of 4 parts:
270-
// `channel~content_language~feed_label~offer_id`
291+
// where the last section `product` consists of:
292+
// `content_language~feed_label~offer_id`
271293
// example for product name is
272-
// `accounts/123/productInputs/online~en~US~sku123`.
294+
// `accounts/123/productInputs/en~US~sku123`.
273295
string name = 1 [
274296
(google.api.field_behavior) = REQUIRED,
275297
(google.api.resource_reference) = {
@@ -282,4 +304,18 @@ message DeleteProductInputRequest {
282304
// `accounts/{account}/dataSources/{datasource}`. For example,
283305
// `accounts/123456/dataSources/104628`.
284306
string data_source = 2 [(google.api.field_behavior) = REQUIRED];
307+
308+
// Optional. If true, the `{productInput}` in the `name` field of the request
309+
// will be interpreted as unpadded base64url-encoded and decoded during
310+
// request processing to match the decoded value. Default value is `false`.
311+
// Use this if your `{productInput}` contains special characters, such as
312+
// forward slash
313+
// `/` or other characters that are unpadded base64url-encoded (as per RFC
314+
// 7515: https://datatracker.ietf.org/doc/html/rfc7515#section-2).
315+
//
316+
// Note that future versions of the API will only accept unpadded
317+
// base64url-encoded product ids, so we strongly recommend proactively setting
318+
// this to `true` and encoding the product ids.
319+
bool product_id_base64_url_encoded = 3
320+
[(google.api.field_behavior) = OPTIONAL];
285321
}

google/shopping/merchant/products/v1beta/products.proto

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ import "google/api/resource.proto";
2323
import "google/shopping/merchant/products/v1beta/products_common.proto";
2424
import "google/shopping/type/types.proto";
2525

26+
option csharp_namespace = "Google.Shopping.Merchant.Products.V1Beta";
2627
option go_package = "cloud.google.com/go/shopping/merchant/products/apiv1beta/productspb;productspb";
2728
option java_multiple_files = true;
2829
option java_outer_classname = "ProductsProto";
2930
option java_package = "com.google.shopping.merchant.products.v1beta";
31+
option php_namespace = "Google\\Shopping\\Merchant\\Products\\V1beta";
32+
option ruby_package = "Google::Shopping::Merchant::Products::V1beta";
3033
option (google.api.resource_definition) = {
3134
type: "merchantapi.googleapis.com/Account"
3235
pattern: "accounts/{account}"
@@ -84,9 +87,13 @@ message Product {
8487
// The name of the product.
8588
// Format:
8689
// `accounts/{account}/products/{product}` where the last
87-
// section `product` consists of 4 parts:
88-
// `channel~content_language~feed_label~offer_id`
89-
// example for product name is `accounts/123/products/online~en~US~sku123`
90+
// section `product` consists of:
91+
// `content_language~feed_label~offer_id`
92+
// example for product name is `accounts/123/products/en~US~sku123`. A legacy
93+
// local product name would be `accounts/123/products/local~en~US~sku123`.
94+
// Note: For calls to the v1beta version, the `product` section consists
95+
// of: `channel~content_language~feed_label~offer_id`, for example:
96+
// `accounts/123/products/online~en~US~sku123`.
9097
string name = 1;
9198

9299
// Output only. The
@@ -157,17 +164,34 @@ message Product {
157164
// Request message for the GetProduct method.
158165
message GetProductRequest {
159166
// Required. The name of the product to retrieve.
160-
// Format: `accounts/{account}/products/{product}`
161-
// where the last section `product` consists of 4 parts:
162-
// `channel~content_language~feed_label~offer_id`
163-
// example for product name is
164-
// `accounts/123/products/online~en~US~sku123`
167+
// Format:
168+
// `accounts/{account}/products/{product}` where the last
169+
// section `product` consists of:
170+
// `content_language~feed_label~offer_id`
171+
// example for product name is `accounts/123/products/en~US~sku123`. A legacy
172+
// local product name would be `accounts/123/products/local~en~US~sku123`.
173+
// Note: For calls to the v1beta version, the `product` section consists
174+
// of: `channel~content_language~feed_label~offer_id`, for example:
175+
// `accounts/123/products/online~en~US~sku123`.
165176
string name = 1 [
166177
(google.api.field_behavior) = REQUIRED,
167178
(google.api.resource_reference) = {
168179
type: "merchantapi.googleapis.com/Product"
169180
}
170181
];
182+
183+
// Optional. If true, the `{product}` in the `name` field of the request will
184+
// be interpreted as unpadded base64url-encoded and decoded during request
185+
// processing to match the decoded value. Default value is `false`. Use this
186+
// if your `{product}` contains special characters, such as forward slash `/`
187+
// or other characters that are unpadded base64url-encoded (as per RFC 7515:
188+
// https://datatracker.ietf.org/doc/html/rfc7515#section-2).
189+
//
190+
// Note that future versions of the API will only accept unpadded
191+
// base64url-encoded product ids, so we strongly recommend proactively setting
192+
// this to `true` and encoding the product ids.
193+
bool product_id_base64_url_encoded = 2
194+
[(google.api.field_behavior) = OPTIONAL];
171195
}
172196

173197
// Request message for the ListProducts method.
@@ -184,7 +208,7 @@ message ListProductsRequest {
184208
// The maximum number of products to return. The service may return fewer than
185209
// this value.
186210
// The maximum value is 1000; values above 1000 will be coerced to 1000.
187-
// If unspecified, the maximum number of products will be returned.
211+
// If unspecified, the default page size of 25 products will be returned.
188212
int32 page_size = 2;
189213

190214
// A page token, received from a previous `ListProducts` call.

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

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ import "google/protobuf/timestamp.proto";
2121
import "google/shopping/type/types.proto";
2222
import "google/type/interval.proto";
2323

24+
option csharp_namespace = "Google.Shopping.Merchant.Products.V1Beta";
2425
option go_package = "cloud.google.com/go/shopping/merchant/products/apiv1beta/productspb;productspb";
2526
option java_multiple_files = true;
2627
option java_outer_classname = "ProductsCommonProto";
2728
option java_package = "com.google.shopping.merchant.products.v1beta";
29+
option php_namespace = "Google\\Shopping\\Merchant\\Products\\V1beta";
30+
option ruby_package = "Google::Shopping::Merchant::Products::V1beta";
2831

2932
// The subscription period of the product.
3033
enum SubscriptionPeriod {
@@ -132,7 +135,7 @@ message Attributes {
132135
// Deprecated: Use `gtins` instead.
133136
repeated string gtin = 26 [deprecated = true];
134137

135-
// Global Trade Item Numbers
138+
// A list of Global Trade Item Numbers
136139
// ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
137140
// item.
138141
// You can provide up to 10 GTINs.
@@ -282,7 +285,7 @@ message Attributes {
282285
// The number of identical products in a business-defined multipack.
283286
optional int64 multipack = 58;
284287

285-
// Used to group items in an arbitrary way. Only for CPA%, discouraged
288+
// Used to group items in an arbitrary way. Only for CPA, discouraged
286289
// otherwise. For more information, see
287290
// [Display ads
288291
// attribute](https://support.google.com/merchants/answer/6069387).
@@ -365,6 +368,9 @@ message Attributes {
365368
// custom grouping of items in a Shopping campaign.
366369
optional string custom_label_4 = 75;
367370

371+
// Destinations also known as [Marketing
372+
// methods](https://support.google.com/merchants/answer/15130232) selections.
373+
//
368374
// The list of destinations to include for this target (corresponds to
369375
// checked check boxes in Merchant Center). Default destinations are always
370376
// included unless provided in `excludedDestinations`.
@@ -377,6 +383,9 @@ message Attributes {
377383
// cases. Use this field within products to only setup exceptions.
378384
repeated string included_destinations = 76;
379385

386+
// Destinations also known as [Marketing
387+
// methods](https://support.google.com/merchants/answer/15130232) selections.
388+
//
380389
// The list of destinations to exclude for this target (corresponds to
381390
// unchecked check boxes in Merchant Center).
382391
//
@@ -433,10 +442,10 @@ message Attributes {
433442

434443
// A safeguard in the [automated discounts]
435444
// (https://support.google.com/merchants/answer/10295759) and
436-
// "Dynamic Promotions"
437-
// (https://support.google.com/merchants/answer/13949249) projects,
438-
// ensuring that discounts on business offers do not fall below this value,
439-
// thereby preserving the offer's value and profitability.
445+
// ["dynamic
446+
// promotions"](https://support.google.com/merchants/answer/13949249)
447+
// projects, ensuring that discounts on business offers do not fall below this
448+
// value, thereby preserving the offer's value and profitability.
440449
google.shopping.type.Price auto_pricing_min_price = 124;
441450

442451
// The list of sustainability incentive programs.
@@ -671,6 +680,20 @@ message Shipping {
671680
// [maxTransitTime][google.shopping.merchant.products.v1beta.Shipping.max_transit_time]
672681
// is present.
673682
optional int64 max_transit_time = 11;
683+
684+
// The handling cutoff time until which an order has to be placed to be
685+
// processed in the same day. This is a string in format of HHMM (e.g.
686+
// `1530`) for 3:30 PM. If not configured, the cutoff time will be defaulted
687+
// to 8AM PST and `handling_cutoff_timezone` will be ignored.
688+
optional string handling_cutoff_time = 12;
689+
690+
// [Timezone
691+
// identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids)
692+
// For example `Europe/Zurich`. This field only applies if
693+
// `handling_cutoff_time` is set. If `handling_cutoff_time` is set but this
694+
// field is not set, the shipping destination timezone will be used. If both
695+
// fields are not set, the handling cutoff time will default to 8AM PST.
696+
optional string handling_cutoff_timezone = 13;
674697
}
675698

676699
// Conditions to be met for a product to have free shipping.

0 commit comments

Comments
 (0)