Reference documentation and code samples for the Google Cloud Retail V2 Client class GcsSource.
Google Cloud Storage location for input content.
Generated from protobuf message google.cloud.retail.v2.GcsSource
Namespace
Google \ Cloud \ Retail \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ input_uris
array
Required. Google Cloud Storage URIs to input files. URI can be up to 2000 characters long. URIs can match the full object path (for example, gs://bucket/directory/object.json) or a pattern matching one or more files, such as gs://bucket/directory/*.json. A request can contain at most 100 files, and each file can be up to 2 GB. See Importing product information for the expected file format and setup instructions.
↳ data_schema
string
The schema to use when parsing the data from the source. Supported values for product imports: * * product (default): One JSON Product per line. Each product must have a valid Product.id. * * product_merchant_center: See Importing catalog data from Merchant Center. Supported values for user events imports: * * user_event (default): One JSON UserEvent per line. * * user_event_ga360: Using https://support.google.com/analytics/answer/3437719. Supported values for control imports: * * control (default): One JSON Control per line. Supported values for catalog attribute imports: * * catalog_attribute (default): One CSV CatalogAttribute per line.
getInputUris
Required. Google Cloud Storage URIs to input files. URI can be up to
2000 characters long. URIs can match the full object path (for example,
gs://bucket/directory/object.json) or a pattern matching one or more
files, such as gs://bucket/directory/*.json. A request can
contain at most 100 files, and each file can be up to 2 GB. See
Importing product
information
for the expected file format and setup instructions.
Required. Google Cloud Storage URIs to input files. URI can be up to
2000 characters long. URIs can match the full object path (for example,
gs://bucket/directory/object.json) or a pattern matching one or more
files, such as gs://bucket/directory/*.json. A request can
contain at most 100 files, and each file can be up to 2 GB. See
Importing product
information
for the expected file format and setup instructions.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getDataSchema
The schema to use when parsing the data from the source.
Supported values for product imports:
product (default): One JSON Product
per line. Each product must
have a valid Product.id.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class GcsSource (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.GcsSource)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.GcsSource)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.GcsSource)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.GcsSource)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.GcsSource)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.GcsSource)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.GcsSource)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.GcsSource)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.GcsSource)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.GcsSource)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.GcsSource)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.GcsSource)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.GcsSource) \nReference documentation and code samples for the Google Cloud Retail V2 Client class GcsSource.\n\nGoogle Cloud Storage location for input content.\n\nGenerated from protobuf message `google.cloud.retail.v2.GcsSource`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getInputUris\n\nRequired. Google Cloud Storage URIs to input files. URI can be up to\n2000 characters long. URIs can match the full object path (for example,\n`gs://bucket/directory/object.json`) or a pattern matching one or more\nfiles, such as `gs://bucket/directory/*.json`. A request can\ncontain at most 100 files, and each file can be up to 2 GB. See\n[Importing product\ninformation](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)\nfor the expected file format and setup instructions.\n\n### setInputUris\n\nRequired. Google Cloud Storage URIs to input files. URI can be up to\n2000 characters long. URIs can match the full object path (for example,\n`gs://bucket/directory/object.json`) or a pattern matching one or more\nfiles, such as `gs://bucket/directory/*.json`. A request can\ncontain at most 100 files, and each file can be up to 2 GB. See\n[Importing product\ninformation](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog)\nfor the expected file format and setup instructions.\n\n### getDataSchema\n\nThe schema to use when parsing the data from the source.\n\nSupported values for product imports:\n\n- `product` (default): One JSON [Product](/php/docs/reference/cloud-retail/latest/V2.Product) per line. Each product must have a valid [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__).\n- `product_merchant_center`: See [Importing catalog data from Merchant\n Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). Supported values for user events imports:\n- `user_event` (default): One JSON [UserEvent](/php/docs/reference/cloud-retail/latest/V2.UserEvent) per line.\n- `user_event_ga360`: Using \u003chttps://support.google.com/analytics/answer/3437719\u003e. Supported values for control imports:\n- `control` (default): One JSON [Control](/php/docs/reference/cloud-retail/latest/V2.Control) per line. Supported values for catalog attribute imports:\n- `catalog_attribute` (default): One CSV [CatalogAttribute](/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) per line.\n\n### setDataSchema\n\nThe schema to use when parsing the data from the source.\n\nSupported values for product imports:\n\n- `product` (default): One JSON [Product](/php/docs/reference/cloud-retail/latest/V2.Product) per line. Each product must have a valid [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__).\n- `product_merchant_center`: See [Importing catalog data from Merchant\n Center](https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). Supported values for user events imports:\n- `user_event` (default): One JSON [UserEvent](/php/docs/reference/cloud-retail/latest/V2.UserEvent) per line.\n- `user_event_ga360`: Using \u003chttps://support.google.com/analytics/answer/3437719\u003e. Supported values for control imports:\n- `control` (default): One JSON [Control](/php/docs/reference/cloud-retail/latest/V2.Control) per line. Supported values for catalog attribute imports:\n- `catalog_attribute` (default): One CSV [CatalogAttribute](/php/docs/reference/cloud-retail/latest/V2.CatalogAttribute) per line."]]