product_service.proto 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.cloud.retail.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/retail/v2/common.proto";
  21. import "google/cloud/retail/v2/import_config.proto";
  22. import "google/cloud/retail/v2/product.proto";
  23. import "google/longrunning/operations.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. import "google/protobuf/timestamp.proto";
  27. option csharp_namespace = "Google.Cloud.Retail.V2";
  28. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2;retail";
  29. option java_multiple_files = true;
  30. option java_outer_classname = "ProductServiceProto";
  31. option java_package = "com.google.cloud.retail.v2";
  32. option objc_class_prefix = "RETAIL";
  33. option php_namespace = "Google\\Cloud\\Retail\\V2";
  34. option ruby_package = "Google::Cloud::Retail::V2";
  35. // Service for ingesting [Product][google.cloud.retail.v2.Product] information
  36. // of the customer's website.
  37. service ProductService {
  38. option (google.api.default_host) = "retail.googleapis.com";
  39. option (google.api.oauth_scopes) =
  40. "https://www.googleapis.com/auth/cloud-platform";
  41. // Creates a [Product][google.cloud.retail.v2.Product].
  42. rpc CreateProduct(CreateProductRequest) returns (Product) {
  43. option (google.api.http) = {
  44. post: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
  45. body: "product"
  46. };
  47. option (google.api.method_signature) = "parent,product,product_id";
  48. }
  49. // Gets a [Product][google.cloud.retail.v2.Product].
  50. rpc GetProduct(GetProductRequest) returns (Product) {
  51. option (google.api.http) = {
  52. get: "/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
  53. };
  54. option (google.api.method_signature) = "name";
  55. }
  56. // Gets a list of [Product][google.cloud.retail.v2.Product]s.
  57. rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
  58. option (google.api.http) = {
  59. get: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
  60. };
  61. option (google.api.method_signature) = "parent";
  62. }
  63. // Updates a [Product][google.cloud.retail.v2.Product].
  64. rpc UpdateProduct(UpdateProductRequest) returns (Product) {
  65. option (google.api.http) = {
  66. patch: "/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
  67. body: "product"
  68. };
  69. option (google.api.method_signature) = "product,update_mask";
  70. }
  71. // Deletes a [Product][google.cloud.retail.v2.Product].
  72. rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) {
  73. option (google.api.http) = {
  74. delete: "/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
  75. };
  76. option (google.api.method_signature) = "name";
  77. }
  78. // Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
  79. //
  80. // Request processing may be synchronous.
  81. // Non-existing items are created.
  82. //
  83. // Note that it is possible for a subset of the
  84. // [Product][google.cloud.retail.v2.Product]s to be successfully updated.
  85. rpc ImportProducts(ImportProductsRequest)
  86. returns (google.longrunning.Operation) {
  87. option (google.api.http) = {
  88. post: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import"
  89. body: "*"
  90. };
  91. option (google.longrunning.operation_info) = {
  92. response_type: "google.cloud.retail.v2.ImportProductsResponse"
  93. metadata_type: "google.cloud.retail.v2.ImportMetadata"
  94. };
  95. }
  96. // Updates inventory information for a
  97. // [Product][google.cloud.retail.v2.Product] while respecting the last update
  98. // timestamps of each inventory field.
  99. //
  100. // This process is asynchronous and does not require the
  101. // [Product][google.cloud.retail.v2.Product] to exist before updating
  102. // fulfillment information. If the request is valid, the update will be
  103. // enqueued and processed downstream. As a consequence, when a response is
  104. // returned, updates are not immediately manifested in the
  105. // [Product][google.cloud.retail.v2.Product] queried by
  106. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  107. // or
  108. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
  109. //
  110. // When inventory is updated with
  111. // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
  112. // and
  113. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct],
  114. // the specified inventory field value(s) will overwrite any existing value(s)
  115. // while ignoring the last update time for this field. Furthermore, the last
  116. // update time for the specified inventory fields will be overwritten to the
  117. // time of the
  118. // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
  119. // or
  120. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
  121. // request.
  122. //
  123. // If no inventory fields are set in
  124. // [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product],
  125. // then any pre-existing inventory information for this product will be used.
  126. //
  127. // If no inventory fields are set in
  128. // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask],
  129. // then any existing inventory information will be preserved.
  130. //
  131. // Pre-existing inventory information can only be updated with
  132. // [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory],
  133. // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces],
  134. // and
  135. // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].
  136. //
  137. // The returned [Operation][]s will be obsolete after 1 day, and
  138. // [GetOperation][] API will return NOT_FOUND afterwards.
  139. //
  140. // If conflicting updates are issued, the [Operation][]s associated with the
  141. // stale updates will not be marked as [done][Operation.done] until being
  142. // obsolete.
  143. //
  144. // This feature is only available for users who have Retail Search enabled.
  145. // Please enable Retail Search on Cloud Console before using this feature.
  146. rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) {
  147. option (google.api.http) = {
  148. post: "/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory"
  149. body: "*"
  150. };
  151. option (google.api.method_signature) = "inventory,set_mask";
  152. option (google.longrunning.operation_info) = {
  153. response_type: "google.cloud.retail.v2.SetInventoryResponse"
  154. metadata_type: "google.cloud.retail.v2.SetInventoryMetadata"
  155. };
  156. }
  157. // Incrementally adds place IDs to
  158. // [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
  159. //
  160. // This process is asynchronous and does not require the
  161. // [Product][google.cloud.retail.v2.Product] to exist before updating
  162. // fulfillment information. If the request is valid, the update will be
  163. // enqueued and processed downstream. As a consequence, when a response is
  164. // returned, the added place IDs are not immediately manifested in the
  165. // [Product][google.cloud.retail.v2.Product] queried by
  166. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  167. // or
  168. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
  169. //
  170. // The returned [Operation][]s will be obsolete after 1 day, and
  171. // [GetOperation][] API will return NOT_FOUND afterwards.
  172. //
  173. // If conflicting updates are issued, the [Operation][]s associated with the
  174. // stale updates will not be marked as [done][Operation.done] until being
  175. // obsolete.
  176. //
  177. // This feature is only available for users who have Retail Search enabled.
  178. // Please enable Retail Search on Cloud Console before using this feature.
  179. rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest)
  180. returns (google.longrunning.Operation) {
  181. option (google.api.http) = {
  182. post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces"
  183. body: "*"
  184. };
  185. option (google.api.method_signature) = "product";
  186. option (google.longrunning.operation_info) = {
  187. response_type: "google.cloud.retail.v2.AddFulfillmentPlacesResponse"
  188. metadata_type: "google.cloud.retail.v2.AddFulfillmentPlacesMetadata"
  189. };
  190. }
  191. // Incrementally removes place IDs from a
  192. // [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
  193. //
  194. // This process is asynchronous and does not require the
  195. // [Product][google.cloud.retail.v2.Product] to exist before updating
  196. // fulfillment information. If the request is valid, the update will be
  197. // enqueued and processed downstream. As a consequence, when a response is
  198. // returned, the removed place IDs are not immediately manifested in the
  199. // [Product][google.cloud.retail.v2.Product] queried by
  200. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  201. // or
  202. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
  203. //
  204. // The returned [Operation][]s will be obsolete after 1 day, and
  205. // [GetOperation][] API will return NOT_FOUND afterwards.
  206. //
  207. // If conflicting updates are issued, the [Operation][]s associated with the
  208. // stale updates will not be marked as [done][Operation.done] until being
  209. // obsolete.
  210. //
  211. // This feature is only available for users who have Retail Search enabled.
  212. // Please enable Retail Search on Cloud Console before using this feature.
  213. rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest)
  214. returns (google.longrunning.Operation) {
  215. option (google.api.http) = {
  216. post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces"
  217. body: "*"
  218. };
  219. option (google.api.method_signature) = "product";
  220. option (google.longrunning.operation_info) = {
  221. response_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesResponse"
  222. metadata_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata"
  223. };
  224. }
  225. // Updates local inventory information for a
  226. // [Product][google.cloud.retail.v2.Product] at a list of places, while
  227. // respecting the last update timestamps of each inventory field.
  228. //
  229. // This process is asynchronous and does not require the
  230. // [Product][google.cloud.retail.v2.Product] to exist before updating
  231. // inventory information. If the request is valid, the update will be enqueued
  232. // and processed downstream. As a consequence, when a response is returned,
  233. // updates are not immediately manifested in the
  234. // [Product][google.cloud.retail.v2.Product] queried by
  235. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  236. // or
  237. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
  238. //
  239. // Local inventory information can only be modified using this method.
  240. // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
  241. // and
  242. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
  243. // has no effect on local inventories.
  244. //
  245. // The returned [Operation][]s will be obsolete after 1 day, and
  246. // [GetOperation][] API will return NOT_FOUND afterwards.
  247. //
  248. // If conflicting updates are issued, the [Operation][]s associated with the
  249. // stale updates will not be marked as [done][Operation.done] until being
  250. // obsolete.
  251. //
  252. // This feature is only available for users who have Retail Search enabled.
  253. // Please enable Retail Search on Cloud Console before using this feature.
  254. rpc AddLocalInventories(AddLocalInventoriesRequest)
  255. returns (google.longrunning.Operation) {
  256. option (google.api.http) = {
  257. post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories"
  258. body: "*"
  259. };
  260. option (google.api.method_signature) = "product";
  261. option (google.longrunning.operation_info) = {
  262. response_type: "google.cloud.retail.v2.AddLocalInventoriesResponse"
  263. metadata_type: "google.cloud.retail.v2.AddLocalInventoriesMetadata"
  264. };
  265. }
  266. // Remove local inventory information for a
  267. // [Product][google.cloud.retail.v2.Product] at a list of places at a removal
  268. // timestamp.
  269. //
  270. // This process is asynchronous. If the request is valid, the removal will be
  271. // enqueued and processed downstream. As a consequence, when a response is
  272. // returned, removals are not immediately manifested in the
  273. // [Product][google.cloud.retail.v2.Product] queried by
  274. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  275. // or
  276. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
  277. //
  278. // Local inventory information can only be removed using this method.
  279. // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
  280. // and
  281. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
  282. // has no effect on local inventories.
  283. //
  284. // The returned [Operation][]s will be obsolete after 1 day, and
  285. // [GetOperation][] API will return NOT_FOUND afterwards.
  286. //
  287. // If conflicting updates are issued, the [Operation][]s associated with the
  288. // stale updates will not be marked as [done][Operation.done] until being
  289. // obsolete.
  290. //
  291. // This feature is only available for users who have Retail Search enabled.
  292. // Please enable Retail Search on Cloud Console before using this feature.
  293. rpc RemoveLocalInventories(RemoveLocalInventoriesRequest)
  294. returns (google.longrunning.Operation) {
  295. option (google.api.http) = {
  296. post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories"
  297. body: "*"
  298. };
  299. option (google.api.method_signature) = "product";
  300. option (google.longrunning.operation_info) = {
  301. response_type: "google.cloud.retail.v2.RemoveLocalInventoriesResponse"
  302. metadata_type: "google.cloud.retail.v2.RemoveLocalInventoriesMetadata"
  303. };
  304. }
  305. }
  306. // Request message for
  307. // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
  308. // method.
  309. message CreateProductRequest {
  310. // Required. The parent catalog resource name, such as
  311. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
  312. string parent = 1 [
  313. (google.api.field_behavior) = REQUIRED,
  314. (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
  315. ];
  316. // Required. The [Product][google.cloud.retail.v2.Product] to create.
  317. Product product = 2 [(google.api.field_behavior) = REQUIRED];
  318. // Required. The ID to use for the [Product][google.cloud.retail.v2.Product],
  319. // which will become the final component of the
  320. // [Product.name][google.cloud.retail.v2.Product.name].
  321. //
  322. // If the caller does not have permission to create the
  323. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  324. // exists, a PERMISSION_DENIED error is returned.
  325. //
  326. // This field must be unique among all
  327. // [Product][google.cloud.retail.v2.Product]s with the same
  328. // [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an
  329. // ALREADY_EXISTS error is returned.
  330. //
  331. // This field must be a UTF-8 encoded string with a length limit of 128
  332. // characters. Otherwise, an INVALID_ARGUMENT error is returned.
  333. string product_id = 3 [(google.api.field_behavior) = REQUIRED];
  334. }
  335. // Request message for
  336. // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
  337. // method.
  338. message GetProductRequest {
  339. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  340. // such as
  341. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  342. //
  343. // If the caller does not have permission to access the
  344. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  345. // exists, a PERMISSION_DENIED error is returned.
  346. //
  347. // If the requested [Product][google.cloud.retail.v2.Product] does not exist,
  348. // a NOT_FOUND error is returned.
  349. string name = 1 [
  350. (google.api.field_behavior) = REQUIRED,
  351. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  352. ];
  353. }
  354. // Request message for
  355. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
  356. // method.
  357. message UpdateProductRequest {
  358. // Required. The product to update/create.
  359. //
  360. // If the caller does not have permission to update the
  361. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  362. // exists, a PERMISSION_DENIED error is returned.
  363. //
  364. // If the [Product][google.cloud.retail.v2.Product] to update does not exist
  365. // and
  366. // [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing]
  367. // is not set, a NOT_FOUND error is returned.
  368. Product product = 1 [(google.api.field_behavior) = REQUIRED];
  369. // Indicates which fields in the provided
  370. // [Product][google.cloud.retail.v2.Product] to update. The immutable and
  371. // output only fields are NOT supported. If not set, all supported fields (the
  372. // fields that are neither immutable nor output only) are updated.
  373. //
  374. // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  375. // is returned.
  376. //
  377. // The attribute key can be updated by setting the mask path as
  378. // "attributes.${key_name}". If a key name is present in the mask but not in
  379. // the patching product from the request, this key will be deleted after the
  380. // update.
  381. google.protobuf.FieldMask update_mask = 2;
  382. // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
  383. // found, a new [Product][google.cloud.retail.v2.Product] will be created. In
  384. // this situation, `update_mask` is ignored.
  385. bool allow_missing = 3;
  386. }
  387. // Request message for
  388. // [ProductService.DeleteProduct][google.cloud.retail.v2.ProductService.DeleteProduct]
  389. // method.
  390. message DeleteProductRequest {
  391. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  392. // such as
  393. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  394. //
  395. // If the caller does not have permission to delete the
  396. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  397. // exists, a PERMISSION_DENIED error is returned.
  398. //
  399. // If the [Product][google.cloud.retail.v2.Product] to delete does not exist,
  400. // a NOT_FOUND error is returned.
  401. //
  402. // The [Product][google.cloud.retail.v2.Product] to delete can neither be a
  403. // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
  404. // [Product][google.cloud.retail.v2.Product] member nor a
  405. // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
  406. // [Product][google.cloud.retail.v2.Product] with more than one
  407. // [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an
  408. // INVALID_ARGUMENT error is returned.
  409. //
  410. // All inventory information for the named
  411. // [Product][google.cloud.retail.v2.Product] will be deleted.
  412. string name = 1 [
  413. (google.api.field_behavior) = REQUIRED,
  414. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  415. ];
  416. }
  417. // Request message for
  418. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
  419. // method.
  420. message ListProductsRequest {
  421. // Required. The parent branch resource name, such as
  422. // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
  423. // `default_branch` as the branch ID, to list products under the default
  424. // branch.
  425. //
  426. // If the caller does not have permission to list
  427. // [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
  428. // whether or not this branch exists, a PERMISSION_DENIED error is returned.
  429. string parent = 1 [
  430. (google.api.field_behavior) = REQUIRED,
  431. (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
  432. ];
  433. // Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
  434. // unspecified, defaults to 100. The maximum allowed value is 1000. Values
  435. // above 1000 will be coerced to 1000.
  436. //
  437. // If this field is negative, an INVALID_ARGUMENT error is returned.
  438. int32 page_size = 2;
  439. // A page token
  440. // [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
  441. // received from a previous
  442. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
  443. // call. Provide this to retrieve the subsequent page.
  444. //
  445. // When paginating, all other parameters provided to
  446. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
  447. // must match the call that provided the page token. Otherwise, an
  448. // INVALID_ARGUMENT error is returned.
  449. string page_token = 3;
  450. // A filter to apply on the list results. Supported features:
  451. //
  452. // * List all the products under the parent branch if
  453. // [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
  454. // * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
  455. // [Product][google.cloud.retail.v2.Product]s sharing the same
  456. // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
  457. // [Product][google.cloud.retail.v2.Product]. For example:
  458. // `primary_product_id = "some_product_id"`
  459. // * List [Product][google.cloud.retail.v2.Product]s bundled in a
  460. // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
  461. // [Product][google.cloud.retail.v2.Product].
  462. // For example:
  463. // `collection_product_id = "some_product_id"`
  464. // * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
  465. // For example:
  466. // `type = "PRIMARY"`
  467. // `type = "VARIANT"`
  468. // `type = "COLLECTION"`
  469. //
  470. // If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
  471. //
  472. // If the specified
  473. // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
  474. // [Product][google.cloud.retail.v2.Product] or
  475. // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
  476. // [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
  477. // is returned.
  478. string filter = 4;
  479. // The fields of [Product][google.cloud.retail.v2.Product] to return in the
  480. // responses. If not set or empty, the following fields are returned:
  481. //
  482. // * [Product.name][google.cloud.retail.v2.Product.name]
  483. // * [Product.id][google.cloud.retail.v2.Product.id]
  484. // * [Product.title][google.cloud.retail.v2.Product.title]
  485. // * [Product.uri][google.cloud.retail.v2.Product.uri]
  486. // * [Product.images][google.cloud.retail.v2.Product.images]
  487. // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
  488. // * [Product.brands][google.cloud.retail.v2.Product.brands]
  489. //
  490. // If "*" is provided, all fields are returned.
  491. // [Product.name][google.cloud.retail.v2.Product.name] is always returned no
  492. // matter what mask is set.
  493. //
  494. // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  495. // is returned.
  496. google.protobuf.FieldMask read_mask = 5;
  497. }
  498. // Response message for
  499. // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
  500. // method.
  501. message ListProductsResponse {
  502. // The [Product][google.cloud.retail.v2.Product]s.
  503. repeated Product products = 1;
  504. // A token that can be sent as
  505. // [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
  506. // to retrieve the next page. If this field is omitted, there are no
  507. // subsequent pages.
  508. string next_page_token = 2;
  509. }
  510. // Request message for
  511. // [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
  512. // method.
  513. message SetInventoryRequest {
  514. // Required. The inventory information to update. The allowable fields to
  515. // update are:
  516. //
  517. // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
  518. // * [Product.availability][google.cloud.retail.v2.Product.availability]
  519. // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  520. // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  521. // The updated inventory fields must be specified in
  522. // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
  523. //
  524. // If
  525. // [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name]
  526. // is empty or invalid, an INVALID_ARGUMENT error is returned.
  527. //
  528. // If the caller does not have permission to update the
  529. // [Product][google.cloud.retail.v2.Product] named in
  530. // [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
  531. // or not it exists, a PERMISSION_DENIED error is returned.
  532. //
  533. // If the [Product][google.cloud.retail.v2.Product] to update does not have
  534. // existing inventory information, the provided inventory information will be
  535. // inserted.
  536. //
  537. // If the [Product][google.cloud.retail.v2.Product] to update has existing
  538. // inventory information, the provided inventory information will be merged
  539. // while respecting the last update time for each inventory field, using the
  540. // provided or default value for
  541. // [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time].
  542. //
  543. // The caller can replace place IDs for a subset of fulfillment types in the
  544. // following ways:
  545. //
  546. // * Adds "fulfillment_info" in
  547. // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  548. // * Specifies only the desired fulfillment types and corresponding place IDs
  549. // to update in
  550. // [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  551. //
  552. // The caller can clear all place IDs from a subset of fulfillment types in
  553. // the following ways:
  554. //
  555. // * Adds "fulfillment_info" in
  556. // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  557. // * Specifies only the desired fulfillment types to clear in
  558. // [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  559. // * Checks that only the desired fulfillment info types have empty
  560. // [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
  561. //
  562. // The last update time is recorded for the following inventory fields:
  563. // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
  564. // * [Product.availability][google.cloud.retail.v2.Product.availability]
  565. // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  566. // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  567. //
  568. // If a full overwrite of inventory information while ignoring timestamps is
  569. // needed,
  570. // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
  571. // should be invoked instead.
  572. Product inventory = 1 [(google.api.field_behavior) = REQUIRED];
  573. // Indicates which inventory fields in the provided
  574. // [Product][google.cloud.retail.v2.Product] to update.
  575. //
  576. // At least one field must be provided.
  577. //
  578. // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  579. // is returned and the entire update will be ignored.
  580. google.protobuf.FieldMask set_mask = 2;
  581. // The time when the request is issued, used to prevent
  582. // out-of-order updates on inventory fields with the last update time
  583. // recorded. If not provided, the internal system time will be used.
  584. google.protobuf.Timestamp set_time = 3;
  585. // If set to true, and the [Product][google.cloud.retail.v2.Product] with name
  586. // [Product.name][google.cloud.retail.v2.Product.name] is not found, the
  587. // inventory update will still be processed and retained for at most 1 day
  588. // until the [Product][google.cloud.retail.v2.Product] is created. If set to
  589. // false, a NOT_FOUND error is returned if the
  590. // [Product][google.cloud.retail.v2.Product] is not found.
  591. bool allow_missing = 4;
  592. }
  593. // Metadata related to the progress of the SetInventory operation.
  594. // Currently empty because there is no meaningful metadata populated from the
  595. // [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
  596. // method.
  597. message SetInventoryMetadata {}
  598. // Response of the SetInventoryRequest. Currently empty because
  599. // there is no meaningful response populated from the
  600. // [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
  601. // method.
  602. message SetInventoryResponse {}
  603. // Request message for
  604. // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
  605. // method.
  606. message AddFulfillmentPlacesRequest {
  607. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  608. // such as
  609. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  610. //
  611. // If the caller does not have permission to access the
  612. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  613. // exists, a PERMISSION_DENIED error is returned.
  614. string product = 1 [
  615. (google.api.field_behavior) = REQUIRED,
  616. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  617. ];
  618. // Required. The fulfillment type, including commonly used types (such as
  619. // pickup in store and same day delivery), and custom types.
  620. //
  621. // Supported values:
  622. //
  623. // * "pickup-in-store"
  624. // * "ship-to-store"
  625. // * "same-day-delivery"
  626. // * "next-day-delivery"
  627. // * "custom-type-1"
  628. // * "custom-type-2"
  629. // * "custom-type-3"
  630. // * "custom-type-4"
  631. // * "custom-type-5"
  632. //
  633. // If this field is set to an invalid value other than these, an
  634. // INVALID_ARGUMENT error is returned.
  635. //
  636. // This field directly corresponds to
  637. // [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type].
  638. string type = 2 [(google.api.field_behavior) = REQUIRED];
  639. // Required. The IDs for this
  640. // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
  641. // the store IDs for "pickup-in-store" or the region IDs for
  642. // "same-day-delivery" to be added for this
  643. // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
  644. // IDs will be automatically ignored.
  645. //
  646. // At least 1 value is required, and a maximum of 2000 values are allowed.
  647. // Each value must be a string with a length limit of 10 characters, matching
  648. // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
  649. // INVALID_ARGUMENT error is returned.
  650. //
  651. // If the total number of place IDs exceeds 2000 for this
  652. // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
  653. // adding, then the update will be rejected.
  654. repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
  655. // The time when the fulfillment updates are issued, used to prevent
  656. // out-of-order updates on fulfillment information. If not provided, the
  657. // internal system time will be used.
  658. google.protobuf.Timestamp add_time = 4;
  659. // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
  660. // found, the fulfillment information will still be processed and retained for
  661. // at most 1 day and processed once the
  662. // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
  663. // NOT_FOUND error is returned if the
  664. // [Product][google.cloud.retail.v2.Product] is not found.
  665. bool allow_missing = 5;
  666. }
  667. // Metadata related to the progress of the AddFulfillmentPlaces operation.
  668. // Currently empty because there is no meaningful metadata populated from the
  669. // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
  670. // method.
  671. message AddFulfillmentPlacesMetadata {}
  672. // Response of the AddFulfillmentPlacesRequest. Currently empty because
  673. // there is no meaningful response populated from the
  674. // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
  675. // method.
  676. message AddFulfillmentPlacesResponse {}
  677. // Request message for
  678. // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
  679. // method.
  680. message AddLocalInventoriesRequest {
  681. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  682. // such as
  683. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  684. //
  685. // If the caller does not have permission to access the
  686. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  687. // exists, a PERMISSION_DENIED error is returned.
  688. string product = 1 [
  689. (google.api.field_behavior) = REQUIRED,
  690. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  691. ];
  692. // Required. A list of inventory information at difference places. Each place
  693. // is identified by its place ID. At most 3000 inventories are allowed per
  694. // request.
  695. repeated LocalInventory local_inventories = 2
  696. [(google.api.field_behavior) = REQUIRED];
  697. // Indicates which inventory fields in the provided list of
  698. // [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The
  699. // field is updated to the provided value.
  700. //
  701. // If a field is set while the place does not have a previous local inventory,
  702. // the local inventory at that store is created.
  703. //
  704. // If a field is set while the value of that field is not provided, the
  705. // original field value, if it exists, is deleted.
  706. //
  707. // If the mask is not set or set with empty paths, all inventory fields will
  708. // be updated.
  709. //
  710. // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
  711. // is returned and the entire update will be ignored.
  712. google.protobuf.FieldMask add_mask = 4;
  713. // The time when the inventory updates are issued. Used to prevent
  714. // out-of-order updates on local inventory fields. If not provided, the
  715. // internal system time will be used.
  716. google.protobuf.Timestamp add_time = 5;
  717. // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
  718. // found, the local inventory will still be processed and retained for at most
  719. // 1 day and processed once the [Product][google.cloud.retail.v2.Product] is
  720. // created. If set to false, a NOT_FOUND error is returned if the
  721. // [Product][google.cloud.retail.v2.Product] is not found.
  722. bool allow_missing = 6;
  723. }
  724. // Metadata related to the progress of the AddLocalInventories operation.
  725. // Currently empty because there is no meaningful metadata populated from the
  726. // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
  727. // method.
  728. message AddLocalInventoriesMetadata {}
  729. // Response of the
  730. // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
  731. // API. Currently empty because there is no meaningful response populated from
  732. // the
  733. // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
  734. // method.
  735. message AddLocalInventoriesResponse {}
  736. // Request message for
  737. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
  738. // method.
  739. message RemoveLocalInventoriesRequest {
  740. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  741. // such as
  742. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  743. //
  744. // If the caller does not have permission to access the
  745. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  746. // exists, a PERMISSION_DENIED error is returned.
  747. string product = 1 [
  748. (google.api.field_behavior) = REQUIRED,
  749. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  750. ];
  751. // Required. A list of place IDs to have their inventory deleted.
  752. // At most 3000 place IDs are allowed per request.
  753. repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED];
  754. // The time when the inventory deletions are issued. Used to prevent
  755. // out-of-order updates and deletions on local inventory fields. If not
  756. // provided, the internal system time will be used.
  757. google.protobuf.Timestamp remove_time = 5;
  758. // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
  759. // found, the local inventory removal request will still be processed and
  760. // retained for at most 1 day and processed once the
  761. // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
  762. // NOT_FOUND error is returned if the
  763. // [Product][google.cloud.retail.v2.Product] is not found.
  764. bool allow_missing = 3;
  765. }
  766. // Metadata related to the progress of the RemoveLocalInventories operation.
  767. // Currently empty because there is no meaningful metadata populated from the
  768. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
  769. // method.
  770. message RemoveLocalInventoriesMetadata {}
  771. // Response of the
  772. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
  773. // API. Currently empty because there is no meaningful response populated from
  774. // the
  775. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
  776. // method.
  777. message RemoveLocalInventoriesResponse {}
  778. // Request message for
  779. // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
  780. // method.
  781. message RemoveFulfillmentPlacesRequest {
  782. // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
  783. // such as
  784. // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
  785. //
  786. // If the caller does not have permission to access the
  787. // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
  788. // exists, a PERMISSION_DENIED error is returned.
  789. string product = 1 [
  790. (google.api.field_behavior) = REQUIRED,
  791. (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
  792. ];
  793. // Required. The fulfillment type, including commonly used types (such as
  794. // pickup in store and same day delivery), and custom types.
  795. //
  796. // Supported values:
  797. //
  798. // * "pickup-in-store"
  799. // * "ship-to-store"
  800. // * "same-day-delivery"
  801. // * "next-day-delivery"
  802. // * "custom-type-1"
  803. // * "custom-type-2"
  804. // * "custom-type-3"
  805. // * "custom-type-4"
  806. // * "custom-type-5"
  807. //
  808. // If this field is set to an invalid value other than these, an
  809. // INVALID_ARGUMENT error is returned.
  810. //
  811. // This field directly corresponds to
  812. // [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type].
  813. string type = 2 [(google.api.field_behavior) = REQUIRED];
  814. // Required. The IDs for this
  815. // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
  816. // the store IDs for "pickup-in-store" or the region IDs for
  817. // "same-day-delivery", to be removed for this
  818. // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
  819. //
  820. // At least 1 value is required, and a maximum of 2000 values are allowed.
  821. // Each value must be a string with a length limit of 10 characters, matching
  822. // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
  823. // INVALID_ARGUMENT error is returned.
  824. repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
  825. // The time when the fulfillment updates are issued, used to prevent
  826. // out-of-order updates on fulfillment information. If not provided, the
  827. // internal system time will be used.
  828. google.protobuf.Timestamp remove_time = 4;
  829. // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
  830. // found, the fulfillment information will still be processed and retained for
  831. // at most 1 day and processed once the
  832. // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
  833. // NOT_FOUND error is returned if the
  834. // [Product][google.cloud.retail.v2.Product] is not found.
  835. bool allow_missing = 5;
  836. }
  837. // Metadata related to the progress of the RemoveFulfillmentPlaces operation.
  838. // Currently empty because there is no meaningful metadata populated from the
  839. // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
  840. // method.
  841. message RemoveFulfillmentPlacesMetadata {}
  842. // Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
  843. // is no meaningful response populated from the
  844. // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
  845. // method.
  846. message RemoveFulfillmentPlacesResponse {}