Skip to content

Commit 9289a2c

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add GetLfpMerchantState method
PiperOrigin-RevId: 747290896
1 parent 1472cea commit 9289a2c

4 files changed

Lines changed: 234 additions & 10 deletions

File tree

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ proto_library(
2525
name = "lfp_proto",
2626
srcs = [
2727
"lfpinventory.proto",
28+
"lfpmerchantstate.proto",
2829
"lfpsale.proto",
2930
"lfpstore.proto",
3031
],
@@ -81,12 +82,12 @@ java_gapic_library(
8182
service_yaml = "merchantapi_v1beta.yaml",
8283
test_deps = [
8384
":lfp_java_grpc",
84-
"//google/shopping/type:type_proto"
85+
"//google/shopping/type:type_proto",
8586
],
8687
transport = "grpc+rest",
8788
deps = [
8889
":lfp_java_proto",
89-
"//google/shopping/type:type_java_proto", # Added manually
90+
"//google/shopping/type:type_java_proto", # Added manually
9091
],
9192
)
9293

@@ -95,6 +96,8 @@ java_gapic_test(
9596
test_classes = [
9697
"com.google.shopping.merchant.lfp.v1beta.LfpInventoryServiceClientHttpJsonTest",
9798
"com.google.shopping.merchant.lfp.v1beta.LfpInventoryServiceClientTest",
99+
"com.google.shopping.merchant.lfp.v1beta.LfpMerchantStateServiceClientHttpJsonTest",
100+
"com.google.shopping.merchant.lfp.v1beta.LfpMerchantStateServiceClientTest",
98101
"com.google.shopping.merchant.lfp.v1beta.LfpSaleServiceClientHttpJsonTest",
99102
"com.google.shopping.merchant.lfp.v1beta.LfpSaleServiceClientTest",
100103
"com.google.shopping.merchant.lfp.v1beta.LfpStoreServiceClientHttpJsonTest",
@@ -174,29 +177,30 @@ load(
174177
"py_gapic_assembly_pkg",
175178
"py_gapic_library",
176179
"py_import",
180+
"py_test",
177181
)
178182

179183
py_import(
180184
name = "shopping_type",
181185
srcs = [
182186
"//google/shopping/type:type_py_gapic",
183-
],
187+
],
184188
)
185189

186190
py_gapic_library(
187191
name = "lfp_py_gapic",
188192
srcs = [":lfp_proto"],
189193
grpc_service_config = "lfp_grpc_service_config.json",
190194
opt_args = [
191-
"proto-plus-deps=google.shopping.type", # Added manually
192-
"python-gapic-namespace=google.shopping",
195+
"proto-plus-deps=google.shopping.type",
193196
"python-gapic-name=merchant_lfp",
197+
"python-gapic-namespace=google.shopping",
194198
],
195199
rest_numeric_enums = True,
196200
service_yaml = "merchantapi_v1beta.yaml",
197201
transport = "grpc+rest",
198202
deps = [
199-
":shopping_type", # Added manually
203+
":shopping_type", # Added manually
200204
],
201205
)
202206

@@ -284,7 +288,7 @@ nodejs_gapic_assembly_pkg(
284288
deps = [
285289
":lfp_nodejs_gapic",
286290
":lfp_proto",
287-
"//google/shopping/type:type_proto" # Added manually
291+
"//google/shopping/type:type_proto", # Added manually
288292
],
289293
)
290294

@@ -315,8 +319,8 @@ ruby_cloud_gapic_library(
315319
name = "lfp_ruby_gapic",
316320
srcs = [":lfp_proto_with_info"],
317321
extra_protoc_parameters = [
318-
"ruby-cloud-gem-name=google-shopping-merchant-lfp-v1beta",
319322
"ruby-cloud-extra-dependencies=google-shopping-type=>0.0+<2.a",
323+
"ruby-cloud-gem-name=google-shopping-merchant-lfp-v1beta",
320324
],
321325
grpc_service_config = "lfp_grpc_service_config.json",
322326
rest_numeric_enums = True,
@@ -352,7 +356,6 @@ load(
352356

353357
csharp_proto_library(
354358
name = "lfp_csharp_proto",
355-
extra_opts = [],
356359
deps = [":lfp_proto"],
357360
)
358361

google/shopping/merchant/lfp/v1beta/lfp_grpc_service_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"methodConfig": [{
33
"name": [
44
{ "service": "google.shopping.merchant.lfp.v1beta.LfpInventoryService" },
5+
{ "service": "google.shopping.merchant.lfp.v1beta.LfpMerchantStateService" },
56
{ "service": "google.shopping.merchant.lfp.v1beta.LfpStoreService" },
67
{ "service": "google.shopping.merchant.lfp.v1beta.LfpSaleService" }
78
],
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
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.lfp.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+
24+
option go_package = "cloud.google.com/go/shopping/merchant/lfp/apiv1beta/lfppb;lfppb";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "LfpMerchantStateProto";
27+
option java_package = "com.google.shopping.merchant.lfp.v1beta";
28+
29+
// Service for a [LFP
30+
// partner](https://support.google.com/merchants/answer/7676652) to get the
31+
// state of a merchant.
32+
service LfpMerchantStateService {
33+
option (google.api.default_host) = "merchantapi.googleapis.com";
34+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
35+
36+
// Gets the LFP state of a merchant
37+
rpc GetLfpMerchantState(GetLfpMerchantStateRequest)
38+
returns (LfpMerchantState) {
39+
option (google.api.http) = {
40+
get: "/lfp/v1beta/{name=accounts/*/lfpMerchantStates/*}"
41+
};
42+
option (google.api.method_signature) = "name";
43+
}
44+
}
45+
46+
// The LFP state of a merchant.
47+
message LfpMerchantState {
48+
option (google.api.resource) = {
49+
type: "merchantapi.googleapis.com/LfpMerchantState"
50+
pattern: "accounts/{account}/lfpMerchantStates/{lfp_merchant_state}"
51+
plural: "lfpMerchantStates"
52+
singular: "lfpMerchantState"
53+
};
54+
55+
// The state of a specific merchant's store.
56+
message LfpStoreState {
57+
// The state of matching `LfpStore` to a Google Business Profile listing.
58+
enum StoreMatchingState {
59+
// Store matching state unspecified.
60+
STORE_MATCHING_STATE_UNSPECIFIED = 0;
61+
62+
// The `LfpStore` is successfully matched with a Google Business Profile
63+
// store.
64+
STORE_MATCHING_STATE_MATCHED = 1;
65+
66+
// The `LfpStore` is not matched with a Google Business Profile store.
67+
STORE_MATCHING_STATE_FAILED = 2;
68+
}
69+
70+
// Required. Immutable. The identifier of this store.
71+
string store_code = 1 [
72+
(google.api.field_behavior) = REQUIRED,
73+
(google.api.field_behavior) = IMMUTABLE
74+
];
75+
76+
// Output only. The store matching state.
77+
StoreMatchingState matching_state = 2
78+
[(google.api.field_behavior) = OUTPUT_ONLY];
79+
80+
// The hint of why the matching has failed (only set if matching_state is
81+
// FAILED).
82+
string matching_state_hint = 3;
83+
}
84+
85+
// The inventory statistics for a merchant.
86+
message InventoryStats {
87+
// Number of entries (understanding entry as a pair of product and store)
88+
// that were built based on provided inventories/sales and submitted to
89+
// Google.
90+
int64 submitted_entries = 1;
91+
92+
// Number of submitted in stock entries.
93+
int64 submitted_in_stock_entries = 2;
94+
95+
// Number of entries that were built based on provided
96+
// inventories/sales and couldn't be submitted to Google due to errors like
97+
// missing product.
98+
int64 unsubmitted_entries = 3;
99+
100+
// Number of products from provided inventories/sales that were created from
101+
// matches to existing online products provided by the merchant or to the
102+
// Google catalog.
103+
int64 submitted_products = 4;
104+
}
105+
106+
// Country-specific settings for the merchant.
107+
message CountrySettings {
108+
// The possible verification states for different merchant programs.
109+
enum VerificationState {
110+
// Verification state unspecified.
111+
VERIFICATION_STATE_UNSPECIFIED = 0;
112+
113+
// Verification state not approved.
114+
VERIFICATION_STATE_NOT_APPROVED = 1;
115+
116+
// Verification state in progress.
117+
VERIFICATION_STATE_IN_PROGRESS = 2;
118+
119+
// Verification state approved.
120+
VERIFICATION_STATE_APPROVED = 3;
121+
}
122+
123+
// The possible [product page
124+
// types](https://support.google.com/merchants/topic/15148370) for a
125+
// merchant.
126+
enum ProductPageType {
127+
// Product page type unspecified.
128+
PRODUCT_PAGE_TYPE_UNSPECIFIED = 0;
129+
130+
// Google hosted product page.
131+
GOOGLE_HOSTED = 1;
132+
133+
// Merchant hosted product page.
134+
MERCHANT_HOSTED = 2;
135+
136+
// Merchant hosted store specific product page.
137+
MERCHANT_HOSTED_STORE_SPECIFIC = 3;
138+
}
139+
140+
// Required. The [CLDR territory
141+
// code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml)
142+
// for the country for which these settings are defined.
143+
string region_code = 1 [(google.api.field_behavior) = REQUIRED];
144+
145+
// True if this merchant has enabled free local listings in MC.
146+
bool free_local_listings_enabled = 2;
147+
148+
// True if this merchant has enabled local inventory ads in MC.
149+
bool local_inventory_ads_enabled = 3;
150+
151+
// Output only. The verification state of this merchant's inventory check.
152+
VerificationState inventory_verification_state = 4
153+
[(google.api.field_behavior) = OUTPUT_ONLY];
154+
155+
// Output only. The product page type selected by this merchant.
156+
ProductPageType product_page_type = 5
157+
[(google.api.field_behavior) = OUTPUT_ONLY];
158+
159+
// Output only. The verification state of this merchant's instock serving
160+
// feature.
161+
VerificationState instock_serving_verification_state = 6
162+
[(google.api.field_behavior) = OUTPUT_ONLY];
163+
164+
// Output only. The verification state of this merchant's pickup serving
165+
// feature.
166+
VerificationState pickup_serving_verification_state = 7
167+
[(google.api.field_behavior) = OUTPUT_ONLY];
168+
}
169+
170+
// Identifier. The name of the `LfpMerchantState` resource. Format:
171+
// `accounts/{account}/lfpMerchantStates/{target_merchant}`
172+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
173+
174+
// Number of [GBPs](https://www.google.com/business/) this merchant has access
175+
// to.
176+
int64 linked_gbps = 2;
177+
178+
// Output only. The state per store from the specified merchant.
179+
repeated LfpStoreState store_states = 3
180+
[(google.api.field_behavior) = OUTPUT_ONLY];
181+
182+
// The inventory statistics for the merchant.
183+
InventoryStats inventory_stats = 4;
184+
185+
// Country-specific settings for the merchant.
186+
repeated CountrySettings country_settings = 5;
187+
}
188+
189+
// Request message for the GetLfpMerchantState method.
190+
message GetLfpMerchantStateRequest {
191+
// Required. The name of the state to retrieve.
192+
// Format: `accounts/{account}/lfpMerchantStates/{target_merchant}`
193+
string name = 1 [
194+
(google.api.field_behavior) = REQUIRED,
195+
(google.api.resource_reference) = {
196+
type: "merchantapi.googleapis.com/LfpMerchantState"
197+
}
198+
];
199+
}

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,39 @@ title: Merchant API
55

66
apis:
77
- name: google.shopping.merchant.lfp.v1beta.LfpInventoryService
8+
- name: google.shopping.merchant.lfp.v1beta.LfpMerchantStateService
89
- name: google.shopping.merchant.lfp.v1beta.LfpSaleService
910
- name: google.shopping.merchant.lfp.v1beta.LfpStoreService
1011

1112
documentation:
12-
summary: Programmatically manage your Merchant Center accounts.
13+
summary: Programmatically manage your Merchant Center Accounts.
14+
overview: |-
15+
Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you
16+
to programmatically manage your accounts. Conversions Sub-API: Enables you
17+
to programmatically manage your conversion sources for a merchant account.
18+
Datasources Sub-API: Enables you to programmatically manage your
19+
datasources. Inventories Sub-API: This bundle enables you to
20+
programmatically manage your local and regional inventories. Local Feeds
21+
Partnerships Sub-API: This bundle enables LFP partners to submit local
22+
inventories for a merchant. Notifications Sub-API: This bundle enables you
23+
to programmatically manage your notification subscriptions. Products
24+
Sub-API: This bundle enables you to programmatically manage your products.
25+
Promotions Sub-API: This bundle enables you to programmatically manage
26+
your promotions for products. Quota Sub-API: This bundle enables you to
27+
list your quotas for all APIs you are using. Reports Sub-API: This bundle
28+
enables you to programmatically retrieve reports and insights about
29+
products, their performance and their competitive environment.
1330
1431
authentication:
1532
rules:
1633
- selector: google.shopping.merchant.lfp.v1beta.LfpInventoryService.InsertLfpInventory
1734
oauth:
1835
canonical_scopes: |-
1936
https://www.googleapis.com/auth/content
37+
- selector: google.shopping.merchant.lfp.v1beta.LfpMerchantStateService.GetLfpMerchantState
38+
oauth:
39+
canonical_scopes: |-
40+
https://www.googleapis.com/auth/content
2041
- selector: google.shopping.merchant.lfp.v1beta.LfpSaleService.InsertLfpSale
2142
oauth:
2243
canonical_scopes: |-

0 commit comments

Comments
 (0)