• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.shopping.css.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/protobuf/empty.proto";
24import "google/protobuf/timestamp.proto";
25import "google/shopping/css/v1/css_product_common.proto";
26import "google/shopping/type/types.proto";
27
28option csharp_namespace = "Google.Shopping.Css.V1";
29option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb";
30option java_multiple_files = true;
31option java_outer_classname = "CssProductInputsProto";
32option java_package = "com.google.shopping.css.v1";
33option php_namespace = "Google\\Shopping\\Css\\V1";
34option ruby_package = "Google::Shopping::Css::V1";
35
36// Service to use CssProductInput resource.
37// This service helps to insert/update/delete CSS Products.
38service CssProductInputsService {
39  option (google.api.default_host) = "css.googleapis.com";
40  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
41
42  // Uploads a CssProductInput to your CSS Center account. If an
43  // input with the same contentLanguage, identity, feedLabel and feedId already
44  // exists, this method replaces that entry.
45  //
46  // After inserting, updating, or deleting a CSS Product input, it may
47  // take several minutes before the processed CSS Product can be retrieved.
48  rpc InsertCssProductInput(InsertCssProductInputRequest)
49      returns (CssProductInput) {
50    option (google.api.http) = {
51      post: "/v1/{parent=accounts/*}/cssProductInputs:insert"
52      body: "css_product_input"
53    };
54  }
55
56  // Deletes a CSS Product input from your CSS Center account.
57  //
58  // After a delete it may take several minutes until the input is no longer
59  // available.
60  rpc DeleteCssProductInput(DeleteCssProductInputRequest)
61      returns (google.protobuf.Empty) {
62    option (google.api.http) = {
63      delete: "/v1/{name=accounts/*/cssProductInputs/*}"
64    };
65    option (google.api.method_signature) = "name";
66  }
67}
68
69// This resource represents input data you submit for a CSS Product, not
70// the processed CSS Product that you see in CSS Center, in Shopping Ads, or
71// across Google surfaces.
72message CssProductInput {
73  option (google.api.resource) = {
74    type: "css.googleapis.com/CssProductInput"
75    pattern: "accounts/{account}/cssProductInputs/{css_product_input}"
76  };
77
78  // The name of the CSS Product input.
79  // Format:
80  // `accounts/{account}/cssProductInputs/{css_product_input}`
81  string name = 1;
82
83  // Output only. The name of the processed CSS Product.
84  // Format:
85  // `accounts/{account}/cssProducts/{css_product}`
86  // "
87  string final_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
88
89  // Required. Your unique identifier for the CSS Product. This is the same for
90  // the CSS Product input and processed CSS Product. We only allow ids with
91  // alphanumerics, underscores and dashes. See the [products feed
92  // specification](https://support.google.com/merchants/answer/188494#id) for
93  // details.
94  string raw_provided_id = 3 [(google.api.field_behavior) = REQUIRED];
95
96  // Required. The two-letter [ISO
97  // 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
98  // Product.
99  string content_language = 4 [(google.api.field_behavior) = REQUIRED];
100
101  // Required. The [feed
102  // label](https://developers.google.com/shopping-content/guides/products/feed-labels)
103  // for the CSS Product.
104  // Feed Label is synonymous to "target country" and hence should always be a
105  // valid region code. For example: 'DE' for Germany, 'FR' for France.
106  string feed_label = 5 [(google.api.field_behavior) = REQUIRED];
107
108  // Represents the existing version (freshness) of the CSS Product, which
109  // can be used to preserve the right order when multiple updates are done at
110  // the same time.
111  //
112  // This field must not be set to the future time.
113  //
114  // If set, the update is prevented if a newer version of the item already
115  // exists in our system (that is the last update time of the existing
116  // CSS products is later than the freshness time set in the update). If
117  // the update happens, the last update time is then set to this freshness
118  // time.
119  //
120  // If not set, the update will not be prevented and the last update time will
121  // default to when this request was received by the CSS API.
122  //
123  // If the operation is prevented, the aborted exception will be
124  // thrown.
125  google.protobuf.Timestamp freshness_time = 6;
126
127  // A list of CSS Product attributes.
128  Attributes attributes = 7;
129
130  // A list of custom (CSS-provided) attributes. It can also be used for
131  // submitting any attribute of the feed specification in its generic
132  // form (for example:
133  // `{ "name": "size type", "value": "regular" }`).
134  // This is useful for submitting attributes not explicitly exposed by the
135  // API, such as additional attributes used for Buy on Google.
136  repeated google.shopping.type.CustomAttribute custom_attributes = 8;
137}
138
139// Request message for the InsertCssProductInput method.
140message InsertCssProductInputRequest {
141  // Required. The account where this CSS Product will be inserted.
142  // Format: accounts/{account}
143  string parent = 1 [
144    (google.api.field_behavior) = REQUIRED,
145    (google.api.resource_reference) = {
146      child_type: "css.googleapis.com/CssProductInput"
147    }
148  ];
149
150  // Required. The CSS Product Input to insert.
151  CssProductInput css_product_input = 2
152      [(google.api.field_behavior) = REQUIRED];
153
154  // Required. The primary or supplemental feed id. If CSS Product already
155  // exists and feed id provided is different, then the CSS Product will be
156  // moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
157  // we create feeds on the fly. We do not have supplemental feed support for
158  // CSS Products yet.
159  int64 feed_id = 3 [(google.api.field_behavior) = REQUIRED];
160}
161
162// Request message for the DeleteCssProductInput method.
163message DeleteCssProductInputRequest {
164  // Required. The name of the CSS product input resource to delete.
165  // Format: accounts/{account}/cssProductInputs/{css_product_input}
166  string name = 1 [
167    (google.api.field_behavior) = REQUIRED,
168    (google.api.resource_reference) = {
169      type: "css.googleapis.com/CssProductInput"
170    }
171  ];
172
173  // The Content API Supplemental Feed ID.
174  // The field must not be set if the action applies to a primary feed.
175  // If the field is set, then product action applies to a supplemental feed
176  // instead of primary Content API feed.
177  optional int64 supplemental_feed_id = 2;
178}
179