product_service.proto 42 KB

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