catalog_service.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. // Copyright 2020 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.recommendationengine.v1beta1;
  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/recommendationengine/v1beta1/catalog.proto";
  21. import "google/cloud/recommendationengine/v1beta1/import.proto";
  22. import "google/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto";
  23. import "google/longrunning/operations.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine";
  28. option java_multiple_files = true;
  29. option java_package = "com.google.cloud.recommendationengine.v1beta1";
  30. option objc_class_prefix = "RECAI";
  31. option php_namespace = "Google\\Cloud\\RecommendationEngine\\V1beta1";
  32. option ruby_package = "Google::Cloud::RecommendationEngine::V1beta1";
  33. // Service for ingesting catalog information of the customer's website.
  34. service CatalogService {
  35. option (google.api.default_host) = "recommendationengine.googleapis.com";
  36. option (google.api.oauth_scopes) =
  37. "https://www.googleapis.com/auth/cloud-platform";
  38. // Creates a catalog item.
  39. rpc CreateCatalogItem(CreateCatalogItemRequest) returns (CatalogItem) {
  40. option (google.api.http) = {
  41. post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems"
  42. body: "catalog_item"
  43. };
  44. option (google.api.method_signature) = "parent,catalog_item";
  45. }
  46. // Gets a specific catalog item.
  47. rpc GetCatalogItem(GetCatalogItemRequest) returns (CatalogItem) {
  48. option (google.api.http) = {
  49. get: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}"
  50. };
  51. option (google.api.method_signature) = "name";
  52. }
  53. // Gets a list of catalog items.
  54. rpc ListCatalogItems(ListCatalogItemsRequest)
  55. returns (ListCatalogItemsResponse) {
  56. option (google.api.http) = {
  57. get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems"
  58. };
  59. option (google.api.method_signature) = "parent,filter";
  60. }
  61. // Updates a catalog item. Partial updating is supported. Non-existing
  62. // items will be created.
  63. rpc UpdateCatalogItem(UpdateCatalogItemRequest) returns (CatalogItem) {
  64. option (google.api.http) = {
  65. patch: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}"
  66. body: "catalog_item"
  67. };
  68. option (google.api.method_signature) = "name,catalog_item,update_mask";
  69. }
  70. // Deletes a catalog item.
  71. rpc DeleteCatalogItem(DeleteCatalogItemRequest)
  72. returns (google.protobuf.Empty) {
  73. option (google.api.http) = {
  74. delete: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}"
  75. };
  76. option (google.api.method_signature) = "name";
  77. }
  78. // Bulk import of multiple catalog items. Request processing may be
  79. // synchronous. No partial updating supported. Non-existing items will be
  80. // created.
  81. //
  82. // Operation.response is of type ImportResponse. Note that it is
  83. // possible for a subset of the items to be successfully updated.
  84. rpc ImportCatalogItems(ImportCatalogItemsRequest)
  85. returns (google.longrunning.Operation) {
  86. option (google.api.http) = {
  87. post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import"
  88. body: "*"
  89. };
  90. option (google.longrunning.operation_info) = {
  91. response_type: "google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse"
  92. metadata_type: "google.cloud.recommendationengine.v1beta1.ImportMetadata"
  93. };
  94. option (google.api.method_signature) =
  95. "parent,request_id,input_config,errors_config";
  96. }
  97. }
  98. // Request message for CreateCatalogItem method.
  99. message CreateCatalogItemRequest {
  100. // Required. The parent catalog resource name, such as
  101. // `projects/*/locations/global/catalogs/default_catalog`.
  102. string parent = 1 [
  103. (google.api.field_behavior) = REQUIRED,
  104. (google.api.resource_reference) = {
  105. type: "recommendationengine.googleapis.com/Catalog"
  106. }
  107. ];
  108. // Required. The catalog item to create.
  109. CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED];
  110. }
  111. // Request message for GetCatalogItem method.
  112. message GetCatalogItemRequest {
  113. // Required. Full resource name of catalog item, such as
  114. // `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`.
  115. string name = 1 [
  116. (google.api.field_behavior) = REQUIRED,
  117. (google.api.resource_reference) = {
  118. type: "recommendationengine.googleapis.com/CatalogItemPath"
  119. }
  120. ];
  121. }
  122. // Request message for ListCatalogItems method.
  123. message ListCatalogItemsRequest {
  124. // Required. The parent catalog resource name, such as
  125. // `projects/*/locations/global/catalogs/default_catalog`.
  126. string parent = 1 [
  127. (google.api.field_behavior) = REQUIRED,
  128. (google.api.resource_reference) = {
  129. type: "recommendationengine.googleapis.com/Catalog"
  130. }
  131. ];
  132. // Optional. Maximum number of results to return per page. If zero, the
  133. // service will choose a reasonable default.
  134. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  135. // Optional. The previous ListCatalogItemsResponse.next_page_token.
  136. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  137. // Optional. A filter to apply on the list results.
  138. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  139. }
  140. // Response message for ListCatalogItems method.
  141. message ListCatalogItemsResponse {
  142. // The catalog items.
  143. repeated CatalogItem catalog_items = 1;
  144. // If empty, the list is complete. If nonempty, the token to pass to the next
  145. // request's ListCatalogItemRequest.page_token.
  146. string next_page_token = 2;
  147. }
  148. // Request message for UpdateCatalogItem method.
  149. message UpdateCatalogItemRequest {
  150. // Required. Full resource name of catalog item, such as
  151. // `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
  152. string name = 1 [
  153. (google.api.field_behavior) = REQUIRED,
  154. (google.api.resource_reference) = {
  155. type: "recommendationengine.googleapis.com/CatalogItemPath"
  156. }
  157. ];
  158. // Required. The catalog item to update/create. The 'catalog_item_id' field
  159. // has to match that in the 'name'.
  160. CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED];
  161. // Optional. Indicates which fields in the provided 'item' to update. If not
  162. // set, will by default update all fields.
  163. google.protobuf.FieldMask update_mask = 3;
  164. }
  165. // Request message for DeleteCatalogItem method.
  166. message DeleteCatalogItemRequest {
  167. // Required. Full resource name of catalog item, such as
  168. // `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`.
  169. string name = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "recommendationengine.googleapis.com/CatalogItemPath"
  173. }
  174. ];
  175. }