import.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/recommendationengine/v1beta1/catalog.proto";
  19. import "google/cloud/recommendationengine/v1beta1/user_event.proto";
  20. import "google/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto";
  21. import "google/protobuf/timestamp.proto";
  22. import "google/rpc/status.proto";
  23. import "google/api/annotations.proto";
  24. option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengine";
  26. option java_multiple_files = true;
  27. option java_package = "com.google.cloud.recommendationengine.v1beta1";
  28. option objc_class_prefix = "RECAI";
  29. option php_namespace = "Google\\Cloud\\RecommendationEngine\\V1beta1";
  30. option ruby_package = "Google::Cloud::RecommendationEngine::V1beta1";
  31. // Google Cloud Storage location for input content.
  32. // format.
  33. message GcsSource {
  34. // Required. Google Cloud Storage URIs to input files. URI can be up to
  35. // 2000 characters long. URIs can match the full object path (for example,
  36. // `gs://bucket/directory/object.json`) or a pattern matching one or more
  37. // files, such as `gs://bucket/directory/*.json`. A request can
  38. // contain at most 100 files, and each file can be up to 2 GB. See
  39. // [Importing catalog information](/recommendations-ai/docs/upload-catalog)
  40. // for the expected file format and setup instructions.
  41. repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED];
  42. }
  43. // The inline source for the input config for ImportCatalogItems method.
  44. message CatalogInlineSource {
  45. // Optional. A list of catalog items to update/create. Recommended max of 10k
  46. // items.
  47. repeated CatalogItem catalog_items = 1
  48. [(google.api.field_behavior) = OPTIONAL];
  49. }
  50. // The inline source for the input config for ImportUserEvents method.
  51. message UserEventInlineSource {
  52. // Optional. A list of user events to import. Recommended max of 10k items.
  53. repeated UserEvent user_events = 1 [(google.api.field_behavior) = OPTIONAL];
  54. }
  55. // Configuration of destination for Import related errors.
  56. message ImportErrorsConfig {
  57. // Required. Errors destination.
  58. oneof destination {
  59. // Google Cloud Storage path for import errors. This must be an empty,
  60. // existing Cloud Storage bucket. Import errors will be written to a file in
  61. // this bucket, one per line, as a JSON-encoded
  62. // `google.rpc.Status` message.
  63. string gcs_prefix = 1;
  64. }
  65. }
  66. // Request message for Import methods.
  67. message ImportCatalogItemsRequest {
  68. // Required. `projects/1234/locations/global/catalogs/default_catalog`
  69. string parent = 1 [
  70. (google.api.field_behavior) = REQUIRED,
  71. (google.api.resource_reference) = {
  72. type: "recommendationengine.googleapis.com/Catalog"
  73. }
  74. ];
  75. // Optional. Unique identifier provided by client, within the ancestor
  76. // dataset scope. Ensures idempotency and used for request deduplication.
  77. // Server-generated if unspecified. Up to 128 characters long. This is
  78. // returned as google.longrunning.Operation.name in the response.
  79. string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
  80. // Required. The desired input location of the data.
  81. InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED];
  82. // Optional. The desired location of errors incurred during the Import.
  83. ImportErrorsConfig errors_config = 4 [(google.api.field_behavior) = OPTIONAL];
  84. }
  85. // Request message for the ImportUserEvents request.
  86. message ImportUserEventsRequest {
  87. // Required.
  88. // `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`
  89. string parent = 1 [
  90. (google.api.field_behavior) = REQUIRED,
  91. (google.api.resource_reference) = {
  92. type: "recommendationengine.googleapis.com/EventStore"
  93. }
  94. ];
  95. // Optional. Unique identifier provided by client, within the ancestor
  96. // dataset scope. Ensures idempotency for expensive long running operations.
  97. // Server-generated if unspecified. Up to 128 characters long. This is
  98. // returned as google.longrunning.Operation.name in the response. Note that
  99. // this field must not be set if the desired input config is
  100. // catalog_inline_source.
  101. string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
  102. // Required. The desired input location of the data.
  103. InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED];
  104. // Optional. The desired location of errors incurred during the Import.
  105. ImportErrorsConfig errors_config = 4 [(google.api.field_behavior) = OPTIONAL];
  106. }
  107. // The input config source.
  108. message InputConfig {
  109. // Required. The source of the input.
  110. oneof source {
  111. // The Inline source for the input content for Catalog items.
  112. CatalogInlineSource catalog_inline_source = 1;
  113. // Google Cloud Storage location for the input content.
  114. GcsSource gcs_source = 2;
  115. // The Inline source for the input content for UserEvents.
  116. UserEventInlineSource user_event_inline_source = 3;
  117. }
  118. }
  119. // Metadata related to the progress of the Import operation. This will be
  120. // returned by the google.longrunning.Operation.metadata field.
  121. message ImportMetadata {
  122. // Name of the operation.
  123. string operation_name = 5;
  124. // Id of the request / operation. This is parroting back the requestId that
  125. // was passed in the request.
  126. string request_id = 3;
  127. // Operation create time.
  128. google.protobuf.Timestamp create_time = 4;
  129. // Count of entries that were processed successfully.
  130. int64 success_count = 1;
  131. // Count of entries that encountered errors while processing.
  132. int64 failure_count = 2;
  133. // Operation last update time. If the operation is done, this is also the
  134. // finish time.
  135. google.protobuf.Timestamp update_time = 6;
  136. }
  137. // Response of the ImportCatalogItemsRequest. If the long running
  138. // operation is done, then this message is returned by the
  139. // google.longrunning.Operations.response field if the operation was successful.
  140. message ImportCatalogItemsResponse {
  141. // A sample of errors encountered while processing the request.
  142. repeated google.rpc.Status error_samples = 1;
  143. // Echoes the destination for the complete errors in the request if set.
  144. ImportErrorsConfig errors_config = 2;
  145. }
  146. // Response of the ImportUserEventsRequest. If the long running
  147. // operation was successful, then this message is returned by the
  148. // google.longrunning.Operations.response field if the operation was successful.
  149. message ImportUserEventsResponse {
  150. // A sample of errors encountered while processing the request.
  151. repeated google.rpc.Status error_samples = 1;
  152. // Echoes the destination for the complete errors if this field was set in
  153. // the request.
  154. ImportErrorsConfig errors_config = 2;
  155. // Aggregated statistics of user event import status.
  156. UserEventImportSummary import_summary = 3;
  157. }
  158. // A summary of import result. The UserEventImportSummary summarizes
  159. // the import status for user events.
  160. message UserEventImportSummary {
  161. // Count of user events imported with complete existing catalog information.
  162. int64 joined_events_count = 1;
  163. // Count of user events imported, but with catalog information not found
  164. // in the imported catalog.
  165. int64 unjoined_events_count = 2;
  166. }