Skip to content

Commit bc7f715

Browse files
Google APIscopybara-github
authored andcommitted
feat: add an update method
docs: A comment for message `ProductInput` is changed docs: A comment for field `channel` in message `.google.shopping.merchant.products.v1beta.ProductInput` is changed docs: A comment for field `data_source` in message `.google.shopping.merchant.products.v1beta.InsertProductInputRequest` is changed PiperOrigin-RevId: 737402434
1 parent e4515ba commit bc7f715

File tree

4 files changed

+111
-30
lines changed

4 files changed

+111
-30
lines changed

google/shopping/merchant/products/v1beta/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ proto_library(
3636
"//google/shopping/type:type_proto", # Manual fix. Original :types_proto
3737
"//google/type:interval_proto",
3838
"@com_google_protobuf//:empty_proto",
39+
"@com_google_protobuf//:field_mask_proto",
3940
"@com_google_protobuf//:timestamp_proto",
4041
],
4142
)

google/shopping/merchant/products/v1beta/merchantapi_v1beta.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ documentation:
2828
2929
authentication:
3030
rules:
31-
- selector: google.shopping.merchant.products.v1beta.ProductInputsService.DeleteProductInput
32-
oauth:
33-
canonical_scopes: |-
34-
https://www.googleapis.com/auth/content
35-
- selector: google.shopping.merchant.products.v1beta.ProductInputsService.InsertProductInput
31+
- selector: 'google.shopping.merchant.products.v1beta.ProductInputsService.*'
3632
oauth:
3733
canonical_scopes: |-
3834
https://www.googleapis.com/auth/content
@@ -59,8 +55,6 @@ publishing:
5955
common:
6056
destinations:
6157
- PACKAGE_MANAGER
62-
cpp_settings:
63-
common: {}
6458
php_settings:
6559
common:
6660
destinations:

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

Lines changed: 73 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/protobuf/empty.proto";
24+
import "google/protobuf/field_mask.proto";
2425
import "google/shopping/merchant/products/v1beta/products_common.proto";
2526
import "google/shopping/type/types.proto";
2627

@@ -48,6 +49,18 @@ service ProductInputsService {
4849
};
4950
}
5051

52+
// Updates the existing product input in your Merchant Center account.
53+
//
54+
// After inserting, updating, or deleting a product input, it may take several
55+
// minutes before the processed product can be retrieved.
56+
rpc UpdateProductInput(UpdateProductInputRequest) returns (ProductInput) {
57+
option (google.api.http) = {
58+
patch: "/products/v1beta/{product_input.name=accounts/*/productInputs/*}"
59+
body: "product_input"
60+
};
61+
option (google.api.method_signature) = "product_input,update_mask";
62+
}
63+
5164
// Deletes a product input from your Merchant Center account.
5265
//
5366
// After inserting, updating, or deleting a product input, it may take several
@@ -62,26 +75,26 @@ service ProductInputsService {
6275
}
6376

6477
// This resource represents input data you submit for a product, not the
65-
// processed product that you see in Merchant Center, in Shopping ads, or across
66-
// Google surfaces. Product inputs, rules and supplemental data source data are
67-
// combined to create the processed
68-
// [Product][google.shopping.merchant.products.v1beta.Product].
78+
// processed product that you see in Merchant Center, in Shopping ads, or
79+
// across Google surfaces. Product inputs, rules and supplemental data source
80+
// data are combined to create the processed
81+
// [Product][google.shopping.merchant.products.v1beta.Product].
6982
//
70-
// Required product input attributes to pass data validation checks are
71-
// primarily defined in the [Products Data
72-
// Specification](https://support.google.com/merchants/answer/188494).
83+
// Required product input attributes to pass data validation checks are
84+
// primarily defined in the [Products Data
85+
// Specification](https://support.google.com/merchants/answer/188494).
7386
//
74-
// The following attributes are required:
75-
// [feedLabel][google.shopping.merchant.products.v1beta.Product.feed_label],
76-
// [contentLanguage][google.shopping.merchant.products.v1beta.Product.content_language]
77-
// and [offerId][google.shopping.merchant.products.v1beta.Product.offer_id].
87+
// The following attributes are required:
88+
// [feedLabel][google.shopping.merchant.products.v1beta.Product.feed_label],
89+
// [contentLanguage][google.shopping.merchant.products.v1beta.Product.content_language]
90+
// and [offerId][google.shopping.merchant.products.v1beta.Product.offer_id].
7891
//
79-
// After inserting, updating, or deleting a product input, it may take several
80-
// minutes before the processed product can be retrieved.
92+
// After inserting, updating, or deleting a product input, it may take several
93+
// minutes before the processed product can be retrieved.
8194
//
82-
// All fields in the product input and its sub-messages match the English name
83-
// of their corresponding attribute in the vertical spec with [some
84-
// exceptions](https://support.google.com/merchants/answer/7052112).
95+
// All fields in the product input and its sub-messages match the English name
96+
// of their corresponding attribute in the vertical spec with [some
97+
// exceptions](https://support.google.com/merchants/answer/7052112).
8598
message ProductInput {
8699
option (google.api.resource) = {
87100
type: "merchantapi.googleapis.com/ProductInput"
@@ -104,13 +117,11 @@ message ProductInput {
104117
// `"{product.name=accounts/{account}/products/{product}}"`
105118
string product = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
106119

107-
// Required. Immutable. The
120+
// Immutable. The
108121
// [channel](https://support.google.com/merchants/answer/7361332) of the
109122
// product.
110-
google.shopping.type.Channel.ChannelEnum channel = 3 [
111-
(google.api.field_behavior) = REQUIRED,
112-
(google.api.field_behavior) = IMMUTABLE
113-
];
123+
google.shopping.type.Channel.ChannelEnum channel = 3
124+
[(google.api.field_behavior) = IMMUTABLE];
114125

115126
// Required. Immutable. Your unique identifier for the product. This is the
116127
// same for the product input and processed product. Leading and trailing
@@ -188,8 +199,47 @@ message InsertProductInputRequest {
188199

189200
// Required. The primary or supplemental product data source name. If the
190201
// product already exists and data source provided is different, then the
191-
// product will be moved to a new data source. Format:
192-
// `accounts/{account}/dataSources/{datasource}`.
202+
// product will be moved to a new data source.
203+
//
204+
// Only API data sources are supported.
205+
//
206+
// Format: `accounts/{account}/dataSources/{datasource}`.
207+
string data_source = 3 [(google.api.field_behavior) = REQUIRED];
208+
}
209+
210+
// Request message for the UpdateProductInput method.
211+
// The product (primary input) must exist for the update to succeed.
212+
// If the update is for a primary product input, the existing primary product
213+
// input must be from the same data source.
214+
message UpdateProductInputRequest {
215+
// Required. The product input resource to update. Information you submit will
216+
// be applied to the processed product as well.
217+
ProductInput product_input = 1 [(google.api.field_behavior) = REQUIRED];
218+
219+
// Optional. The list of product attributes to be updated.
220+
//
221+
// If the update mask is omitted, then it is treated as implied field mask
222+
// equivalent to all fields that are populated (have a non-empty value).
223+
//
224+
// Attributes specified in the update mask without a value specified in the
225+
// body will be deleted from the product.
226+
//
227+
// Update mask can only be specified for top level fields in
228+
// attributes and custom attributes.
229+
//
230+
// To specify the update mask for custom attributes you need to add the
231+
// `custom_attribute.` prefix.
232+
//
233+
// Providing special "*" value for full product replacement is not supported.
234+
google.protobuf.FieldMask update_mask = 2
235+
[(google.api.field_behavior) = OPTIONAL];
236+
237+
// Required. The primary or supplemental product data source where
238+
// `data_source` name identifies the product input to be updated.
239+
//
240+
// Only API data sources are supported.
241+
//
242+
// Format: `accounts/{account}/dataSources/{datasource}`.
193243
string data_source = 3 [(google.api.field_behavior) = REQUIRED];
194244
}
195245

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ message Attributes {
383383
// ensuring that discounts on merchants' offers do not fall below this value,
384384
// thereby preserving the offer's value and profitability.
385385
google.shopping.type.Price auto_pricing_min_price = 124;
386+
387+
// The list of sustainability incentive programs.
388+
repeated ProductSustainabilityIncentive sustainability_incentives = 138;
386389
}
387390

388391
// The Tax of the product.
@@ -844,3 +847,36 @@ message CloudExportAdditionalProperties {
844847
// string size is 256B.
845848
optional string unit_code = 8;
846849
}
850+
851+
// Information regarding sustainability-related incentive programs such as
852+
// rebates or tax relief.
853+
message ProductSustainabilityIncentive {
854+
// Types of supported sustainability incentive programs.
855+
enum Type {
856+
// Unspecified or unknown sustainability incentive type.
857+
TYPE_UNSPECIFIED = 0;
858+
859+
// Program offering tax liability reductions for electric vehicles and, in
860+
// some countries, plug-in hybrids. These reductions can be based on a
861+
// specific amount or a percentage of the sale price.
862+
EV_TAX_CREDIT = 1;
863+
864+
// A subsidy program, often called an environmental bonus, provides a
865+
// purchase grant for electric vehicles and, in some countries, plug-in
866+
// hybrids. The grant amount may be a fixed sum or a percentage of the sale
867+
// price.
868+
EV_PRICE_DISCOUNT = 2;
869+
}
870+
871+
// Sustainability incentive value.
872+
oneof value {
873+
// The fixed amount of the incentive.
874+
google.shopping.type.Price amount = 2;
875+
876+
// The percentage of the sale price that the incentive is applied to.
877+
double percentage = 3;
878+
}
879+
880+
// Sustainability incentive program.
881+
optional Type type = 1;
882+
}

0 commit comments

Comments
 (0)