Skip to content

Commit fa21981

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add AutomaticImprovements service
PiperOrigin-RevId: 736530762
1 parent e6136c1 commit fa21981

4 files changed

Lines changed: 276 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ proto_library(
3030
"accounts.proto",
3131
"accountservices.proto",
3232
"autofeedsettings.proto",
33+
"automaticimprovements.proto",
3334
"businessidentity.proto",
3435
"businessinfo.proto",
3536
"customerservice.proto",
@@ -124,6 +125,8 @@ java_gapic_test(
124125
"com.google.shopping.merchant.accounts.v1beta.AccountsServiceClientTest",
125126
"com.google.shopping.merchant.accounts.v1beta.AutofeedSettingsServiceClientHttpJsonTest",
126127
"com.google.shopping.merchant.accounts.v1beta.AutofeedSettingsServiceClientTest",
128+
"com.google.shopping.merchant.accounts.v1beta.AutomaticImprovementsServiceClientHttpJsonTest",
129+
"com.google.shopping.merchant.accounts.v1beta.AutomaticImprovementsServiceClientTest",
127130
"com.google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClientHttpJsonTest",
128131
"com.google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClientTest",
129132
"com.google.shopping.merchant.accounts.v1beta.BusinessInfoServiceClientHttpJsonTest",
@@ -406,6 +409,7 @@ load(
406409

407410
csharp_proto_library(
408411
name = "accounts_csharp_proto",
412+
extra_opts = [],
409413
deps = [":accounts_proto"],
410414
)
411415

google/shopping/merchant/accounts/v1beta/accounts_grpc_service_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{
1515
"service": "google.shopping.merchant.accounts.v1beta.AutofeedSettingsService"
1616
},
17+
{
18+
"service": "google.shopping.merchant.accounts.v1beta.AutomaticImprovementsService"
19+
},
1720
{
1821
"service": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService"
1922
},
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.shopping.merchant.accounts.v1beta;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/protobuf/field_mask.proto";
24+
25+
option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "AutomaticImprovementsProto";
28+
option java_package = "com.google.shopping.merchant.accounts.v1beta";
29+
30+
// Service to manage the automatic improvements of an account. The automatic
31+
// improvements of the account can be used to automatically update products,
32+
// improve images and shipping.
33+
service AutomaticImprovementsService {
34+
option (google.api.default_host) = "merchantapi.googleapis.com";
35+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
36+
37+
// Retrieves the automatic improvements of an account.
38+
rpc GetAutomaticImprovements(GetAutomaticImprovementsRequest)
39+
returns (AutomaticImprovements) {
40+
option (google.api.http) = {
41+
get: "/accounts/v1beta/{name=accounts/*/automaticImprovements}"
42+
};
43+
option (google.api.method_signature) = "name";
44+
}
45+
46+
// Updates the automatic improvements of an account.
47+
rpc UpdateAutomaticImprovements(UpdateAutomaticImprovementsRequest)
48+
returns (AutomaticImprovements) {
49+
option (google.api.http) = {
50+
patch: "/accounts/v1beta/{automatic_improvements.name=accounts/*/automaticImprovements}"
51+
body: "automatic_improvements"
52+
};
53+
option (google.api.method_signature) = "automatic_improvements,update_mask";
54+
}
55+
}
56+
57+
// Collection of information related to the [automatic
58+
// improvements](https://developers.google.com/shopping-content/guides/automatic-improvements)
59+
// of an account.
60+
message AutomaticImprovements {
61+
option (google.api.resource) = {
62+
type: "merchantapi.googleapis.com/AutomaticImprovements"
63+
pattern: "accounts/{account}/automaticImprovements"
64+
plural: "automaticImprovements"
65+
singular: "automaticImprovements"
66+
};
67+
68+
// Identifier. The resource name of the automatic improvements.
69+
// Format: `accounts/{account}/automaticImprovements`.
70+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
71+
72+
// Turning on [item
73+
// updates](https://support.google.com/merchants/answer/3246284) allows
74+
// Google to automatically update items for you. When item updates are on,
75+
// Google uses the structured data markup on the website and advanced data
76+
// extractors to update the price and availability of the items. When the item
77+
// updates are off, items with mismatched data aren't shown.
78+
// This field is only updated (cleared) if provided in the update mask.
79+
optional AutomaticItemUpdates item_updates = 2;
80+
81+
// This improvement will attempt to automatically correct submitted images if
82+
// they don't meet the [image
83+
// requirements](https://support.google.com/merchants/answer/6324350), for
84+
// example, removing overlays. If successful, the image will be replaced and
85+
// approved. This improvement is only applied to images of disapproved offers.
86+
// For more information see: [Automatic image
87+
// improvements](https://support.google.com/merchants/answer/9242973)
88+
// This field is only updated (cleared) if provided in the update mask.
89+
optional AutomaticImageImprovements image_improvements = 3;
90+
91+
// Not available for MCAs
92+
// [accounts](https://support.google.com/merchants/answer/188487). By turning
93+
// on [automatic shipping
94+
// improvements](https://support.google.com/merchants/answer/10027038),
95+
// you are allowing Google to improve the accuracy of your delivery times
96+
// shown to shoppers using Google. More accurate delivery times, especially
97+
// when faster, typically lead to better conversion rates. Google will improve
98+
// your estimated delivery times based on various factors:
99+
// * Delivery address of an order
100+
// * Current handling time and shipping time settings
101+
// * Estimated weekdays or business days
102+
// * Parcel tracking data
103+
// This field is only updated (cleared) if provided in the update mask.
104+
optional AutomaticShippingImprovements shipping_improvements = 4;
105+
}
106+
107+
// Turning on [item
108+
// updates](https://support.google.com/merchants/answer/3246284) allows
109+
// Google to automatically update items for you. When item updates are on,
110+
// Google uses the structured data markup on the website and advanced data
111+
// extractors to update the price and availability of the items. When the item
112+
// updates are off, items with mismatched data aren't shown.
113+
message AutomaticItemUpdates {
114+
// Settings for the Automatic Item Updates.
115+
message ItemUpdatesAccountLevelSettings {
116+
// If price updates are enabled, Google always updates the active price with
117+
// the crawled information.
118+
optional bool allow_price_updates = 1;
119+
120+
// If availability updates are enabled, any previous availability values
121+
// get overwritten if Google finds an out-of-stock annotation on the offer's
122+
// page.
123+
// If additionally `allow_strict_availability_updates` field is set to
124+
// true, values get overwritten if Google finds an in-stock annotation on
125+
// the offer’s page.
126+
optional bool allow_availability_updates = 2;
127+
128+
// If `allow_availability_updates` is enabled, items are automatically
129+
// updated in all your Shopping target countries. By default, availability
130+
// updates will only be applied to items that are 'out of stock' on your
131+
// website but 'in stock' on Shopping. Set this to true to also update items
132+
// that are 'in stock' on your website, but 'out of stock' on Google
133+
// Shopping. In order for this field to have an effect, you must also set
134+
// `allow_availability_updates`.
135+
optional bool allow_strict_availability_updates = 3;
136+
137+
// If condition updates are enabled, Google always updates item condition
138+
// with the condition detected from the details of your product.
139+
optional bool allow_condition_updates = 4;
140+
}
141+
142+
// Optional. Determines which attributes of the items should be automatically
143+
// updated. If this field is not present and provided in the update mask, then
144+
// the settings will be deleted. If there are no settings for subaccount, they
145+
// are inherited from aggregator.
146+
ItemUpdatesAccountLevelSettings account_item_updates_settings = 1
147+
[(google.api.field_behavior) = OPTIONAL];
148+
149+
// Output only. The effective value of allow_price_updates.
150+
// If account_item_updates_settings is present, then this value is the same.
151+
// Otherwise, it represents the inherited value of the parent account.
152+
// The default value is true if no settings are present.
153+
// Read-only.
154+
bool effective_allow_price_updates = 2
155+
[(google.api.field_behavior) = OUTPUT_ONLY];
156+
157+
// Output only. The effective value of allow_availability_updates.
158+
// If account_item_updates_settings is present, then this value is the same.
159+
// Otherwise, it represents the inherited value of the parent account.
160+
// The default value is true if no settings are present.
161+
// Read-only.
162+
bool effective_allow_availability_updates = 3
163+
[(google.api.field_behavior) = OUTPUT_ONLY];
164+
165+
// Output only. The effective value of
166+
// allow_strict_availability_updates.
167+
// If account_item_updates_settings is present, then this value is the same.
168+
// Otherwise, it represents the inherited value of the parent account.
169+
// The default value is true if no settings are present.
170+
// Read-only.
171+
bool effective_allow_strict_availability_updates = 4
172+
[(google.api.field_behavior) = OUTPUT_ONLY];
173+
174+
// Output only. The effective value of allow_condition_updates.
175+
// If account_item_updates_settings is present, then this value is the same.
176+
// Otherwise, it represents the inherited value of the parent account.
177+
// The default value is true if no settings are present.
178+
// Read-only.
179+
bool effective_allow_condition_updates = 5
180+
[(google.api.field_behavior) = OUTPUT_ONLY];
181+
}
182+
183+
// This improvement will attempt to automatically correct submitted images if
184+
// they don't meet the [image
185+
// requirements](https://support.google.com/merchants/answer/6324350), for
186+
// example, removing overlays. If successful, the image will be replaced and
187+
// approved. This improvement is only applied to images of disapproved offers.
188+
// For more information see: [Automatic image
189+
// improvements](https://support.google.com/merchants/answer/9242973)
190+
message AutomaticImageImprovements {
191+
// Settings for the Automatic Image Improvements.
192+
message ImageImprovementsAccountLevelSettings {
193+
// Enables automatic image improvements.
194+
optional bool allow_automatic_image_improvements = 1;
195+
}
196+
197+
// Optional. Determines how the images should be automatically updated.
198+
// If this field is not present and provided in the update mask, then the
199+
// settings will be deleted. If there are no settings for subaccount, they are
200+
// inherited from aggregator.
201+
optional ImageImprovementsAccountLevelSettings
202+
account_image_improvements_settings = 1
203+
[(google.api.field_behavior) = OPTIONAL];
204+
205+
// Output only. The effective value of allow_automatic_image_improvements.
206+
// If account_image_improvements_settings is present, then this value is the
207+
// same. Otherwise, it represents the inherited value of the parent account.
208+
// Read-only.
209+
bool effective_allow_automatic_image_improvements = 2
210+
[(google.api.field_behavior) = OUTPUT_ONLY];
211+
}
212+
213+
// Not available for MCAs
214+
// [accounts](https://support.google.com/merchants/answer/188487). By turning on
215+
// [automatic shipping
216+
// improvements](https://support.google.com/merchants/answer/10027038),
217+
// you are allowing Google to improve the accuracy of your delivery times shown
218+
// to shoppers using Google. More accurate delivery times, especially when
219+
// faster, typically lead to better conversion rates. Google will improve your
220+
// estimated delivery times based on various factors:
221+
// * Delivery address of an order
222+
// * Current handling time and shipping time settings
223+
// * Estimated weekdays or business days
224+
// * Parcel tracking data
225+
message AutomaticShippingImprovements {
226+
// Enables automatic shipping improvements.
227+
optional bool allow_shipping_improvements = 1;
228+
}
229+
230+
// Request message for the `GetAutomaticImprovements` method.
231+
message GetAutomaticImprovementsRequest {
232+
// Required. The resource name of the automatic improvements.
233+
// Format: `accounts/{account}/automaticImprovements`
234+
string name = 1 [
235+
(google.api.field_behavior) = REQUIRED,
236+
(google.api.resource_reference) = {
237+
type: "merchantapi.googleapis.com/AutomaticImprovements"
238+
}
239+
];
240+
}
241+
242+
// Request message for the `UpdateAutomaticImprovements` method.
243+
message UpdateAutomaticImprovementsRequest {
244+
// Required. The new version of the automatic imrovements.
245+
AutomaticImprovements automatic_improvements = 1
246+
[(google.api.field_behavior) = REQUIRED];
247+
248+
// Required. List of fields being updated.
249+
// The following fields are supported (in both `snake_case` and
250+
// `lowerCamelCase`):
251+
//
252+
// - `item_updates`
253+
// - `item_updates.account_level_settings`
254+
// - `image_improvements`
255+
// - `image_improvements.account_level_settings`
256+
// - `shipping_improvements`
257+
// - `shipping_improvements.allow_shipping_improvements`
258+
google.protobuf.FieldMask update_mask = 2
259+
[(google.api.field_behavior) = REQUIRED];
260+
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ apis:
77
- name: google.shopping.merchant.accounts.v1beta.AccountIssueService
88
- name: google.shopping.merchant.accounts.v1beta.AccountsService
99
- name: google.shopping.merchant.accounts.v1beta.AutofeedSettingsService
10+
- name: google.shopping.merchant.accounts.v1beta.AutomaticImprovementsService
1011
- name: google.shopping.merchant.accounts.v1beta.BusinessIdentityService
1112
- name: google.shopping.merchant.accounts.v1beta.BusinessInfoService
1213
- name: google.shopping.merchant.accounts.v1beta.EmailPreferencesService
@@ -56,6 +57,14 @@ authentication:
5657
oauth:
5758
canonical_scopes: |-
5859
https://www.googleapis.com/auth/content
60+
- selector: google.shopping.merchant.accounts.v1beta.AutomaticImprovementsService.GetAutomaticImprovements
61+
oauth:
62+
canonical_scopes: |-
63+
https://www.googleapis.com/auth/content
64+
- selector: google.shopping.merchant.accounts.v1beta.AutomaticImprovementsService.UpdateAutomaticImprovements
65+
oauth:
66+
canonical_scopes: |-
67+
https://www.googleapis.com/auth/content
5968
- selector: google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentity
6069
oauth:
6170
canonical_scopes: |-
@@ -139,8 +148,6 @@ publishing:
139148
common:
140149
destinations:
141150
- PACKAGE_MANAGER
142-
cpp_settings:
143-
common: {}
144151
php_settings:
145152
common:
146153
destinations:

0 commit comments

Comments
 (0)