Skip to content

Commit d1c0c03

Browse files
Google APIscopybara-github
authored andcommitted
feat: add accounts API client libraries for v1
PiperOrigin-RevId: 791185257
1 parent daaa0a7 commit d1c0c03

29 files changed

Lines changed: 6171 additions & 0 deletions

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

Lines changed: 480 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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.v1;
18+
19+
option csharp_namespace = "Google.Shopping.Merchant.Accounts.V1";
20+
option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb;accountspb";
21+
option java_multiple_files = true;
22+
option java_outer_classname = "AccessRightProto";
23+
option java_package = "com.google.shopping.merchant.accounts.v1";
24+
option php_namespace = "Google\\Shopping\\Merchant\\Accounts\\V1";
25+
option ruby_package = "Google::Shopping::Merchant::Accounts::V1";
26+
27+
// The access right.
28+
enum AccessRight {
29+
// Default value. This value is unused.
30+
ACCESS_RIGHT_UNSPECIFIED = 0;
31+
32+
// Standard access rights.
33+
STANDARD = 1;
34+
35+
// Has access to the same read-only methods as STANDARD, but no access to
36+
// any mutating methods.
37+
READ_ONLY = 4;
38+
39+
// Admin access rights.
40+
ADMIN = 2;
41+
42+
// Users with this right have access to performance and insights.
43+
PERFORMANCE_REPORTING = 3;
44+
45+
// Users with this right have access to Merchant API and its notifications.
46+
// This role is only accessible to accounts that has a developer registration.
47+
API_DEVELOPER = 5;
48+
}
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
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.v1;
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.Accounts.V1";
26+
option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb;accountspb";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "AccountIssueProto";
29+
option java_package = "com.google.shopping.merchant.accounts.v1";
30+
option php_namespace = "Google\\Shopping\\Merchant\\Accounts\\V1";
31+
option ruby_package = "Google::Shopping::Merchant::Accounts::V1";
32+
33+
// Service to support `AccountIssueService` API.
34+
service AccountIssueService {
35+
option (google.api.default_host) = "merchantapi.googleapis.com";
36+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
37+
38+
// Lists all account issues of a Merchant Center account.
39+
//
40+
// When called on a multi-client account, this method only returns issues
41+
// belonging to that account, not its sub-accounts. To retrieve issues for
42+
// sub-accounts, you must first call the
43+
// [accounts.listSubaccounts][google.shopping.merchant.accounts.v1.AccountsService.ListSubAccounts]
44+
// method to obtain a list of sub-accounts, and then call
45+
// `accounts.issues.list` for each sub-account individually.
46+
rpc ListAccountIssues(ListAccountIssuesRequest)
47+
returns (ListAccountIssuesResponse) {
48+
option (google.api.http) = {
49+
get: "/accounts/v1/{parent=accounts/*}/issues"
50+
};
51+
option (google.api.method_signature) = "parent";
52+
}
53+
}
54+
55+
// Issues with your Merchant Center account that can impact all your products.
56+
// For more information, see [Account-level issues in Merchant
57+
// Center](https://support.google.com/merchants/answer/12153802?sjid=17798438912526418908-EU#account).
58+
message AccountIssue {
59+
option (google.api.resource) = {
60+
type: "merchantapi.googleapis.com/AccountIssue"
61+
pattern: "accounts/{account}/issues/{issue}"
62+
plural: "accountIssues"
63+
singular: "accountIssue"
64+
};
65+
66+
// The impact of the issue on a destination.
67+
message ImpactedDestination {
68+
// The impact of the issue on a region.
69+
message Impact {
70+
// The [CLDR region code](https://cldr.unicode.org/) where this issue
71+
// applies.
72+
string region_code = 1;
73+
74+
// The severity of the issue on the destination and region.
75+
Severity severity = 2;
76+
}
77+
78+
// The impacted reporting context.
79+
optional google.shopping.type.ReportingContext.ReportingContextEnum
80+
reporting_context = 1;
81+
82+
// The (negative) impact for various regions on the given destination.
83+
repeated Impact impacts = 2;
84+
}
85+
86+
// All possible issue severities.
87+
enum Severity {
88+
// The severity is unknown.
89+
SEVERITY_UNSPECIFIED = 0;
90+
91+
// The issue causes offers to not serve.
92+
CRITICAL = 1;
93+
94+
// The issue might affect offers (in the future) or might be an
95+
// indicator of issues with offers.
96+
ERROR = 2;
97+
98+
// The issue is a suggestion for improvement.
99+
SUGGESTION = 3;
100+
}
101+
102+
// Identifier. The resource name of the account issue.
103+
// Format: `accounts/{account}/issues/{id}`. For example,
104+
// `accounts/123456/issues/misrepresentation-of-self-or-products-unacceptable-business-practice-policy`.
105+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
106+
107+
// The localized title of the issue.
108+
string title = 2;
109+
110+
// The overall severity of the issue.
111+
Severity severity = 3;
112+
113+
// The impact this issue has on various destinations.
114+
repeated ImpactedDestination impacted_destinations = 4;
115+
116+
// Further localized details about the issue.
117+
string detail = 5;
118+
119+
// Link to Merchant Center Help Center providing further information about the
120+
// issue and how to fix it.
121+
string documentation_uri = 6;
122+
}
123+
124+
// Request message for the `ListAccountIssues` method.
125+
message ListAccountIssuesRequest {
126+
// Required. The parent, which owns this collection of issues.
127+
// Format: `accounts/{account}`
128+
string parent = 1 [
129+
(google.api.field_behavior) = REQUIRED,
130+
(google.api.resource_reference) = {
131+
type: "merchantapi.googleapis.com/Account"
132+
}
133+
];
134+
135+
// Optional. The maximum number of issues to return. The service may return
136+
// fewer than this value. If unspecified, at most 50 issues will be returned.
137+
// The maximum value is 100; values above 100 will be coerced to 100
138+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
139+
140+
// Optional. A page token, received from a previous `ListAccountIssues` call.
141+
// Provide this to retrieve the subsequent page.
142+
//
143+
// When paginating, all other parameters provided to `ListAccountIssues` must
144+
// match the call that provided the page token.
145+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
146+
147+
// Optional. The issues in the response will have human-readable fields in the
148+
// given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47),
149+
// such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be
150+
// used.
151+
string language_code = 4 [(google.api.field_behavior) = OPTIONAL];
152+
153+
// Optional. The [IANA](https://www.iana.org/time-zones) timezone used to
154+
// localize times in human-readable fields. For example 'America/Los_Angeles'.
155+
// If not set, 'America/Los_Angeles' will be used.
156+
string time_zone = 5 [(google.api.field_behavior) = OPTIONAL];
157+
}
158+
159+
// Response message for the `ListAccountIssues` method.
160+
message ListAccountIssuesResponse {
161+
// The issues from the specified account.
162+
repeated AccountIssue account_issues = 1;
163+
164+
// A token, which can be sent as `page_token` to retrieve the next page.
165+
// If this field is omitted, there are no subsequent pages.
166+
string next_page_token = 2;
167+
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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.v1;
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 csharp_namespace = "Google.Shopping.Merchant.Accounts.V1";
26+
option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb;accountspb";
27+
option java_multiple_files = true;
28+
option java_outer_classname = "AccountRelationshipsProto";
29+
option java_package = "com.google.shopping.merchant.accounts.v1";
30+
option php_namespace = "Google\\Shopping\\Merchant\\Accounts\\V1";
31+
option ruby_package = "Google::Shopping::Merchant::Accounts::V1";
32+
33+
// Service to support AccountRelationship API.
34+
service AccountRelationshipsService {
35+
option (google.api.default_host) = "merchantapi.googleapis.com";
36+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
37+
38+
// Retrieve an account relationship.
39+
rpc GetAccountRelationship(GetAccountRelationshipRequest)
40+
returns (AccountRelationship) {
41+
option (google.api.http) = {
42+
get: "/accounts/v1/{name=accounts/*/relationships/*}"
43+
};
44+
option (google.api.method_signature) = "name";
45+
}
46+
47+
// Updates the account relationship. Executing this method requires admin
48+
// access.
49+
rpc UpdateAccountRelationship(UpdateAccountRelationshipRequest)
50+
returns (AccountRelationship) {
51+
option (google.api.http) = {
52+
patch: "/accounts/v1/{account_relationship.name=accounts/*/relationships/*}"
53+
body: "account_relationship"
54+
};
55+
option (google.api.method_signature) = "account_relationship,update_mask";
56+
}
57+
58+
// List account relationships for the specified account.
59+
rpc ListAccountRelationships(ListAccountRelationshipsRequest)
60+
returns (ListAccountRelationshipsResponse) {
61+
option (google.api.http) = {
62+
get: "/accounts/v1/{parent=accounts/*}/relationships"
63+
};
64+
option (google.api.method_signature) = "parent";
65+
}
66+
}
67+
68+
// The `AccountRelationship` message defines a formal connection between a
69+
// merchant's account and a service provider's account. This relationship
70+
// enables the provider to offer specific services to the business, such as
71+
// product management or campaign management. It specifies the access rights
72+
// and permissions to the business's data relevant to those services.
73+
//
74+
// Establishing an account relationship involves linking the merchant's account
75+
// with a provider's account. The provider could be another Google account (like
76+
// Google Ads or Google My Business) or a third-party platform (such as Shopify
77+
// or WooCommerce).
78+
message AccountRelationship {
79+
option (google.api.resource) = {
80+
type: "merchantapi.googleapis.com/AccountRelationship"
81+
pattern: "accounts/{account}/relationships/{relationship}"
82+
plural: "accountRelationships"
83+
singular: "accountRelationship"
84+
};
85+
86+
// Identifier. The resource name of the account relationship.
87+
// Format: `accounts/{account}/relationships/{relationship}`. For example,
88+
// `accounts/123456/relationships/567890`.
89+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
90+
91+
// Immutable. The provider of the service. Either the reference to an account
92+
// such as `providers/123` or a well-known service provider (one of
93+
// `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).
94+
optional string provider = 2 [(google.api.field_behavior) = IMMUTABLE];
95+
96+
// Output only. The human-readable display name of the provider account.
97+
string provider_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
98+
99+
// Optional. An optional alias you can assign to this account relationship.
100+
// This alias acts as a convenient identifier for your own reference and
101+
// management. It must be unique among all your account relationships with the
102+
// same provider.
103+
//
104+
// For example, you might use `account_id_alias` to assign a friendly name
105+
// to this relationship for easier identification in your systems.
106+
string account_id_alias = 4 [(google.api.field_behavior) = OPTIONAL];
107+
}
108+
109+
// Request to get an account relationship.
110+
message GetAccountRelationshipRequest {
111+
// Required. The resource name of the account relationship to get.
112+
// Format: `accounts/{account}/relationships/{relationship}`. For example,
113+
// `accounts/123456/relationships/567890`.
114+
string name = 1 [
115+
(google.api.field_behavior) = REQUIRED,
116+
(google.api.resource_reference) = {
117+
type: "merchantapi.googleapis.com/AccountRelationship"
118+
}
119+
];
120+
}
121+
122+
// Request message for the `UpdateAccountRelationship` method.
123+
message UpdateAccountRelationshipRequest {
124+
// Required. The new version of the account relationship.
125+
AccountRelationship account_relationship = 1
126+
[(google.api.field_behavior) = REQUIRED];
127+
128+
// Optional. List of fields being updated.
129+
//
130+
// The following fields are supported (in both `snake_case` and
131+
// `lowerCamelCase`):
132+
//
133+
// - `account_id_alias`
134+
google.protobuf.FieldMask update_mask = 2
135+
[(google.api.field_behavior) = OPTIONAL];
136+
}
137+
138+
// Request to list account relationships.
139+
message ListAccountRelationshipsRequest {
140+
// Required. The parent account of the account relationship to filter by.
141+
// Format: `accounts/{account}`
142+
string parent = 1 [
143+
(google.api.field_behavior) = REQUIRED,
144+
(google.api.resource_reference) = {
145+
type: "merchantapi.googleapis.com/Account"
146+
}
147+
];
148+
149+
// Optional. The token returned by the previous `list` request.
150+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
151+
152+
// Optional. The maximum number of elements to return in the response. Use for
153+
// paging. If no `page_size` is specified, `100` is used as the default value.
154+
// The maximum allowed value is `1000`.
155+
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
156+
}
157+
158+
// Response after trying to list account relationships.
159+
message ListAccountRelationshipsResponse {
160+
// The account relationships that match your filter.
161+
repeated AccountRelationship account_relationships = 1;
162+
163+
// A page token. You can send the `page_token` to get the next page.
164+
// Only included in the `list` response if there are more pages.
165+
string next_page_token = 2;
166+
}

0 commit comments

Comments
 (0)