Skip to content

Commit d4b3a8f

Browse files
Google APIscopybara-github
authored andcommitted
feat: add AggregateProductStatuses
PiperOrigin-RevId: 767093664
1 parent 4842546 commit d4b3a8f

4 files changed

Lines changed: 220 additions & 2 deletions

File tree

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
2424
proto_library(
2525
name = "issueresolution_proto",
2626
srcs = [
27+
"aggregateproductstatuses.proto",
2728
"issueresolution.proto",
2829
],
2930
deps = [
3031
"//google/api:annotations_proto",
3132
"//google/api:client_proto",
3233
"//google/api:field_behavior_proto",
3334
"//google/api:resource_proto",
35+
"//google/shopping/type:type_proto", # Manually edited
3436
],
3537
)
3638

@@ -86,6 +88,8 @@ java_gapic_library(
8688
java_gapic_test(
8789
name = "issueresolution_java_gapic_test_suite",
8890
test_classes = [
91+
"com.google.shopping.merchant.issueresolution.v1beta.AggregateProductStatusesServiceClientHttpJsonTest",
92+
"com.google.shopping.merchant.issueresolution.v1beta.AggregateProductStatusesServiceClientTest",
8993
"com.google.shopping.merchant.issueresolution.v1beta.IssueResolutionServiceClientHttpJsonTest",
9094
"com.google.shopping.merchant.issueresolution.v1beta.IssueResolutionServiceClientTest",
9195
],
@@ -122,6 +126,7 @@ go_grpc_library(
122126
protos = [":issueresolution_proto"],
123127
deps = [
124128
"//google/api:annotations_go_proto",
129+
"//google/shopping/type:type_go_proto", # Manually edited
125130
],
126131
)
127132

@@ -160,17 +165,32 @@ load(
160165
"@com_google_googleapis_imports//:imports.bzl",
161166
"py_gapic_assembly_pkg",
162167
"py_gapic_library",
168+
"py_import",
163169
"py_test",
164170
)
165171

172+
py_import(
173+
name = "shopping_type",
174+
srcs = [
175+
"//google/shopping/type:type_py_gapic",
176+
],
177+
)
178+
166179
py_gapic_library(
167180
name = "issueresolution_py_gapic",
168181
srcs = [":issueresolution_proto"],
169182
grpc_service_config = "issueresolution_grpc_service_config.json",
183+
opt_args = [
184+
# Added manually
185+
"proto-plus-deps=google.shopping.type",
186+
"python-gapic-namespace=google.shopping",
187+
"python-gapic-name=merchant_issueresolution",
188+
],
170189
rest_numeric_enums = True,
171190
service_yaml = "merchantapi_v1beta.yaml",
172191
transport = "grpc+rest",
173192
deps = [
193+
":shopping_type", # Added manually
174194
],
175195
)
176196

@@ -258,6 +278,7 @@ nodejs_gapic_assembly_pkg(
258278
deps = [
259279
":issueresolution_nodejs_gapic",
260280
":issueresolution_proto",
281+
"//google/shopping/type:type_proto", # Added manually
261282
],
262283
)
263284

@@ -324,7 +345,6 @@ load(
324345

325346
csharp_proto_library(
326347
name = "issueresolution_csharp_proto",
327-
extra_opts = [],
328348
deps = [":issueresolution_proto"],
329349
)
330350

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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.issueresolution.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/shopping/type/types.proto";
24+
25+
option csharp_namespace = "Google.Shopping.Merchant.IssueResolution.V1Beta";
26+
option go_package = "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta/issueresolutionpb;issueresolutionpb";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "AggregateProductStatusesProto";
29+
option java_package = "com.google.shopping.merchant.issueresolution.v1beta";
30+
option php_namespace = "Google\\Shopping\\Merchant\\IssueResolution\\V1beta";
31+
option ruby_package = "Google::Shopping::Merchant::IssueResolution::V1beta";
32+
33+
// Service to manage aggregate product statuses.
34+
service AggregateProductStatusesService {
35+
option (google.api.default_host) = "merchantapi.googleapis.com";
36+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
37+
38+
// Lists the `AggregateProductStatuses` resources for your merchant account.
39+
// The response might contain fewer items than specified by `pageSize`.
40+
// If `pageToken` was returned in previous request, it can be used to obtain
41+
// additional results.
42+
rpc ListAggregateProductStatuses(ListAggregateProductStatusesRequest)
43+
returns (ListAggregateProductStatusesResponse) {
44+
option (google.api.http) = {
45+
get: "/issueresolution/v1beta/{parent=accounts/*}/aggregateProductStatuses"
46+
};
47+
option (google.api.method_signature) = "parent";
48+
}
49+
}
50+
51+
// Request message for the `ListAggregateProductStatuses` method.
52+
message ListAggregateProductStatusesRequest {
53+
// Required. The account to list aggregate product statuses for.
54+
// Format: `accounts/{account}`
55+
string parent = 1 [
56+
(google.api.field_behavior) = REQUIRED,
57+
(google.api.resource_reference) = {
58+
child_type: "merchantapi.googleapis.com/AggregateProductStatus"
59+
}
60+
];
61+
62+
// Optional. The maximum number of aggregate product statuses to return. The
63+
// service may return fewer than this value. If unspecified, at most 25
64+
// aggregate product statuses are returned. The maximum value is 250; values
65+
// above 250 are coerced to 250.
66+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
67+
68+
// Optional. A page token, received from a previous
69+
// `ListAggregateProductStatuses` call. Provide this to retrieve the
70+
// subsequent page.
71+
//
72+
// When paginating, all other parameters provided to
73+
// `ListAggregateProductStatuses` must match the call that provided the page
74+
// token.
75+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
76+
77+
// Optional. A filter expression that filters the aggregate product statuses.
78+
// Filtering is only supported by the `reporting_context` and `country` field.
79+
// For example: `reporting_context = "SHOPPING_ADS" AND country = "US"`.
80+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
81+
}
82+
83+
// Response message for the `ListAggregateProductStatuses` method.
84+
message ListAggregateProductStatusesResponse {
85+
// The `AggregateProductStatuses` resources for the given account.
86+
repeated AggregateProductStatus aggregate_product_statuses = 1;
87+
88+
// A token, which can be sent as `pageToken` to retrieve the next page.
89+
// If this field is omitted, there are no subsequent pages.
90+
string next_page_token = 2;
91+
}
92+
93+
// Aggregate product statuses for a given reporting context and country.
94+
message AggregateProductStatus {
95+
option (google.api.resource) = {
96+
type: "merchantapi.googleapis.com/AggregateProductStatus"
97+
pattern: "accounts/{account}/aggregateProductStatuses/{aggregate_product_status}"
98+
plural: "aggregateProductStatuses"
99+
singular: "aggregateProductStatus"
100+
};
101+
102+
// Products statistics.
103+
message Stats {
104+
// The number of products that are active.
105+
int64 active_count = 1;
106+
107+
// The number of products that are pending.
108+
int64 pending_count = 2;
109+
110+
// The number of products that are disapproved.
111+
int64 disapproved_count = 3;
112+
113+
// The number of products that are expiring.
114+
int64 expiring_count = 4;
115+
}
116+
117+
// The ItemLevelIssue of the product status.
118+
message ItemLevelIssue {
119+
// How the issue affects the serving of the product.
120+
enum Severity {
121+
// Not specified.
122+
SEVERITY_UNSPECIFIED = 0;
123+
124+
// This issue represents a warning and does not have a direct affect
125+
// on the product.
126+
NOT_IMPACTED = 1;
127+
128+
// The product is demoted and most likely have limited performance
129+
// in search results
130+
DEMOTED = 2;
131+
132+
// Issue disapproves the product.
133+
DISAPPROVED = 3;
134+
}
135+
136+
// How the issue can be resolved.
137+
enum Resolution {
138+
// Not specified.
139+
RESOLUTION_UNSPECIFIED = 0;
140+
141+
// The issue can be resolved by the merchant.
142+
MERCHANT_ACTION = 1;
143+
144+
// The issue will be resolved auomatically.
145+
PENDING_PROCESSING = 2;
146+
}
147+
148+
// The error code of the issue.
149+
string code = 1;
150+
151+
// How this issue affects serving of the offer.
152+
Severity severity = 2;
153+
154+
// Whether the issue can be resolved by the merchant.
155+
Resolution resolution = 3;
156+
157+
// The attribute's name, if the issue is caused by a single attribute.
158+
string attribute = 4;
159+
160+
// A short issue description in English.
161+
string description = 6;
162+
163+
// A detailed issue description in English.
164+
string detail = 7;
165+
166+
// The URL of a web page to help with resolving this issue.
167+
string documentation_uri = 8;
168+
169+
// The number of products affected by this issue.
170+
int64 product_count = 9;
171+
}
172+
173+
// Identifier. The name of the `AggregateProductStatuses` resource.
174+
// Format:
175+
// `accounts/{account}/aggregateProductStatuses/{aggregateProductStatuses}`
176+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
177+
178+
// The reporting context of the aggregate product statuses.
179+
google.shopping.type.ReportingContext.ReportingContextEnum reporting_context =
180+
3;
181+
182+
// The country of the aggregate product statuses. Represented as a
183+
// [CLDR territory
184+
// code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
185+
string country = 4;
186+
187+
// Products statistics for the given reporting context and country.
188+
Stats stats = 5;
189+
190+
// The product issues that affect the given reporting context and country.
191+
repeated ItemLevelIssue item_level_issues = 6;
192+
}

google/shopping/merchant/issueresolution/v1beta/issueresolution_grpc_service_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"methodConfig": [{
33
"name": [
4-
{ "service": "google.shopping.merchant.issueresolution.v1beta.IssueResolutionService" }
4+
{ "service": "google.shopping.merchant.issueresolution.v1beta.IssueResolutionService" },
5+
{ "service": "google.shopping.merchant.issueresolution.v1beta.AggregateProductStatusesService" }
56
],
67
"timeout": "60s",
78
"retryPolicy": {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name: merchantapi.googleapis.com
44
title: Merchant API
55

66
apis:
7+
- name: google.shopping.merchant.issueresolution.v1beta.AggregateProductStatusesService
78
- name: google.shopping.merchant.issueresolution.v1beta.IssueResolutionService
89

910
documentation:
@@ -27,6 +28,10 @@ documentation:
2728
2829
authentication:
2930
rules:
31+
- selector: google.shopping.merchant.issueresolution.v1beta.AggregateProductStatusesService.ListAggregateProductStatuses
32+
oauth:
33+
canonical_scopes: |-
34+
https://www.googleapis.com/auth/content
3035
- selector: 'google.shopping.merchant.issueresolution.v1beta.IssueResolutionService.*'
3136
oauth:
3237
canonical_scopes: |-

0 commit comments

Comments
 (0)