Skip to content

Commit

Permalink
feat: [google-shopping-merchant-datasources] New field `product_revie…
Browse files Browse the repository at this point in the history
…w_data_source` added in message `.google.shopping.merchant.datasources.v1beta.DataSource` to specify the datasource of the product review (#13413)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: New field product_review_data_source added in message
google.shopping.merchant.datasources.v1beta.DataSource to
feat: New field `merchant_review_data_source` added in message
`.google.shopping.merchant.datasources.v1beta.DataSource` to specify the
datasource of the merchant review
feat: A new message `ProductReviewDataSource` is added to specify the
datasource of the product review
feat: A new message `MerchantReviewDataSource` is added to specify the
datasource of the merchant review
docs: A comment for field `take_from_data_sources` in message
`.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource`
is changed
docs: A comment for message `SupplementalProductDataSource` is changed
docs: A comment for field `feed_label` in message
`.google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource`
is changed
docs: A comment for field `username` in message
`.google.shopping.merchant.datasources.v1beta.FileInput` is changed
docs: A comment for field `password` in message
`.google.shopping.merchant.datasources.v1beta.FileInput` is changed
docs: A comment for enum value `FETCH` in enum `FileInputType` is
changed
docs: A comment for enum value `GOOGLE_SHEETS` in enum `FileInputType`
is changed
END_COMMIT_OVERRIDE

feat: New field `merchant_review_data_source` added in message
`.google.shopping.merchant.datasources.v1beta.DataSource` to specify the
datasource of the merchant review
feat: A new message `ProductReviewDataSource` is added to specify the
datasource of the product review
feat: A new message `MerchantReviewDataSource` is added to specify the
datasource of the merchant review
docs: A comment for field `take_from_data_sources` in message
`.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource`
is changed
docs: A comment for message `SupplementalProductDataSource` is changed
docs: A comment for field `feed_label` in message
`.google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource`
is changed
docs: A comment for field `username` in message
`.google.shopping.merchant.datasources.v1beta.FileInput` is changed
docs: A comment for field `password` in message
`.google.shopping.merchant.datasources.v1beta.FileInput` is changed
docs: A comment for enum value `FETCH` in enum `FileInputType` is
changed
docs: A comment for enum value `GOOGLE_SHEETS` in enum `FileInputType`
is changed

PiperOrigin-RevId: 713234506

Source-Link:
googleapis/googleapis@51b9a3d

Source-Link:
googleapis/googleapis-gen@6b4a55f
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LWRhdGFzb3VyY2VzLy5Pd2xCb3QueWFtbCIsImgiOiI2YjRhNTVmMGY0ZmYyNDRkYjg4OGU0YzQ1YTVlY2U1NjM0NjMyY2IwIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent 9f278d6 commit e89d3b2
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
from google.shopping.merchant_datasources_v1beta.types.datasourcetypes import (
DataSourceReference,
LocalInventoryDataSource,
MerchantReviewDataSource,
PrimaryProductDataSource,
ProductReviewDataSource,
PromotionDataSource,
RegionalInventoryDataSource,
SupplementalProductDataSource,
Expand All @@ -69,7 +71,9 @@
"UpdateDataSourceRequest",
"DataSourceReference",
"LocalInventoryDataSource",
"MerchantReviewDataSource",
"PrimaryProductDataSource",
"ProductReviewDataSource",
"PromotionDataSource",
"RegionalInventoryDataSource",
"SupplementalProductDataSource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.6" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
from .types.datasourcetypes import (
DataSourceReference,
LocalInventoryDataSource,
MerchantReviewDataSource,
PrimaryProductDataSource,
ProductReviewDataSource,
PromotionDataSource,
RegionalInventoryDataSource,
SupplementalProductDataSource,
Expand All @@ -64,7 +66,9 @@
"ListDataSourcesRequest",
"ListDataSourcesResponse",
"LocalInventoryDataSource",
"MerchantReviewDataSource",
"PrimaryProductDataSource",
"ProductReviewDataSource",
"PromotionDataSource",
"RegionalInventoryDataSource",
"SupplementalProductDataSource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.6" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
from .datasourcetypes import (
DataSourceReference,
LocalInventoryDataSource,
MerchantReviewDataSource,
PrimaryProductDataSource,
ProductReviewDataSource,
PromotionDataSource,
RegionalInventoryDataSource,
SupplementalProductDataSource,
Expand All @@ -45,7 +47,9 @@
"UpdateDataSourceRequest",
"DataSourceReference",
"LocalInventoryDataSource",
"MerchantReviewDataSource",
"PrimaryProductDataSource",
"ProductReviewDataSource",
"PromotionDataSource",
"RegionalInventoryDataSource",
"SupplementalProductDataSource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,46 @@ class DataSource(proto.Message):
Attributes:
primary_product_data_source (google.shopping.merchant_datasources_v1beta.types.PrimaryProductDataSource):
Required. The `primary data
The `primary data
source <https://support.google.com/merchants/answer/7439058>`__
for local and online products.
This field is a member of `oneof`_ ``Type``.
supplemental_product_data_source (google.shopping.merchant_datasources_v1beta.types.SupplementalProductDataSource):
Required. The `supplemental data
The `supplemental data
source <https://support.google.com/merchants/answer/7439058>`__
for local and online products.
This field is a member of `oneof`_ ``Type``.
local_inventory_data_source (google.shopping.merchant_datasources_v1beta.types.LocalInventoryDataSource):
Required. The `local
The `local
inventory <https://support.google.com/merchants/answer/7023001>`__
data source.
This field is a member of `oneof`_ ``Type``.
regional_inventory_data_source (google.shopping.merchant_datasources_v1beta.types.RegionalInventoryDataSource):
Required. The `regional
The `regional
inventory <https://support.google.com/merchants/answer/7439058>`__
data source.
This field is a member of `oneof`_ ``Type``.
promotion_data_source (google.shopping.merchant_datasources_v1beta.types.PromotionDataSource):
Required. The
The
`promotion <https://support.google.com/merchants/answer/2906014>`__
data source.
This field is a member of `oneof`_ ``Type``.
product_review_data_source (google.shopping.merchant_datasources_v1beta.types.ProductReviewDataSource):
The `product
review <https://support.google.com/merchants/answer/7045996>`__
data source.
This field is a member of `oneof`_ ``Type``.
merchant_review_data_source (google.shopping.merchant_datasources_v1beta.types.MerchantReviewDataSource):
The `merchant
review <https://support.google.com/merchants/answer/7045996>`__
data source.
This field is a member of `oneof`_ ``Type``.
name (str):
Identifier. The name of the data source. Format:
Expand Down Expand Up @@ -170,6 +182,18 @@ class Input(proto.Enum):
oneof="Type",
message=datasourcetypes.PromotionDataSource,
)
product_review_data_source: datasourcetypes.ProductReviewDataSource = proto.Field(
proto.MESSAGE,
number=9,
oneof="Type",
message=datasourcetypes.ProductReviewDataSource,
)
merchant_review_data_source: datasourcetypes.MerchantReviewDataSource = proto.Field(
proto.MESSAGE,
number=12,
oneof="Type",
message=datasourcetypes.MerchantReviewDataSource,
)
name: str = proto.Field(
proto.STRING,
number=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"LocalInventoryDataSource",
"RegionalInventoryDataSource",
"PromotionDataSource",
"ProductReviewDataSource",
"MerchantReviewDataSource",
"DataSourceReference",
},
)
Expand Down Expand Up @@ -123,10 +125,7 @@ class DefaultRule(proto.Message):
a new reference to this list (in sequential order).
To unlink the data source from the default rule, you need to
remove the given reference from this list. To create
attribute rules that are different from the default rule,
see `Set up your attribute
rules <//support.google.com/merchants/answer/14994083>`__.
remove the given reference from this list.
Changing the order of this list will result in changing the
priority of data sources in the default rule.
Expand Down Expand Up @@ -173,12 +172,9 @@ class DefaultRule(proto.Message):

class SupplementalProductDataSource(proto.Message):
r"""The supplemental data source for local and online products.
Supplemental API data sources must not have ``feedLabel`` and
``contentLanguage`` fields set. You can only use supplemental data
sources to update existing products. For information about creating
a supplemental data source, see `Create a supplemental data source
and link it to the primary data
source </merchant/api/guides/data-sources/overview#create-supplemental-data-source>`__.
After creation, you should make sure to link the supplemental
product data source into one or more primary product data
sources.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Expand All @@ -196,7 +192,11 @@ class SupplementalProductDataSource(proto.Message):
``feedLabel`` and ``contentLanguage`` must be either both
set or unset for data sources with product content type.
They must be set for data sources with a file input.
They must be set for data sources with a [file
input][google.shopping.merchant.datasources.v1main.FileInput].
The fields must be unset for data sources without [file
input][google.shopping.merchant.datasources.v1main.FileInput].
If set, the data source will only accept products matching
this combination. If unset, the data source will accept
Expand Down Expand Up @@ -327,6 +327,14 @@ class PromotionDataSource(proto.Message):
)


class ProductReviewDataSource(proto.Message):
r"""The product review data source."""


class MerchantReviewDataSource(proto.Message):
r"""The merchant review data source."""


class DataSourceReference(proto.Message):
r"""Data source reference can be used to manage related data
sources within the data source service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class FileInputType(proto.Enum):
Center.
FETCH (2):
The file is fetched from the configured
[fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
[fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
GOOGLE_SHEETS (3):
The file is fetched from Google Sheets specified in the
[fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
[fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
"""
FILE_INPUT_TYPE_UNSPECIFIED = 0
UPLOAD = 1
Expand Down Expand Up @@ -102,13 +102,13 @@ class FetchSettings(proto.Message):
to be a valid link using one of those three
protocols. Immutable for Google Sheets files.
username (str):
Optional. An optional user name for [fetch
url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
Optional. An optional user name for
[fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
Used for `submitting data sources through
SFTP <https://support.google.com/merchants/answer/13813117>`__.
password (str):
Optional. An optional password for [fetch
url][google.shopping.content.bundles.DataSources.FileInput.fetch_url].
Optional. An optional password for
[fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
Used for `submitting data sources through
SFTP <https://support.google.com/merchants/answer/13813117>`__.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-shopping-merchant-datasources",
"version": "0.1.6"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5223,6 +5223,8 @@ def test_create_data_source_rest_call_success(request_type):
"target_country": "target_country_value",
"content_language": "content_language_value",
},
"product_review_data_source": {},
"merchant_review_data_source": {},
"name": "name_value",
"data_source_id": 1462,
"display_name": "display_name_value",
Expand Down Expand Up @@ -5476,6 +5478,8 @@ def test_update_data_source_rest_call_success(request_type):
"target_country": "target_country_value",
"content_language": "content_language_value",
},
"product_review_data_source": {},
"merchant_review_data_source": {},
"name": "accounts/sample1/dataSources/sample2",
"data_source_id": 1462,
"display_name": "display_name_value",
Expand Down

0 comments on commit e89d3b2

Please sign in to comment.