Skip to content

Commit b2fc92c

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add a new destinations field
docs: A comment for field `promotion_data_source` in message `.google.shopping.merchant.datasources.v1beta.DataSource` is changed docs: A comment for field `channel` in message `.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource` is changed PiperOrigin-RevId: 736533159
1 parent fa21981 commit b2fc92c

4 files changed

Lines changed: 67 additions & 9 deletions

File tree

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ load(
6666

6767
java_proto_library(
6868
name = "datasources_java_proto",
69-
deps = [":datasources_proto"],
69+
deps = [
70+
":datasources_proto",
71+
"//google/shopping/type:type_proto", # Added manually
72+
],
7073
)
7174

7275
java_grpc_library(
@@ -178,21 +181,31 @@ load(
178181
"@com_google_googleapis_imports//:imports.bzl",
179182
"py_gapic_assembly_pkg",
180183
"py_gapic_library",
184+
"py_import",
181185
"py_test",
182186
)
183187

188+
py_import(
189+
name = "shopping_type",
190+
srcs = [
191+
"//google/shopping/type:type_py_gapic",
192+
],
193+
)
194+
184195
py_gapic_library(
185196
name = "datasources_py_gapic",
186197
srcs = [":datasources_proto"],
187198
grpc_service_config = "datasources_grpc_service_config.json",
188199
opt_args = [
200+
"proto-plus-deps=google.shopping.type", # Added manually
189201
"python-gapic-name=merchant_datasources",
190202
"python-gapic-namespace=google.shopping",
191203
],
192204
rest_numeric_enums = True,
193205
service_yaml = "merchantapi_v1beta.yaml",
194206
transport = "grpc+rest",
195207
deps = [
208+
":shopping_type", # Added manually
196209
],
197210
)
198211

@@ -280,6 +293,7 @@ nodejs_gapic_assembly_pkg(
280293
deps = [
281294
":datasources_nodejs_gapic",
282295
":datasources_proto",
296+
"//google/shopping/type:type_proto", # Added manually
283297
],
284298
)
285299

@@ -309,7 +323,10 @@ ruby_grpc_library(
309323
ruby_cloud_gapic_library(
310324
name = "datasources_ruby_gapic",
311325
srcs = [":datasources_proto_with_info"],
312-
extra_protoc_parameters = ["ruby-cloud-gem-name=google-shopping-merchant-data_sources-v1beta"],
326+
extra_protoc_parameters = [
327+
"ruby-cloud-extra-dependencies=google-shopping-type=>0.0+<2.a",
328+
"ruby-cloud-gem-name=google-shopping-merchant-data_sources-v1beta",
329+
],
313330
grpc_service_config = "datasources_grpc_service_config.json",
314331
rest_numeric_enums = True,
315332
service_yaml = "merchantapi_v1beta.yaml",

google/shopping/merchant/datasources/v1beta/datasources.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ message DataSource {
167167
// source.
168168
RegionalInventoryDataSource regional_inventory_data_source = 7;
169169

170-
// The
171-
// [promotion](https://support.google.com/merchants/answer/2906014) data
172-
// source.
170+
// The [promotion](https://support.google.com/merchants/answer/2906014)
171+
// data source.
173172
PromotionDataSource promotion_data_source = 8;
174173

175174
// The [product

google/shopping/merchant/datasources/v1beta/datasourcetypes.proto

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syntax = "proto3";
1717
package google.shopping.merchant.datasources.v1beta;
1818

1919
import "google/api/field_behavior.proto";
20+
import "google/shopping/type/types.proto";
2021

2122
option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1Beta";
2223
option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb";
@@ -54,6 +55,29 @@ message PrimaryProductDataSource {
5455
[(google.api.field_behavior) = REQUIRED];
5556
}
5657

58+
// Destinations also known as [Marketing
59+
// methods](https://support.google.com/merchants/answer/15130232) selections.
60+
message Destination {
61+
// The state of the destination.
62+
enum State {
63+
// Not specified.
64+
STATE_UNSPECIFIED = 0;
65+
66+
// Indicates that the destination is enabled.
67+
ENABLED = 1;
68+
69+
// Indicates that the destination is disabled.
70+
DISABLED = 2;
71+
}
72+
73+
// [Marketing methods](https://support.google.com/merchants/answer/15130232)
74+
// (also known as destination) selections.
75+
google.shopping.type.Destination.DestinationEnum destination = 1;
76+
77+
// The state of the destination.
78+
State state = 2;
79+
}
80+
5781
// Data Source Channel.
5882
//
5983
// Channel is used to distinguish between data sources for different product
@@ -74,9 +98,9 @@ message PrimaryProductDataSource {
7498
PRODUCTS = 3;
7599
}
76100

77-
// Required. Immutable. Specifies the type of data source channel.
101+
// Optional. Immutable. Specifies the type of data source channel.
78102
Channel channel = 3 [
79-
(google.api.field_behavior) = REQUIRED,
103+
(google.api.field_behavior) = OPTIONAL,
80104
(google.api.field_behavior) = IMMUTABLE
81105
];
82106

@@ -123,6 +147,26 @@ message PrimaryProductDataSource {
123147
// Optional. Default rule management of the data source. If set, the linked
124148
// data sources will be replaced.
125149
DefaultRule default_rule = 7 [(google.api.field_behavior) = OPTIONAL];
150+
151+
// Optional. A list of destinations describing where products of the data
152+
// source can be shown.
153+
//
154+
// When retrieving the data source, the list contains all the destinations
155+
// that can be used for the data source, including the ones that are disabled
156+
// for the data source but enabled for the account.
157+
//
158+
// Only destinations that are enabled on the account, for example through
159+
// program participation, can be enabled on the data source.
160+
//
161+
// If unset, during creation, the destinations will be inherited based on the
162+
// account level program participation.
163+
//
164+
// If set, during creation or update, the data source will be set only for the
165+
// specified destinations.
166+
//
167+
// Updating this field requires at least one destination.
168+
repeated Destination destinations = 10
169+
[(google.api.field_behavior) = OPTIONAL];
126170
}
127171

128172
// The supplemental data source for local and online products. After creation,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ publishing:
5151
common:
5252
destinations:
5353
- PACKAGE_MANAGER
54-
cpp_settings:
55-
common: {}
5654
php_settings:
5755
common:
5856
destinations:

0 commit comments

Comments
 (0)