import.proto 7.7 KB

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