google-cloud-discovery_engine-v1 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +14 -0
  3. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +10 -1
  4. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +10 -1
  5. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +14 -0
  6. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +109 -1
  7. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +102 -1
  8. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +14 -0
  9. data/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +66 -0
  10. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +14 -0
  11. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +14 -0
  12. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +2 -1
  13. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +2 -1
  14. data/lib/google/cloud/discovery_engine/v1/rest.rb +1 -0
  15. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +14 -0
  16. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +6 -3
  17. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +6 -3
  18. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb +571 -0
  19. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb +47 -0
  20. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +809 -0
  21. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb +78 -0
  22. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb +531 -0
  23. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +1128 -0
  24. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb +188 -0
  25. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb +53 -0
  26. data/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb +56 -0
  27. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +14 -0
  28. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +139 -0
  29. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +132 -0
  30. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +14 -0
  31. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +68 -0
  32. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  33. data/lib/google/cloud/discovery_engine/v1.rb +1 -0
  34. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +2 -1
  35. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  36. data/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb +48 -0
  37. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +1 -1
  38. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +4 -1
  39. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +10 -1
  40. data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +4 -0
  41. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +1 -1
  42. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +8 -1
  43. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +1 -1
  44. data/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb +61 -0
  45. data/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb +47 -0
  46. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  47. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +2 -1
  48. data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +5 -0
  49. data/proto_docs/google/api/client.rb +17 -0
  50. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +50 -5
  51. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +6 -4
  52. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +9 -9
  53. data/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb +94 -0
  54. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +10 -0
  55. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +22 -0
  56. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +2 -0
  57. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +101 -0
  58. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +2 -1
  59. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +13 -7
  60. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +115 -0
  61. data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +2 -1
  62. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +40 -16
  63. data/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb +172 -0
  64. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +4 -0
  65. metadata +16 -2
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/discoveryengine/v1/search_tuning_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1
25
+ module SearchTuningService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the SearchTuningService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: true,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the train_custom_model REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Longrunning::Operation]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Longrunning::Operation]
77
+ # A result object deserialized from the server's reply
78
+ def train_custom_model request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_train_custom_model_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # Baseline implementation for the list_custom_models REST call
104
+ #
105
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest]
106
+ # A request object representing the call parameters. Required.
107
+ # @param options [::Gapic::CallOptions]
108
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
109
+ #
110
+ # @yield [result, operation] Access the result along with the TransportOperation object
111
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse]
112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
113
+ #
114
+ # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse]
115
+ # A result object deserialized from the server's reply
116
+ def list_custom_models request_pb, options = nil
117
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
118
+
119
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_models_request request_pb
120
+ query_string_params = if query_string_params.any?
121
+ query_string_params.to_h { |p| p.split "=", 2 }
122
+ else
123
+ {}
124
+ end
125
+
126
+ response = @client_stub.make_http_request(
127
+ verb,
128
+ uri: uri,
129
+ body: body || "",
130
+ params: query_string_params,
131
+ options: options
132
+ )
133
+ operation = ::Gapic::Rest::TransportOperation.new response
134
+ result = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.decode_json response.body, ignore_unknown_fields: true
135
+
136
+ yield result, operation if block_given?
137
+ result
138
+ end
139
+
140
+ ##
141
+ # @private
142
+ #
143
+ # GRPC transcoding helper method for the train_custom_model REST call
144
+ #
145
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest]
146
+ # A request object representing the call parameters. Required.
147
+ # @return [Array(String, [String, nil], Hash{String => String})]
148
+ # Uri, Body, Query string parameters
149
+ def self.transcode_train_custom_model_request request_pb
150
+ transcoder = Gapic::Rest::GrpcTranscoder.new
151
+ .with_bindings(
152
+ uri_method: :post,
153
+ uri_template: "/v1/{data_store}:trainCustomModel",
154
+ body: "*",
155
+ matches: [
156
+ ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
157
+ ]
158
+ )
159
+ transcoder.transcode request_pb
160
+ end
161
+
162
+ ##
163
+ # @private
164
+ #
165
+ # GRPC transcoding helper method for the list_custom_models REST call
166
+ #
167
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest]
168
+ # A request object representing the call parameters. Required.
169
+ # @return [Array(String, [String, nil], Hash{String => String})]
170
+ # Uri, Body, Query string parameters
171
+ def self.transcode_list_custom_models_request request_pb
172
+ transcoder = Gapic::Rest::GrpcTranscoder.new
173
+ .with_bindings(
174
+ uri_method: :get,
175
+ uri_template: "/v1/{data_store}/customModels",
176
+ matches: [
177
+ ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
178
+ ]
179
+ )
180
+ transcoder.transcode request_pb
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1/version"
24
+
25
+ require "google/cloud/discovery_engine/v1/search_tuning_service/credentials"
26
+ require "google/cloud/discovery_engine/v1/search_tuning_service/paths"
27
+ require "google/cloud/discovery_engine/v1/search_tuning_service/rest/operations"
28
+ require "google/cloud/discovery_engine/v1/search_tuning_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module DiscoveryEngine
33
+ module V1
34
+ ##
35
+ # Service for search tuning.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/discovery_engine/v1/search_tuning_service/rest"
40
+ # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new
41
+ #
42
+ module SearchTuningService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/discovery_engine/v1/search_tuning_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1/version"
24
+
25
+ require "google/cloud/discovery_engine/v1/search_tuning_service/credentials"
26
+ require "google/cloud/discovery_engine/v1/search_tuning_service/paths"
27
+ require "google/cloud/discovery_engine/v1/search_tuning_service/operations"
28
+ require "google/cloud/discovery_engine/v1/search_tuning_service/client"
29
+ require "google/cloud/discovery_engine/v1/search_tuning_service/rest"
30
+
31
+ module Google
32
+ module Cloud
33
+ module DiscoveryEngine
34
+ module V1
35
+ ##
36
+ # Service for search tuning.
37
+ #
38
+ # @example Load this service and instantiate a gRPC client
39
+ #
40
+ # require "google/cloud/discovery_engine/v1/search_tuning_service"
41
+ # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new
42
+ #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/discovery_engine/v1/search_tuning_service/rest"
46
+ # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new
47
+ #
48
+ module SearchTuningService
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "search_tuning_service", "helpers.rb"
56
+ require "google/cloud/discovery_engine/v1/search_tuning_service/helpers" if ::File.file? helper_path
@@ -911,6 +911,13 @@ module Google
911
911
  ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
912
912
  ]
913
913
  )
914
+ .with_bindings(
915
+ uri_method: :get,
916
+ uri_template: "/v1/{name}/operations",
917
+ matches: [
918
+ ["name", %r{^projects/[^/]+/locations/[^/]+/identity_mapping_stores/[^/]+/?$}, false]
919
+ ]
920
+ )
914
921
  .with_bindings(
915
922
  uri_method: :get,
916
923
  uri_template: "/v1/{name}/operations",
@@ -1030,6 +1037,13 @@ module Google
1030
1037
  ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
1031
1038
  ]
1032
1039
  )
1040
+ .with_bindings(
1041
+ uri_method: :get,
1042
+ uri_template: "/v1/{name}",
1043
+ matches: [
1044
+ ["name", %r{^projects/[^/]+/locations/[^/]+/identity_mapping_stores/[^/]+/operations/[^/]+/?$}, false]
1045
+ ]
1046
+ )
1033
1047
  .with_bindings(
1034
1048
  uri_method: :get,
1035
1049
  uri_template: "/v1/{name}",
@@ -405,6 +405,138 @@ module Google
405
405
  raise ::Google::Cloud::Error.from_error(e)
406
406
  end
407
407
 
408
+ ##
409
+ # Deletes permanently all user events specified by the filter provided.
410
+ # Depending on the number of events specified by the filter, this operation
411
+ # could take hours or days to complete. To test a filter, use the list
412
+ # command first.
413
+ #
414
+ # @overload purge_user_events(request, options = nil)
415
+ # Pass arguments to `purge_user_events` via a request object, either of type
416
+ # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash.
417
+ #
418
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash]
419
+ # A request object representing the call parameters. Required. To specify no
420
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
421
+ # @param options [::Gapic::CallOptions, ::Hash]
422
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
423
+ #
424
+ # @overload purge_user_events(parent: nil, filter: nil, force: nil)
425
+ # Pass arguments to `purge_user_events` via keyword arguments. Note that at
426
+ # least one keyword argument is required. To specify no parameters, or to keep all
427
+ # the default parameter values, pass an empty Hash as a request object (see above).
428
+ #
429
+ # @param parent [::String]
430
+ # Required. The resource name of the catalog under which the events are
431
+ # created. The format is
432
+ # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`
433
+ # @param filter [::String]
434
+ # Required. The filter string to specify the events to be deleted with a
435
+ # length limit of 5,000 characters. The eligible fields for filtering are:
436
+ #
437
+ # * `eventType`: Double quoted
438
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type}
439
+ # string.
440
+ # * `eventTime`: in ISO 8601 "zulu" format.
441
+ # * `userPseudoId`: Double quoted string. Specifying this will delete all
442
+ # events associated with a visitor.
443
+ # * `userId`: Double quoted string. Specifying this will delete all events
444
+ # associated with a user.
445
+ #
446
+ # Examples:
447
+ #
448
+ # * Deleting all events in a time range:
449
+ # `eventTime > "2012-04-23T18:25:43.511Z"
450
+ # eventTime < "2012-04-23T18:30:43.511Z"`
451
+ # * Deleting specific eventType:
452
+ # `eventType = "search"`
453
+ # * Deleting all events for a specific visitor:
454
+ # `userPseudoId = "visitor1024"`
455
+ # * Deleting all events inside a DataStore:
456
+ # `*`
457
+ #
458
+ # The filtering fields are assumed to have an implicit AND.
459
+ # @param force [::Boolean]
460
+ # The `force` field is currently not supported. Purge user event requests
461
+ # will permanently delete all purgeable events. Once the development is
462
+ # complete:
463
+ # If `force` is set to false, the method will return the expected
464
+ # purge count without deleting any user events. This field will default to
465
+ # false if not included in the request.
466
+ #
467
+ # @yield [response, operation] Access the result along with the RPC operation
468
+ # @yieldparam response [::Gapic::Operation]
469
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
470
+ #
471
+ # @return [::Gapic::Operation]
472
+ #
473
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
474
+ #
475
+ # @example Basic example
476
+ # require "google/cloud/discovery_engine/v1"
477
+ #
478
+ # # Create a client object. The client can be reused for multiple calls.
479
+ # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new
480
+ #
481
+ # # Create a request. To set request fields, pass in keyword arguments.
482
+ # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new
483
+ #
484
+ # # Call the purge_user_events method.
485
+ # result = client.purge_user_events request
486
+ #
487
+ # # The returned object is of type Gapic::Operation. You can use it to
488
+ # # check the status of an operation, cancel it, or wait for results.
489
+ # # Here is how to wait for a response.
490
+ # result.wait_until_done! timeout: 60
491
+ # if result.response?
492
+ # p result.response
493
+ # else
494
+ # puts "No response received."
495
+ # end
496
+ #
497
+ def purge_user_events request, options = nil
498
+ raise ::ArgumentError, "request must be provided" if request.nil?
499
+
500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest
501
+
502
+ # Converts hash and nil to an options object
503
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
504
+
505
+ # Customize the options with defaults
506
+ metadata = @config.rpcs.purge_user_events.metadata.to_h
507
+
508
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
509
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
510
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
511
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
512
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
513
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
514
+
515
+ header_params = {}
516
+ if request.parent
517
+ header_params["parent"] = request.parent
518
+ end
519
+
520
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
521
+ metadata[:"x-goog-request-params"] ||= request_params_header
522
+
523
+ options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
524
+ metadata: metadata,
525
+ retry_policy: @config.rpcs.purge_user_events.retry_policy
526
+
527
+ options.apply_defaults timeout: @config.timeout,
528
+ metadata: @config.metadata,
529
+ retry_policy: @config.retry_policy
530
+
531
+ @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation|
532
+ response = ::Gapic::Operation.new response, @operations_client, options: options
533
+ yield response, operation if block_given?
534
+ return response
535
+ end
536
+ rescue ::GRPC::BadStatus => e
537
+ raise ::Google::Cloud::Error.from_error(e)
538
+ end
539
+
408
540
  ##
409
541
  # Bulk import of user events. Request processing might be
410
542
  # synchronous. Events that already exist are skipped.
@@ -679,6 +811,11 @@ module Google
679
811
  #
680
812
  attr_reader :collect_user_event
681
813
  ##
814
+ # RPC-specific configuration for `purge_user_events`
815
+ # @return [::Gapic::Config::Method]
816
+ #
817
+ attr_reader :purge_user_events
818
+ ##
682
819
  # RPC-specific configuration for `import_user_events`
683
820
  # @return [::Gapic::Config::Method]
684
821
  #
@@ -690,6 +827,8 @@ module Google
690
827
  @write_user_event = ::Gapic::Config::Method.new write_user_event_config
691
828
  collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event
692
829
  @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config
830
+ purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events
831
+ @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config
693
832
  import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events
694
833
  @import_user_events = ::Gapic::Config::Method.new import_user_events_config
695
834
 
@@ -384,6 +384,131 @@ module Google
384
384
  raise ::Google::Cloud::Error.from_error(e)
385
385
  end
386
386
 
387
+ ##
388
+ # Deletes permanently all user events specified by the filter provided.
389
+ # Depending on the number of events specified by the filter, this operation
390
+ # could take hours or days to complete. To test a filter, use the list
391
+ # command first.
392
+ #
393
+ # @overload purge_user_events(request, options = nil)
394
+ # Pass arguments to `purge_user_events` via a request object, either of type
395
+ # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash.
396
+ #
397
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash]
398
+ # A request object representing the call parameters. Required. To specify no
399
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
400
+ # @param options [::Gapic::CallOptions, ::Hash]
401
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
402
+ #
403
+ # @overload purge_user_events(parent: nil, filter: nil, force: nil)
404
+ # Pass arguments to `purge_user_events` via keyword arguments. Note that at
405
+ # least one keyword argument is required. To specify no parameters, or to keep all
406
+ # the default parameter values, pass an empty Hash as a request object (see above).
407
+ #
408
+ # @param parent [::String]
409
+ # Required. The resource name of the catalog under which the events are
410
+ # created. The format is
411
+ # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`
412
+ # @param filter [::String]
413
+ # Required. The filter string to specify the events to be deleted with a
414
+ # length limit of 5,000 characters. The eligible fields for filtering are:
415
+ #
416
+ # * `eventType`: Double quoted
417
+ # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type}
418
+ # string.
419
+ # * `eventTime`: in ISO 8601 "zulu" format.
420
+ # * `userPseudoId`: Double quoted string. Specifying this will delete all
421
+ # events associated with a visitor.
422
+ # * `userId`: Double quoted string. Specifying this will delete all events
423
+ # associated with a user.
424
+ #
425
+ # Examples:
426
+ #
427
+ # * Deleting all events in a time range:
428
+ # `eventTime > "2012-04-23T18:25:43.511Z"
429
+ # eventTime < "2012-04-23T18:30:43.511Z"`
430
+ # * Deleting specific eventType:
431
+ # `eventType = "search"`
432
+ # * Deleting all events for a specific visitor:
433
+ # `userPseudoId = "visitor1024"`
434
+ # * Deleting all events inside a DataStore:
435
+ # `*`
436
+ #
437
+ # The filtering fields are assumed to have an implicit AND.
438
+ # @param force [::Boolean]
439
+ # The `force` field is currently not supported. Purge user event requests
440
+ # will permanently delete all purgeable events. Once the development is
441
+ # complete:
442
+ # If `force` is set to false, the method will return the expected
443
+ # purge count without deleting any user events. This field will default to
444
+ # false if not included in the request.
445
+ # @yield [result, operation] Access the result along with the TransportOperation object
446
+ # @yieldparam result [::Gapic::Operation]
447
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
448
+ #
449
+ # @return [::Gapic::Operation]
450
+ #
451
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
452
+ #
453
+ # @example Basic example
454
+ # require "google/cloud/discovery_engine/v1"
455
+ #
456
+ # # Create a client object. The client can be reused for multiple calls.
457
+ # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new
458
+ #
459
+ # # Create a request. To set request fields, pass in keyword arguments.
460
+ # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new
461
+ #
462
+ # # Call the purge_user_events method.
463
+ # result = client.purge_user_events request
464
+ #
465
+ # # The returned object is of type Gapic::Operation. You can use it to
466
+ # # check the status of an operation, cancel it, or wait for results.
467
+ # # Here is how to wait for a response.
468
+ # result.wait_until_done! timeout: 60
469
+ # if result.response?
470
+ # p result.response
471
+ # else
472
+ # puts "No response received."
473
+ # end
474
+ #
475
+ def purge_user_events request, options = nil
476
+ raise ::ArgumentError, "request must be provided" if request.nil?
477
+
478
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest
479
+
480
+ # Converts hash and nil to an options object
481
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
482
+
483
+ # Customize the options with defaults
484
+ call_metadata = @config.rpcs.purge_user_events.metadata.to_h
485
+
486
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
487
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
488
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
489
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
490
+ transports_version_send: [:rest]
491
+
492
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
493
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
494
+
495
+ options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout,
496
+ metadata: call_metadata,
497
+ retry_policy: @config.rpcs.purge_user_events.retry_policy
498
+
499
+ options.apply_defaults timeout: @config.timeout,
500
+ metadata: @config.metadata,
501
+ retry_policy: @config.retry_policy
502
+
503
+ @user_event_service_stub.purge_user_events request, options do |result, operation|
504
+ result = ::Gapic::Operation.new result, @operations_client, options: options
505
+ yield result, operation if block_given?
506
+ return result
507
+ end
508
+ rescue ::Gapic::Rest::Error => e
509
+ raise ::Google::Cloud::Error.from_error(e)
510
+ end
511
+
387
512
  ##
388
513
  # Bulk import of user events. Request processing might be
389
514
  # synchronous. Events that already exist are skipped.
@@ -631,6 +756,11 @@ module Google
631
756
  #
632
757
  attr_reader :collect_user_event
633
758
  ##
759
+ # RPC-specific configuration for `purge_user_events`
760
+ # @return [::Gapic::Config::Method]
761
+ #
762
+ attr_reader :purge_user_events
763
+ ##
634
764
  # RPC-specific configuration for `import_user_events`
635
765
  # @return [::Gapic::Config::Method]
636
766
  #
@@ -642,6 +772,8 @@ module Google
642
772
  @write_user_event = ::Gapic::Config::Method.new write_user_event_config
643
773
  collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event
644
774
  @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config
775
+ purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events
776
+ @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config
645
777
  import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events
646
778
  @import_user_events = ::Gapic::Config::Method.new import_user_events_config
647
779
 
@@ -911,6 +911,13 @@ module Google
911
911
  ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false]
912
912
  ]
913
913
  )
914
+ .with_bindings(
915
+ uri_method: :get,
916
+ uri_template: "/v1/{name}/operations",
917
+ matches: [
918
+ ["name", %r{^projects/[^/]+/locations/[^/]+/identity_mapping_stores/[^/]+/?$}, false]
919
+ ]
920
+ )
914
921
  .with_bindings(
915
922
  uri_method: :get,
916
923
  uri_template: "/v1/{name}/operations",
@@ -1030,6 +1037,13 @@ module Google
1030
1037
  ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false]
1031
1038
  ]
1032
1039
  )
1040
+ .with_bindings(
1041
+ uri_method: :get,
1042
+ uri_template: "/v1/{name}",
1043
+ matches: [
1044
+ ["name", %r{^projects/[^/]+/locations/[^/]+/identity_mapping_stores/[^/]+/operations/[^/]+/?$}, false]
1045
+ ]
1046
+ )
1033
1047
  .with_bindings(
1034
1048
  uri_method: :get,
1035
1049
  uri_template: "/v1/{name}",