user_event_service.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Copyright 2022 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.discoveryengine.v1beta;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/httpbody.proto";
  20. import "google/api/resource.proto";
  21. import "google/cloud/discoveryengine/v1beta/import_config.proto";
  22. import "google/cloud/discoveryengine/v1beta/user_event.proto";
  23. import "google/longrunning/operations.proto";
  24. option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/discoveryengine/v1beta;discoveryengine";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "UserEventServiceProto";
  28. option java_package = "com.google.cloud.discoveryengine.v1beta";
  29. option objc_class_prefix = "DISCOVERYENGINE";
  30. option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
  31. option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
  32. // Service for ingesting end user actions on a website to Discovery Engine API.
  33. service UserEventService {
  34. option (google.api.default_host) = "discoveryengine.googleapis.com";
  35. option (google.api.oauth_scopes) =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. // Writes a single user event.
  38. rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) {
  39. option (google.api.http) = {
  40. post: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/userEvents:write"
  41. body: "user_event"
  42. };
  43. }
  44. // Writes a single user event from the browser. This uses a GET request to
  45. // due to browser restriction of POST-ing to a 3rd party domain.
  46. //
  47. // This method is used only by the Discovery Engine API JavaScript pixel and
  48. // Google Tag Manager. Users should not call this method directly.
  49. rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) {
  50. option (google.api.http) = {
  51. get: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect"
  52. };
  53. }
  54. // Bulk import of User events. Request processing might be
  55. // synchronous. Events that already exist are skipped.
  56. // Use this method for backfilling historical user events.
  57. //
  58. // Operation.response is of type ImportResponse. Note that it is
  59. // possible for a subset of the items to be successfully inserted.
  60. // Operation.metadata is of type ImportMetadata.
  61. rpc ImportUserEvents(ImportUserEventsRequest)
  62. returns (google.longrunning.Operation) {
  63. option (google.api.http) = {
  64. post: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/userEvents:import"
  65. body: "*"
  66. };
  67. option (google.longrunning.operation_info) = {
  68. response_type: "google.cloud.discoveryengine.v1beta.ImportUserEventsResponse"
  69. metadata_type: "google.cloud.discoveryengine.v1beta.ImportUserEventsMetadata"
  70. };
  71. }
  72. }
  73. // Request message for WriteUserEvent method.
  74. message WriteUserEventRequest {
  75. // Required. The parent DataStore resource name, such as
  76. // `projects/{project}/locations/{location}/dataStores/{data_store}`.
  77. string parent = 1 [
  78. (google.api.field_behavior) = REQUIRED,
  79. (google.api.resource_reference) = {
  80. type: "discoveryengine.googleapis.com/DataStore"
  81. }
  82. ];
  83. // Required. User event to write.
  84. optional UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED];
  85. }
  86. // Request message for CollectUserEvent method.
  87. message CollectUserEventRequest {
  88. // Required. The parent DataStore resource name, such as
  89. // `projects/{project}/locations/{location}/dataStores/{data_store}`.
  90. string parent = 1 [
  91. (google.api.field_behavior) = REQUIRED,
  92. (google.api.resource_reference) = {
  93. type: "discoveryengine.googleapis.com/DataStore"
  94. }
  95. ];
  96. // Required. URL encoded UserEvent proto with a length limit of 2,000,000
  97. // characters.
  98. string user_event = 2 [(google.api.field_behavior) = REQUIRED];
  99. // The URL including cgi-parameters but excluding the hash fragment with a
  100. // length limit of 5,000 characters. This is often more useful than the
  101. // referer URL, because many browsers only send the domain for 3rd party
  102. // requests.
  103. optional string uri = 3;
  104. // The event timestamp in milliseconds. This prevents browser caching of
  105. // otherwise identical get requests. The name is abbreviated to reduce the
  106. // payload bytes.
  107. optional int64 ets = 4;
  108. }