Skip to content

Commit

Permalink
feat: fix inventories sub-API publication by adding correct child_typ…
Browse files Browse the repository at this point in the history
…e in the API proto

  docs: A comment for field `store_code` in message `.google.shopping.merchant.inventories.v1beta.LocalInventory` is changed

docs: A comment for field `region` in message `.google.shopping.merchant.inventories.v1beta.RegionalInventory` is changed
PiperOrigin-RevId: 623809565
  • Loading branch information
Google APIs authored and Copybara-Service committed Apr 11, 2024
1 parent 8b928ba commit 5e42183
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 69 deletions.
51 changes: 31 additions & 20 deletions google/shopping/merchant/inventories/v1beta/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel

Expand All @@ -10,14 +9,17 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# buildifier: disable=load-on-top

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "inventories_proto",
Expand Down Expand Up @@ -47,6 +49,7 @@ proto_library_with_info(
##############################################################################
# Java
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
Expand Down Expand Up @@ -81,6 +84,7 @@ java_gapic_library(
deps = [
":inventories_java_proto",
"//google/shopping/type:type_java_proto", # Added manually
"//google/api:api_java_proto",
],
)

Expand Down Expand Up @@ -112,6 +116,7 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
Expand Down Expand Up @@ -161,6 +166,7 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
Expand Down Expand Up @@ -214,6 +220,7 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
Expand Down Expand Up @@ -251,6 +258,7 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
Expand Down Expand Up @@ -282,6 +290,7 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
Expand Down Expand Up @@ -331,6 +340,7 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
Expand All @@ -341,7 +351,6 @@ load(

csharp_proto_library(
name = "inventories_csharp_proto",
extra_opts = [],
deps = [":inventories_proto"],
)

Expand All @@ -358,6 +367,7 @@ csharp_gapic_library(
grpc_service_config = "inventories_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "merchantapi_v1beta.yaml",
transport = "grpc+rest",
deps = [
":inventories_csharp_grpc",
":inventories_csharp_proto",
Expand All @@ -377,20 +387,21 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# load(
# "@com_google_googleapis_imports//:imports.bzl",
# "cc_grpc_library",
# "cc_proto_library",
# )
#
# cc_proto_library(
# name = "inventories_cc_proto",
# deps = [":inventories_proto"],
# )
#
# cc_grpc_library(
# name = "inventories_cc_grpc",
# srcs = [":inventories_proto"],
# grpc_only = True,
# deps = [":inventories_cc_proto"],
# )
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)

cc_proto_library(
name = "inventories_cc_proto",
deps = [":inventories_proto"],
)

cc_grpc_library(
name = "inventories_cc_grpc",
srcs = [":inventories_proto"],
grpc_only = True,
deps = [":inventories_cc_proto"],
)
32 changes: 25 additions & 7 deletions google/shopping/merchant/inventories/v1beta/localinventory.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ option go_package = "cloud.google.com/go/shopping/merchant/inventories/apiv1beta
option java_multiple_files = true;
option java_outer_classname = "LocalInventoryProto";
option java_package = "com.google.shopping.merchant.inventories.v1beta";
option (google.api.resource_definition) = {
type: "merchantapi.googleapis.com/Product"
pattern: "accounts/{account}/products/{product}"
};

// Service to manage local inventory for products
service LocalInventoryService {
Expand Down Expand Up @@ -99,11 +103,15 @@ message LocalInventory {
// if set by the client.
int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Store code (the store ID from your Business Profile) of the
// physical store the product is sold in. See the [Local product inventory
// feed specification](https://support.google.com/merchants/answer/3061342)
// for more information.
string store_code = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Immutable. Store code (the store ID from your Business Profile)
// of the physical store the product is sold in. See the [Local product
// inventory feed
// specification](https://support.google.com/merchants/answer/3061342) for
// more information.
string store_code = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Price of the product at this store.
google.shopping.type.Price price = 4;
Expand Down Expand Up @@ -154,7 +162,12 @@ message ListLocalInventoriesRequest {
// Required. The `name` of the parent product to list local inventories for.
// Format:
// `accounts/{account}/products/{product}`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "merchantapi.googleapis.com/LocalInventory"
}
];

// The maximum number of `LocalInventory` resources for the given
// product to return. The service returns fewer than this value if the number
Expand Down Expand Up @@ -188,7 +201,12 @@ message ListLocalInventoriesResponse {
message InsertLocalInventoryRequest {
// Required. The account and product where this inventory will be inserted.
// Format: `accounts/{account}/products/{product}`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "merchantapi.googleapis.com/LocalInventory"
}
];

// Required. Local inventory information of the product. If the product
// already has a `LocalInventory` resource for the same `storeCode`, full
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,6 @@ publishing:
common:
destinations:
- PACKAGE_MANAGER
cpp_settings:
common:
destinations:
- PACKAGE_MANAGER
php_settings:
common:
destinations:
- PACKAGE_MANAGER
python_settings:
common:
destinations:
- PACKAGE_MANAGER
node_settings:
common:
destinations:
- PACKAGE_MANAGER
dotnet_settings:
common:
destinations:
- PACKAGE_MANAGER
ruby_settings:
common:
destinations:
- PACKAGE_MANAGER
go_settings:
common:
destinations:
- PACKAGE_MANAGER
- version: google.shopping.merchant.reports.v1beta
launch_stage: BETA
java_settings:
common:
destinations:
- PACKAGE_MANAGER
cpp_settings:
common:
destinations:
- PACKAGE_MANAGER
php_settings:
common:
destinations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ message RegionalInventory {
// if set by the client.
int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. ID of the region for this
// Required. Immutable. ID of the region for this
// `RegionalInventory` resource. See the [Regional availability and
// pricing](https://support.google.com/merchants/answer/9698880) for more
// details.
string region = 3 [(google.api.field_behavior) = REQUIRED];
string region = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Price of the product in this region.
google.shopping.type.Price price = 4;
Expand Down Expand Up @@ -134,7 +137,12 @@ message RegionalInventory {
message ListRegionalInventoriesRequest {
// Required. The `name` of the parent product to list `RegionalInventory`
// resources for. Format: `accounts/{account}/products/{product}`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "merchantapi.googleapis.com/RegionalInventory"
}
];

// The maximum number of `RegionalInventory` resources for the given product
// to return. The service returns fewer than this value if the number of
Expand Down Expand Up @@ -168,7 +176,12 @@ message ListRegionalInventoriesResponse {
message InsertRegionalInventoryRequest {
// Required. The account and product where this inventory will be inserted.
// Format: `accounts/{account}/products/{product}`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "merchantapi.googleapis.com/RegionalInventory"
}
];

// Required. Regional inventory information to add to the product. If the
// product already has a `RegionalInventory` resource for the same `region`,
Expand Down

0 comments on commit 5e42183

Please sign in to comment.