Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/google-shopping-merchant-datasources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].
1. [Enable the Merchant API API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
1. [Set up authentication][auth] so you can access the
API from your local workstation.

### Installing the client library
Expand Down Expand Up @@ -121,6 +121,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Data_sources_service.get_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.get_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.get_data_source.js,packages/google-shopping-merchant-datasources/samples/README.md) |
| Data_sources_service.list_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.list_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.list_data_sources.js,packages/google-shopping-merchant-datasources/samples/README.md) |
| Data_sources_service.update_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.update_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-datasources/samples/generated/v1beta/data_sources_service.update_data_source.js,packages/google-shopping-merchant-datasources/samples/README.md) |
| File_uploads_service.get_file_upload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-datasources/samples/generated/v1beta/file_uploads_service.get_file_upload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-datasources/samples/generated/v1beta/file_uploads_service.get_file_upload.js,packages/google-shopping-merchant-datasources/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-merchant-datasources/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-merchant-datasources/samples/quickstart.js,packages/google-shopping-merchant-datasources/samples/README.md) |


Expand Down Expand Up @@ -190,4 +191,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=merchantapi.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ option ruby_package = "Google::Shopping::Merchant::DataSources::V1beta";

// The primary data source for local and online products.
message PrimaryProductDataSource {
// Default rule management of the data source.
message DefaultRule {
// Required. The list of data sources linked in the [default
// rule](https://support.google.com/merchants/answer/7450276).
// 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`.
repeated DataSourceReference take_from_data_sources = 1
[(google.api.field_behavior) = REQUIRED];
}

// Data Source Channel.
//
// Channel is used to distinguish between data sources for different product
Expand All @@ -43,6 +69,8 @@ message PrimaryProductDataSource {
LOCAL_PRODUCTS = 2;

// Unified data source for both local and online products.
// Note: Products management through the API is not possible for this
// channel.
PRODUCTS = 3;
}

Expand Down Expand Up @@ -91,6 +119,10 @@ message PrimaryProductDataSource {
// [CLDR territory
// code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
repeated string countries = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. Default rule management of the data source. If set, the linked
// data sources will be replaced.
DefaultRule default_rule = 7 [(google.api.field_behavior) = OPTIONAL];
}

// The supplemental data source for local and online products.
Expand Down Expand Up @@ -129,6 +161,12 @@ message SupplementalProductDataSource {
(google.api.field_behavior) = OPTIONAL,
(google.api.field_behavior) = IMMUTABLE
];

// 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.
repeated DataSourceReference referencing_primary_data_sources = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The local inventory data source.
Expand Down Expand Up @@ -197,3 +235,24 @@ message PromotionDataSource {
(google.api.field_behavior) = IMMUTABLE
];
}

// Data source reference can be used to manage related data sources within the
// data source service.
message DataSourceReference {
oneof data_source_id {
// Self should be used to reference the primary data source itself.
bool self = 1;

// Optional. The name of the primary data source.
// Format:
// `accounts/{account}/dataSources/{datasource}`
string primary_data_source_name = 3
[(google.api.field_behavior) = OPTIONAL];

// Optional. The name of the supplemental data source.
// Format:
// `accounts/{account}/dataSources/{datasource}`
string supplemental_data_source_name = 2
[(google.api.field_behavior) = OPTIONAL];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.shopping.merchant.datasources.v1beta;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1Beta";
option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1beta/datasourcespb;datasourcespb";
option java_multiple_files = true;
option java_outer_classname = "FileUploadsProto";
option java_package = "com.google.shopping.merchant.datasources.v1beta";
option php_namespace = "Google\\Shopping\\Merchant\\DataSources\\V1beta";
option ruby_package = "Google::Shopping::Merchant::DataSources::V1beta";

// Service to manage data source file uploads.
service FileUploadsService {
option (google.api.default_host) = "merchantapi.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";

// Gets the latest data source file upload. Only the `latest` alias is
// accepted for a file upload.
rpc GetFileUpload(GetFileUploadRequest) returns (FileUpload) {
option (google.api.http) = {
get: "/datasources/v1beta/{name=accounts/*/dataSources/*/fileUploads/*}"
};
option (google.api.method_signature) = "name";
}
}

// 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.
message FileUpload {
option (google.api.resource) = {
type: "merchantapi.googleapis.com/FileUpload"
pattern: "accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}"
plural: "fileUploads"
singular: "fileUpload"
};

// An error occurring in the data source, like "invalid price".
message Issue {
// The severity of the issue.
enum Severity {
// Severity unspecified.
SEVERITY_UNSPECIFIED = 0;

// The issue is the warning.
WARNING = 1;

// The issue is an error.
ERROR = 2;
}

// Output only. The title of the issue, for example, "Item too big".
string title = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// 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".
string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The code of the error, for example,
// "validation/invalid_value". Returns
// "?" if the code is unknown.
string code = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of occurrences of the error in the file upload.
int64 count = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The severity of the issue.
Severity severity = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Link to the documentation explaining the issue in more
// details, if available.
string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The processing state of the data source.
enum ProcessingState {
// Processing state unspecified.
PROCESSING_STATE_UNSPECIFIED = 0;

// The data source could not be processed or all the items had errors.
FAILED = 1;

// The data source is being processed.
IN_PROGRESS = 2;

// The data source was processed successfully, though some items might have
// had errors.
SUCCEEDED = 3;
}

// Identifier. The name of the data source file upload.
// Format:
// `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// Output only. The data source id.
int64 data_source_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The processing state of the data source.
ProcessingState processing_state = 3
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The list of issues occurring in the data source.
repeated Issue issues = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of items in the data source that were processed.
int64 items_total = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of items in the data source that were created.
int64 items_created = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of items in the data source that were updated.
int64 items_updated = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The date at which the file of the data source was uploaded.
google.protobuf.Timestamp upload_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for the GetFileUploadRequest method.
message GetFileUploadRequest {
// Required. The name of the data source file upload to retrieve.
// Format:
// `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "merchantapi.googleapis.com/FileUpload"
}
];
}
Loading