As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Shopping Merchant Datasources v1 API

class google.shopping.merchant_datasources_v1.types.CreateDataSourceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the CreateDataSource method.

parent

Required. The account where this data source will be created. Format: accounts/{account}

Type

str

data_source

Required. The data source to create.

Type

google.shopping.merchant_datasources_v1.types.DataSource

class google.shopping.merchant_datasources_v1.types.DataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The data source for the Merchant Center account.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

primary_product_data_source

The primary data source for local and online products.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.PrimaryProductDataSource

supplemental_product_data_source

The supplemental data source for local and online products.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.SupplementalProductDataSource

local_inventory_data_source

The local inventory data source.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.LocalInventoryDataSource

regional_inventory_data_source

The regional inventory data source.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.RegionalInventoryDataSource

promotion_data_source

The promotion data source.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.PromotionDataSource

product_review_data_source

The product review data source.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.ProductReviewDataSource

merchant_review_data_source

The merchant review data source.

This field is a member of oneof Type.

Type

google.shopping.merchant_datasources_v1.types.MerchantReviewDataSource

name

Required. Identifier. The name of the data source. Format: accounts/{account}/dataSources/{datasource}

Type

str

data_source_id

Output only. The data source id.

Type

int

display_name

Required. The displayed data source name in the Merchant Center UI.

Type

str

input

Output only. Determines the type of input to the data source. Based on the input some settings might not work. Only generic data sources can be created through the API.

Type

google.shopping.merchant_datasources_v1.types.DataSource.Input

file_input

Optional. The field is used only when data is managed through a file.

Type

google.shopping.merchant_datasources_v1.types.FileInput

class Input(value)[source]

Bases: proto.enums.Enum

Determines the type of input to the data source. Based on the input some settings might not be supported.

Values:
INPUT_UNSPECIFIED (0):

Input unspecified.

API (1):

Represents data sources for which the data is primarily provided through the API.

FILE (2):

Represents data sources for which the data is primarily provided through file input. Data can still be provided through the API.

UI (3):

The data source for products added directly in Merchant Center. This type of data source can not be created or updated through this API, only by Merchant Center UI.

This type of data source is read only.

AUTOFEED (4):

This is also known as Automated feeds used to automatically build your product data. This type of data source can be enabled or disabled through the Accounts sub-API.

class google.shopping.merchant_datasources_v1.types.DataSourceReference(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Data source reference can be used to manage related data sources within the data source service.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

self_

Self should be used to reference the primary data source itself.

This field is a member of oneof data_source_id.

Type

bool

primary_data_source_name

Optional. The name of the primary data source. Format: accounts/{account}/dataSources/{datasource}

This field is a member of oneof data_source_id.

Type

str

supplemental_data_source_name

Optional. The name of the supplemental data source. Format: accounts/{account}/dataSources/{datasource}

This field is a member of oneof data_source_id.

Type

str

class google.shopping.merchant_datasources_v1.types.DeleteDataSourceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the DeleteDataSource method.

name

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

Type

str

class google.shopping.merchant_datasources_v1.types.FetchDataSourceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the FetchDataSource method.

name

Required. The name of the data source resource to fetch. Format: accounts/{account}/dataSources/{datasource}

Type

str

class google.shopping.merchant_datasources_v1.types.FileInput(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The data specific for file data sources. This field is empty for other data source inputs.

fetch_settings

Optional. Fetch details to deliver the data source. It contains settings for FETCH and GOOGLE_SHEETS file input types. The required fields vary based on the frequency of fetching.

Type

google.shopping.merchant_datasources_v1.types.FileInput.FetchSettings

file_name

Optional. The file name of the data source. Required for UPLOAD file input type.

Type

str

file_input_type

Output only. The type of file input.

Type

google.shopping.merchant_datasources_v1.types.FileInput.FileInputType

class FetchSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Fetch details to deliver the data source.

enabled

Optional. Enables or pauses the fetch schedule.

Type

bool

day_of_month

Optional. The day of the month when the data source file should be fetched (1-31). This field can only be set for monthly frequency.

Type

int

time_of_day

Optional. The hour of the day when the data source file should be fetched. Minutes and seconds are not supported and will be ignored.

Type

google.type.timeofday_pb2.TimeOfDay

day_of_week

Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency.

Type

google.type.dayofweek_pb2.DayOfWeek

time_zone

Optional. Time zone used for schedule. UTC by default. For example, “America/Los_Angeles”.

Type

str

frequency

Required. The frequency describing fetch schedule.

Type

google.shopping.merchant_datasources_v1.types.FileInput.FetchSettings.Frequency

fetch_uri

Optional. The URL where the data source file can be fetched. Google Merchant Center supports automatic scheduled uploads using the HTTP, HTTPS or SFTP protocols, so the value will need to be a valid link using one of those three protocols. Immutable for Google Sheets files.

Type

str

username

Optional. An optional user name for [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. Used for submitting data sources through SFTP.

Type

str

password

Optional. An optional password for [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. Used for submitting data sources through SFTP.

Type

str

class Frequency(value)[source]

Bases: proto.enums.Enum

The required fields vary based on the frequency of fetching. For a monthly fetch schedule, day of month and hour of day are required. For a weekly fetch schedule, day of week and hour of day are required. For a daily fetch schedule, only an hour of day is required.

Values:
FREQUENCY_UNSPECIFIED (0):

Frequency unspecified.

FREQUENCY_DAILY (1):

The fetch happens every day.

FREQUENCY_WEEKLY (2):

The fetch happens every week.

FREQUENCY_MONTHLY (3):

The fetch happens every month.

class FileInputType(value)[source]

Bases: proto.enums.Enum

The method of file delivery.

Values:
FILE_INPUT_TYPE_UNSPECIFIED (0):

File input type unspecified.

UPLOAD (1):

The file is uploaded through SFTP, Google Cloud Storage or manually in the Merchant Center.

FETCH (2):

The file is fetched from the configured [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].

GOOGLE_SHEETS (3):

The file is fetched from Google Sheets specified in the [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. However, you can’t set up GOOGLE_SHEETS as a data source through the API. To add GOOGLE_SHEETS as a data source through the Merchant Center, see Add products to Merchant Center.

class google.shopping.merchant_datasources_v1.types.FileUpload(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The file upload of a specific data source, that is, the result of the retrieval of the data source at a certain timestamp computed asynchronously when the data source processing is finished. Only applicable to file data sources.

name

Identifier. The name of the data source file upload. Format: {datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}

Type

str

data_source_id

Output only. The data source id.

Type

int

processing_state

Output only. The processing state of the data source.

Type

google.shopping.merchant_datasources_v1.types.FileUpload.ProcessingState

issues

Output only. The list of issues occurring in the data source.

Type

MutableSequence[google.shopping.merchant_datasources_v1.types.FileUpload.Issue]

items_total

Output only. The number of items in the data source that were processed.

Type

int

items_created

Output only. The number of items in the data source that were created.

Type

int

items_updated

Output only. The number of items in the data source that were updated.

Type

int

upload_time

Output only. The date at which the file of the data source was uploaded.

Type

google.protobuf.timestamp_pb2.Timestamp

class Issue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An error occurring in the data source, like “invalid price”.

title

Output only. The title of the issue, for example, “Item too big”.

Type

str

description

Output only. The error description, for example, “Your data source contains items which have too many attributes, or are too big. These items will be dropped”.

Type

str

code

Output only. The code of the error, for example, “validation/invalid_value”. Returns “?” if the code is unknown.

Type

str

count

Output only. The number of occurrences of the error in the file upload.

Type

int

severity

Output only. The severity of the issue.

Type

google.shopping.merchant_datasources_v1.types.FileUpload.Issue.Severity

documentation_uri

Output only. Link to the documentation explaining the issue in more details, if available.

Type

str

class Severity(value)[source]

Bases: proto.enums.Enum

The severity of the issue.

Values:
SEVERITY_UNSPECIFIED (0):

Severity unspecified.

WARNING (1):

The issue is the warning.

ERROR (2):

The issue is an error.

class ProcessingState(value)[source]

Bases: proto.enums.Enum

The processing state of the data source.

Values:
PROCESSING_STATE_UNSPECIFIED (0):

Processing state unspecified.

FAILED (1):

The data source could not be processed or all the items had errors.

IN_PROGRESS (2):

The data source is being processed.

SUCCEEDED (3):

The data source was processed successfully, though some items might have had errors.

class google.shopping.merchant_datasources_v1.types.GetDataSourceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the GetDataSource method.

name

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

Type

str

class google.shopping.merchant_datasources_v1.types.GetFileUploadRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the GetFileUploadRequest method.

name

Required. The name of the data source file upload to retrieve. Format: accounts/{account}/dataSources/{datasource}/fileUploads/latest

Type

str

class google.shopping.merchant_datasources_v1.types.ListDataSourcesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the ListDataSources method.

parent

Required. The account to list data sources for. Format: accounts/{account}

Type

str

page_size

Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.

Type

int

page_token

Optional. A page token, received from a previous ListDataSources call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListDataSources must match the call that provided the page token.

Type

str

class google.shopping.merchant_datasources_v1.types.ListDataSourcesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message for the ListDataSources method.

data_sources

The data sources from the specified account.

Type

MutableSequence[google.shopping.merchant_datasources_v1.types.DataSource]

next_page_token

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Type

str

class google.shopping.merchant_datasources_v1.types.LocalInventoryDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The local inventory data source type is only available for file inputs and can’t be used to create API local inventory data sources.

feed_label

Required. Immutable. The feed label of the offers to which the local inventory is provided.

Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-).

See also migration to feed labels.

Type

str

content_language

Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided.

Type

str

class google.shopping.merchant_datasources_v1.types.MerchantReviewDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The merchant review data source.

class google.shopping.merchant_datasources_v1.types.PrimaryProductDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The primary data source for local and online products.

legacy_local

Optional. Immutable. Determines whether the products of this data source are only targeting local destinations. Legacy local products are prefixed with local~ in the product resource ID. For example, accounts/123/products/local~en~US~sku123.

Type

bool

feed_label

Optional. Immutable. The feed label that is specified on the data source level.

Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-).

See also migration to feed labels.

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.

If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.

This field is a member of oneof _feed_label.

Type

str

content_language

Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source.

feedLabel and contentLanguage must be either both set or unset. The fields can only be unset for data sources without file input.

If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.

This field is a member of oneof _content_language.

Type

str

countries

Optional. The countries where the items may be displayed. Represented as a CLDR territory code.

Type

MutableSequence[str]

default_rule

Optional. Default rule management of the data source. If set, the linked data sources will be replaced.

Type

google.shopping.merchant_datasources_v1.types.PrimaryProductDataSource.DefaultRule

destinations

Optional. A list of destinations describing where products of the data source can be shown.

When retrieving the data source, the list contains all the destinations that can be used for the data source, including the ones that are disabled for the data source but enabled for the account.

Only destinations that are enabled on the account, for example through program participation, can be enabled on the data source.

If unset, during creation, the destinations will be inherited based on the account level program participation.

If set, during creation or update, the data source will be set only for the specified destinations.

Updating this field requires at least one destination.

Type

MutableSequence[google.shopping.merchant_datasources_v1.types.PrimaryProductDataSource.Destination]

class DefaultRule(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Default rule management of the data source.

take_from_data_sources

Required. The list of data sources linked in the default rule. This list is ordered by the default rule priority of joining the data. It might include none or multiple references to self and supplemental data sources.

The list must not be empty.

To link the data source to the default rule, you need to add 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.

Changing the order of this list will result in changing the priority of data sources in the default rule.

For example, providing the following list: [1001, self] will take attribute values from supplemental data source 1001, and fallback to self if the attribute is not set in 1001.

Type

MutableSequence[google.shopping.merchant_datasources_v1.types.DataSourceReference]

class Destination(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Destinations also known as Marketing methods selections.

destination

Marketing methods (also known as destination) selections.

Type

google.shopping.type.types.Destination.DestinationEnum

state

The state of the destination.

Type

google.shopping.merchant_datasources_v1.types.PrimaryProductDataSource.Destination.State

class State(value)[source]

Bases: proto.enums.Enum

The state of the destination.

Values:
STATE_UNSPECIFIED (0):

Not specified.

ENABLED (1):

Indicates that the destination is enabled.

DISABLED (2):

Indicates that the destination is disabled.

class google.shopping.merchant_datasources_v1.types.ProductReviewDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The product review data source.

class google.shopping.merchant_datasources_v1.types.PromotionDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The promotion data source.

target_country

Required. Immutable. The target country used as part of the unique identifier. Represented as a CLDR territory code.

Promotions are only available in selected countries.

Type

str

content_language

Required. Immutable. The two-letter ISO 639-1 language of the items in the data source.

Type

str

class google.shopping.merchant_datasources_v1.types.RegionalInventoryDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

feed_label

Required. Immutable. The feed label of the offers to which the regional inventory is provided.

Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-).

See also migration to feed labels.

Type

str

content_language

Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided.

Type

str

class google.shopping.merchant_datasources_v1.types.SupplementalProductDataSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The supplemental data source for local and online products. After creation, you should make sure to link the supplemental product data source into one or more primary product data sources.

feed_label

Optional. Immutable. The feed label that is specified on the data source level.

Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-).

See also migration to feed labels.

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][google.shopping.merchant.datasources.v1.FileInput]. The fields must be unset for data sources without [file input][google.shopping.merchant.datasources.v1.FileInput].

If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.

This field is a member of oneof _feed_label.

Type

str

content_language

Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source.

feedLabel and contentLanguage must be either both set or unset. The fields can only be unset for data sources without file input.

If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.

This field is a member of oneof _content_language.

Type

str

referencing_primary_data_sources

Output only. The (unordered and deduplicated) list of all primary data sources linked to this data source in either default or custom rules. Supplemental data source cannot be deleted before all links are removed.

Type

MutableSequence[google.shopping.merchant_datasources_v1.types.DataSourceReference]

class google.shopping.merchant_datasources_v1.types.UpdateDataSourceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for the UpdateDataSource method.

data_source

Required. The data source resource to update.

Type

google.shopping.merchant_datasources_v1.types.DataSource

update_mask

Required. The list of data source fields to be updated.

Fields specified in the update mask without a value specified in the body will be deleted from the data source.

Providing special “*” value for full data source replacement is not supported.

For example, If you insert updateMask=displayName in the request, it will only update the displayName leaving all other fields untouched.

Type

google.protobuf.field_mask_pb2.FieldMask