google-cloud-discovery_engine-v1 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +4 -4
  4. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb +803 -0
  5. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb +47 -0
  6. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +813 -0
  7. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb +135 -0
  8. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb +749 -0
  9. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb +1148 -0
  10. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb +341 -0
  11. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb +53 -0
  12. data/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb +56 -0
  13. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +8 -0
  14. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +53 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +11 -1
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +104 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +11 -1
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +8 -0
  19. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +8 -0
  20. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +8 -0
  21. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb +1160 -0
  22. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb +47 -0
  23. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +813 -0
  24. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb +154 -0
  25. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb +1085 -0
  26. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb +1148 -0
  27. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb +511 -0
  28. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb +53 -0
  29. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb +56 -0
  30. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +8 -0
  31. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -1
  32. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +8 -0
  33. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +8 -0
  34. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +8 -0
  35. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +8 -0
  36. data/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb +630 -0
  37. data/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb +47 -0
  38. data/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +813 -0
  39. data/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb +71 -0
  40. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb +590 -0
  41. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb +1148 -0
  42. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb +204 -0
  43. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb +53 -0
  44. data/lib/google/cloud/discovery_engine/v1/user_license_service.rb +56 -0
  45. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  46. data/lib/google/cloud/discovery_engine/v1.rb +5 -2
  47. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +1 -1
  48. data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +4 -1
  49. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb +61 -0
  50. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb +55 -0
  51. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +3 -1
  52. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  53. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +4 -1
  54. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +5 -1
  56. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +1 -1
  57. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +7 -1
  58. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +1 -1
  59. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb +48 -0
  61. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_pb.rb +68 -0
  62. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb +58 -0
  63. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +1 -1
  64. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  65. data/lib/google/cloud/discoveryengine/v1/user_license_pb.rb +48 -0
  66. data/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb +61 -0
  67. data/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb +48 -0
  68. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +17 -0
  69. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +54 -0
  70. data/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb +222 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +55 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +1 -3
  73. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +3 -0
  74. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +43 -1
  75. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +12 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +99 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +23 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +141 -5
  79. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +8 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +9 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb +81 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb +279 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +6 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +6 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/user_license.rb +85 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb +153 -0
  87. metadata +42 -2
@@ -0,0 +1,1085 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/errors"
20
+ require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb"
21
+ require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DiscoveryEngine
27
+ module V1
28
+ module IdentityMappingStoreService
29
+ module Rest
30
+ ##
31
+ # REST client for the IdentityMappingStoreService service.
32
+ #
33
+ # Service for managing Identity Mapping Stores.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :identity_mapping_store_service_stub
46
+
47
+ ##
48
+ # Configure the IdentityMappingStoreService Client class.
49
+ #
50
+ # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all IdentityMappingStoreService clients
56
+ # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the IdentityMappingStoreService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @identity_mapping_store_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new IdentityMappingStoreService REST client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the IdentityMappingStoreService client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # Create the configuration object
129
+ @config = Configuration.new Client.configure
130
+
131
+ # Yield the configuration if needed
132
+ yield @config if block_given?
133
+
134
+ # Create credentials
135
+ credentials = @config.credentials
136
+ # Use self-signed JWT if the endpoint is unchanged from default,
137
+ # but only if the default endpoint does not have a region prefix.
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
141
+ credentials ||= Credentials.default scope: @config.scope,
142
+ enable_self_signed_jwt: enable_self_signed_jwt
143
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
144
+ credentials = Credentials.new credentials, scope: @config.scope
145
+ end
146
+
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @operations_client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations.new do |config|
151
+ config.credentials = credentials
152
+ config.quota_project = @quota_project_id
153
+ config.endpoint = @config.endpoint
154
+ config.universe_domain = @config.universe_domain
155
+ end
156
+
157
+ @identity_mapping_store_service_stub = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @identity_mapping_store_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
175
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @identity_mapping_store_service_stub.endpoint
179
+ config.universe_domain = @identity_mapping_store_service_stub.universe_domain
180
+ config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger=
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for long-running operations.
186
+ #
187
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations]
188
+ #
189
+ attr_reader :operations_client
190
+
191
+ ##
192
+ # Get the associated client for mix-in of the Locations.
193
+ #
194
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
195
+ #
196
+ attr_reader :location_client
197
+
198
+ ##
199
+ # The logger used for request/response debug logging.
200
+ #
201
+ # @return [Logger]
202
+ #
203
+ def logger
204
+ @identity_mapping_store_service_stub.logger
205
+ end
206
+
207
+ # Service calls
208
+
209
+ ##
210
+ # Creates a new Identity Mapping Store.
211
+ #
212
+ # @overload create_identity_mapping_store(request, options = nil)
213
+ # Pass arguments to `create_identity_mapping_store` via a request object, either of type
214
+ # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash.
215
+ #
216
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash]
217
+ # A request object representing the call parameters. Required. To specify no
218
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
219
+ # @param options [::Gapic::CallOptions, ::Hash]
220
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
221
+ #
222
+ # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil)
223
+ # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at
224
+ # least one keyword argument is required. To specify no parameters, or to keep all
225
+ # the default parameter values, pass an empty Hash as a request object (see above).
226
+ #
227
+ # @param cmek_config_name [::String]
228
+ # Resource name of the CmekConfig to use for protecting this Identity
229
+ # Mapping Store.
230
+ #
231
+ # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared.
232
+ # @param disable_cmek [::Boolean]
233
+ # Identity Mapping Store without CMEK protections. If a default CmekConfig
234
+ # is set for the project, setting this field will override the default
235
+ # CmekConfig as well.
236
+ #
237
+ # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared.
238
+ # @param parent [::String]
239
+ # Required. The parent collection resource name, such as
240
+ # `projects/{project}/locations/{location}`.
241
+ # @param identity_mapping_store_id [::String]
242
+ # Required. The ID of the Identity Mapping Store to create.
243
+ #
244
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
245
+ # (_), and hyphens (-). The maximum length is 63 characters.
246
+ # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash]
247
+ # Required. The Identity Mapping Store to create.
248
+ # @yield [result, operation] Access the result along with the TransportOperation object
249
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
251
+ #
252
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
255
+ #
256
+ # @example Basic example
257
+ # require "google/cloud/discovery_engine/v1"
258
+ #
259
+ # # Create a client object. The client can be reused for multiple calls.
260
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
261
+ #
262
+ # # Create a request. To set request fields, pass in keyword arguments.
263
+ # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new
264
+ #
265
+ # # Call the create_identity_mapping_store method.
266
+ # result = client.create_identity_mapping_store request
267
+ #
268
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
269
+ # p result
270
+ #
271
+ def create_identity_mapping_store request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h
281
+
282
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
289
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
290
+
291
+ options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout,
292
+ metadata: call_metadata,
293
+ retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy
294
+
295
+ options.apply_defaults timeout: @config.timeout,
296
+ metadata: @config.metadata,
297
+ retry_policy: @config.retry_policy
298
+
299
+ @identity_mapping_store_service_stub.create_identity_mapping_store request, options do |result, operation|
300
+ yield result, operation if block_given?
301
+ end
302
+ rescue ::Gapic::Rest::Error => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Gets the Identity Mapping Store.
308
+ #
309
+ # @overload get_identity_mapping_store(request, options = nil)
310
+ # Pass arguments to `get_identity_mapping_store` via a request object, either of type
311
+ # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
318
+ #
319
+ # @overload get_identity_mapping_store(name: nil)
320
+ # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param name [::String]
325
+ # Required. The name of the Identity Mapping Store to get.
326
+ # Format:
327
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
328
+ # @yield [result, operation] Access the result along with the TransportOperation object
329
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
330
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
331
+ #
332
+ # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore]
333
+ #
334
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
335
+ #
336
+ # @example Basic example
337
+ # require "google/cloud/discovery_engine/v1"
338
+ #
339
+ # # Create a client object. The client can be reused for multiple calls.
340
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
341
+ #
342
+ # # Create a request. To set request fields, pass in keyword arguments.
343
+ # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new
344
+ #
345
+ # # Call the get_identity_mapping_store method.
346
+ # result = client.get_identity_mapping_store request
347
+ #
348
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
349
+ # p result
350
+ #
351
+ def get_identity_mapping_store request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ call_metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h
361
+
362
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
363
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
366
+ transports_version_send: [:rest]
367
+
368
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
369
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
370
+
371
+ options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout,
372
+ metadata: call_metadata,
373
+ retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy
374
+
375
+ options.apply_defaults timeout: @config.timeout,
376
+ metadata: @config.metadata,
377
+ retry_policy: @config.retry_policy
378
+
379
+ @identity_mapping_store_service_stub.get_identity_mapping_store request, options do |result, operation|
380
+ yield result, operation if block_given?
381
+ end
382
+ rescue ::Gapic::Rest::Error => e
383
+ raise ::Google::Cloud::Error.from_error(e)
384
+ end
385
+
386
+ ##
387
+ # Deletes the Identity Mapping Store.
388
+ #
389
+ # @overload delete_identity_mapping_store(request, options = nil)
390
+ # Pass arguments to `delete_identity_mapping_store` via a request object, either of type
391
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash.
392
+ #
393
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash]
394
+ # A request object representing the call parameters. Required. To specify no
395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
396
+ # @param options [::Gapic::CallOptions, ::Hash]
397
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
398
+ #
399
+ # @overload delete_identity_mapping_store(name: nil)
400
+ # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at
401
+ # least one keyword argument is required. To specify no parameters, or to keep all
402
+ # the default parameter values, pass an empty Hash as a request object (see above).
403
+ #
404
+ # @param name [::String]
405
+ # Required. The name of the Identity Mapping Store to delete.
406
+ # Format:
407
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
408
+ # @yield [result, operation] Access the result along with the TransportOperation object
409
+ # @yieldparam result [::Gapic::Operation]
410
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
411
+ #
412
+ # @return [::Gapic::Operation]
413
+ #
414
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
415
+ #
416
+ # @example Basic example
417
+ # require "google/cloud/discovery_engine/v1"
418
+ #
419
+ # # Create a client object. The client can be reused for multiple calls.
420
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
421
+ #
422
+ # # Create a request. To set request fields, pass in keyword arguments.
423
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new
424
+ #
425
+ # # Call the delete_identity_mapping_store method.
426
+ # result = client.delete_identity_mapping_store request
427
+ #
428
+ # # The returned object is of type Gapic::Operation. You can use it to
429
+ # # check the status of an operation, cancel it, or wait for results.
430
+ # # Here is how to wait for a response.
431
+ # result.wait_until_done! timeout: 60
432
+ # if result.response?
433
+ # p result.response
434
+ # else
435
+ # puts "No response received."
436
+ # end
437
+ #
438
+ def delete_identity_mapping_store request, options = nil
439
+ raise ::ArgumentError, "request must be provided" if request.nil?
440
+
441
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest
442
+
443
+ # Converts hash and nil to an options object
444
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
445
+
446
+ # Customize the options with defaults
447
+ call_metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h
448
+
449
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
450
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
451
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
452
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
453
+ transports_version_send: [:rest]
454
+
455
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
456
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
457
+
458
+ options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout,
459
+ metadata: call_metadata,
460
+ retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy
461
+
462
+ options.apply_defaults timeout: @config.timeout,
463
+ metadata: @config.metadata,
464
+ retry_policy: @config.retry_policy
465
+
466
+ @identity_mapping_store_service_stub.delete_identity_mapping_store request, options do |result, operation|
467
+ result = ::Gapic::Operation.new result, @operations_client, options: options
468
+ yield result, operation if block_given?
469
+ throw :response, result
470
+ end
471
+ rescue ::Gapic::Rest::Error => e
472
+ raise ::Google::Cloud::Error.from_error(e)
473
+ end
474
+
475
+ ##
476
+ # Imports a list of Identity Mapping Entries to an Identity Mapping Store.
477
+ #
478
+ # @overload import_identity_mappings(request, options = nil)
479
+ # Pass arguments to `import_identity_mappings` via a request object, either of type
480
+ # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash.
481
+ #
482
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash]
483
+ # A request object representing the call parameters. Required. To specify no
484
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
485
+ # @param options [::Gapic::CallOptions, ::Hash]
486
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
487
+ #
488
+ # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil)
489
+ # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at
490
+ # least one keyword argument is required. To specify no parameters, or to keep all
491
+ # the default parameter values, pass an empty Hash as a request object (see above).
492
+ #
493
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash]
494
+ # The inline source to import identity mapping entries from.
495
+ # @param identity_mapping_store [::String]
496
+ # Required. The name of the Identity Mapping Store to import Identity Mapping
497
+ # Entries to. Format:
498
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
499
+ # @yield [result, operation] Access the result along with the TransportOperation object
500
+ # @yieldparam result [::Gapic::Operation]
501
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
502
+ #
503
+ # @return [::Gapic::Operation]
504
+ #
505
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
506
+ #
507
+ # @example Basic example
508
+ # require "google/cloud/discovery_engine/v1"
509
+ #
510
+ # # Create a client object. The client can be reused for multiple calls.
511
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
512
+ #
513
+ # # Create a request. To set request fields, pass in keyword arguments.
514
+ # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new
515
+ #
516
+ # # Call the import_identity_mappings method.
517
+ # result = client.import_identity_mappings request
518
+ #
519
+ # # The returned object is of type Gapic::Operation. You can use it to
520
+ # # check the status of an operation, cancel it, or wait for results.
521
+ # # Here is how to wait for a response.
522
+ # result.wait_until_done! timeout: 60
523
+ # if result.response?
524
+ # p result.response
525
+ # else
526
+ # puts "No response received."
527
+ # end
528
+ #
529
+ def import_identity_mappings request, options = nil
530
+ raise ::ArgumentError, "request must be provided" if request.nil?
531
+
532
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest
533
+
534
+ # Converts hash and nil to an options object
535
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
536
+
537
+ # Customize the options with defaults
538
+ call_metadata = @config.rpcs.import_identity_mappings.metadata.to_h
539
+
540
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
541
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
542
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
543
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
544
+ transports_version_send: [:rest]
545
+
546
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
547
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
548
+
549
+ options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout,
550
+ metadata: call_metadata,
551
+ retry_policy: @config.rpcs.import_identity_mappings.retry_policy
552
+
553
+ options.apply_defaults timeout: @config.timeout,
554
+ metadata: @config.metadata,
555
+ retry_policy: @config.retry_policy
556
+
557
+ @identity_mapping_store_service_stub.import_identity_mappings request, options do |result, operation|
558
+ result = ::Gapic::Operation.new result, @operations_client, options: options
559
+ yield result, operation if block_given?
560
+ throw :response, result
561
+ end
562
+ rescue ::Gapic::Rest::Error => e
563
+ raise ::Google::Cloud::Error.from_error(e)
564
+ end
565
+
566
+ ##
567
+ # Purges specified or all Identity Mapping Entries from an Identity Mapping
568
+ # Store.
569
+ #
570
+ # @overload purge_identity_mappings(request, options = nil)
571
+ # Pass arguments to `purge_identity_mappings` via a request object, either of type
572
+ # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash.
573
+ #
574
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash]
575
+ # A request object representing the call parameters. Required. To specify no
576
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
577
+ # @param options [::Gapic::CallOptions, ::Hash]
578
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
579
+ #
580
+ # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil)
581
+ # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at
582
+ # least one keyword argument is required. To specify no parameters, or to keep all
583
+ # the default parameter values, pass an empty Hash as a request object (see above).
584
+ #
585
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash]
586
+ # The inline source to purge identity mapping entries from.
587
+ # @param identity_mapping_store [::String]
588
+ # Required. The name of the Identity Mapping Store to purge Identity Mapping
589
+ # Entries from. Format:
590
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
591
+ # @param filter [::String]
592
+ # Filter matching identity mappings to purge.
593
+ # The eligible field for filtering is:
594
+ # * `update_time`: in ISO 8601 "zulu" format.
595
+ # * `external_id`
596
+ #
597
+ # Examples:
598
+ #
599
+ # * Deleting all identity mappings updated in a time range:
600
+ # `update_time > "2012-04-23T18:25:43.511Z" AND update_time <
601
+ # "2012-04-23T18:30:43.511Z"`
602
+ # * Deleting all identity mappings for a given external_id:
603
+ # `external_id = "id1"`
604
+ # * Deleting all identity mappings inside an identity mapping store:
605
+ # `*`
606
+ #
607
+ # The filtering fields are assumed to have an implicit AND.
608
+ # Should not be used with source. An error will be thrown, if both are
609
+ # provided.
610
+ # @param force [::Boolean]
611
+ # Actually performs the purge. If `force` is set to false, return the
612
+ # expected purge count without deleting any identity mappings. This field is
613
+ # only supported for purge with filter. For input source this field is
614
+ # ignored and data will be purged regardless of the value of this field.
615
+ # @yield [result, operation] Access the result along with the TransportOperation object
616
+ # @yieldparam result [::Gapic::Operation]
617
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
618
+ #
619
+ # @return [::Gapic::Operation]
620
+ #
621
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
622
+ #
623
+ # @example Basic example
624
+ # require "google/cloud/discovery_engine/v1"
625
+ #
626
+ # # Create a client object. The client can be reused for multiple calls.
627
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
628
+ #
629
+ # # Create a request. To set request fields, pass in keyword arguments.
630
+ # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new
631
+ #
632
+ # # Call the purge_identity_mappings method.
633
+ # result = client.purge_identity_mappings request
634
+ #
635
+ # # The returned object is of type Gapic::Operation. You can use it to
636
+ # # check the status of an operation, cancel it, or wait for results.
637
+ # # Here is how to wait for a response.
638
+ # result.wait_until_done! timeout: 60
639
+ # if result.response?
640
+ # p result.response
641
+ # else
642
+ # puts "No response received."
643
+ # end
644
+ #
645
+ def purge_identity_mappings request, options = nil
646
+ raise ::ArgumentError, "request must be provided" if request.nil?
647
+
648
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest
649
+
650
+ # Converts hash and nil to an options object
651
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
652
+
653
+ # Customize the options with defaults
654
+ call_metadata = @config.rpcs.purge_identity_mappings.metadata.to_h
655
+
656
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
657
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
658
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
659
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
660
+ transports_version_send: [:rest]
661
+
662
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
663
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
664
+
665
+ options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout,
666
+ metadata: call_metadata,
667
+ retry_policy: @config.rpcs.purge_identity_mappings.retry_policy
668
+
669
+ options.apply_defaults timeout: @config.timeout,
670
+ metadata: @config.metadata,
671
+ retry_policy: @config.retry_policy
672
+
673
+ @identity_mapping_store_service_stub.purge_identity_mappings request, options do |result, operation|
674
+ result = ::Gapic::Operation.new result, @operations_client, options: options
675
+ yield result, operation if block_given?
676
+ throw :response, result
677
+ end
678
+ rescue ::Gapic::Rest::Error => e
679
+ raise ::Google::Cloud::Error.from_error(e)
680
+ end
681
+
682
+ ##
683
+ # Lists Identity Mappings in an Identity Mapping Store.
684
+ #
685
+ # @overload list_identity_mappings(request, options = nil)
686
+ # Pass arguments to `list_identity_mappings` via a request object, either of type
687
+ # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash.
688
+ #
689
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash]
690
+ # A request object representing the call parameters. Required. To specify no
691
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
692
+ # @param options [::Gapic::CallOptions, ::Hash]
693
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
694
+ #
695
+ # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil)
696
+ # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at
697
+ # least one keyword argument is required. To specify no parameters, or to keep all
698
+ # the default parameter values, pass an empty Hash as a request object (see above).
699
+ #
700
+ # @param identity_mapping_store [::String]
701
+ # Required. The name of the Identity Mapping Store to list Identity Mapping
702
+ # Entries in. Format:
703
+ # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}`
704
+ # @param page_size [::Integer]
705
+ # Maximum number of IdentityMappings to return. If unspecified, defaults
706
+ # to 2000. The maximum allowed value is 10000. Values above 10000 will be
707
+ # coerced to 10000.
708
+ # @param page_token [::String]
709
+ # A page token, received from a previous `ListIdentityMappings` call.
710
+ # Provide this to retrieve the subsequent page.
711
+ #
712
+ # When paginating, all other parameters provided to
713
+ # `ListIdentityMappings` must match the call that provided the page
714
+ # token.
715
+ # @yield [result, operation] Access the result along with the TransportOperation object
716
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>]
717
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
718
+ #
719
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>]
720
+ #
721
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
722
+ #
723
+ # @example Basic example
724
+ # require "google/cloud/discovery_engine/v1"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new
731
+ #
732
+ # # Call the list_identity_mappings method.
733
+ # result = client.list_identity_mappings request
734
+ #
735
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
736
+ # # over elements, and API calls will be issued to fetch pages as needed.
737
+ # result.each do |item|
738
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry.
739
+ # p item
740
+ # end
741
+ #
742
+ def list_identity_mappings request, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request.nil?
744
+
745
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest
746
+
747
+ # Converts hash and nil to an options object
748
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
749
+
750
+ # Customize the options with defaults
751
+ call_metadata = @config.rpcs.list_identity_mappings.metadata.to_h
752
+
753
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
754
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
755
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
756
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
757
+ transports_version_send: [:rest]
758
+
759
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
760
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
761
+
762
+ options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout,
763
+ metadata: call_metadata,
764
+ retry_policy: @config.rpcs.list_identity_mappings.retry_policy
765
+
766
+ options.apply_defaults timeout: @config.timeout,
767
+ metadata: @config.metadata,
768
+ retry_policy: @config.retry_policy
769
+
770
+ @identity_mapping_store_service_stub.list_identity_mappings request, options do |result, operation|
771
+ result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, "identity_mapping_entries", request, result, options
772
+ yield result, operation if block_given?
773
+ throw :response, result
774
+ end
775
+ rescue ::Gapic::Rest::Error => e
776
+ raise ::Google::Cloud::Error.from_error(e)
777
+ end
778
+
779
+ ##
780
+ # Lists all Identity Mapping Stores.
781
+ #
782
+ # @overload list_identity_mapping_stores(request, options = nil)
783
+ # Pass arguments to `list_identity_mapping_stores` via a request object, either of type
784
+ # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash.
785
+ #
786
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash]
787
+ # A request object representing the call parameters. Required. To specify no
788
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
789
+ # @param options [::Gapic::CallOptions, ::Hash]
790
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
791
+ #
792
+ # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil)
793
+ # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at
794
+ # least one keyword argument is required. To specify no parameters, or to keep all
795
+ # the default parameter values, pass an empty Hash as a request object (see above).
796
+ #
797
+ # @param parent [::String]
798
+ # Required. The parent of the Identity Mapping Stores to list.
799
+ # Format:
800
+ # `projects/{project}/locations/{location}`.
801
+ # @param page_size [::Integer]
802
+ # Maximum number of IdentityMappingStores to return. If unspecified, defaults
803
+ # to 100. The maximum allowed value is 1000. Values above 1000 will be
804
+ # coerced to 1000.
805
+ # @param page_token [::String]
806
+ # A page token, received from a previous `ListIdentityMappingStores` call.
807
+ # Provide this to retrieve the subsequent page.
808
+ #
809
+ # When paginating, all other parameters provided to
810
+ # `ListIdentityMappingStores` must match the call that provided the page
811
+ # token.
812
+ # @yield [result, operation] Access the result along with the TransportOperation object
813
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>]
814
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
815
+ #
816
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>]
817
+ #
818
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
819
+ #
820
+ # @example Basic example
821
+ # require "google/cloud/discovery_engine/v1"
822
+ #
823
+ # # Create a client object. The client can be reused for multiple calls.
824
+ # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new
825
+ #
826
+ # # Create a request. To set request fields, pass in keyword arguments.
827
+ # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new
828
+ #
829
+ # # Call the list_identity_mapping_stores method.
830
+ # result = client.list_identity_mapping_stores request
831
+ #
832
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
833
+ # # over elements, and API calls will be issued to fetch pages as needed.
834
+ # result.each do |item|
835
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.
836
+ # p item
837
+ # end
838
+ #
839
+ def list_identity_mapping_stores request, options = nil
840
+ raise ::ArgumentError, "request must be provided" if request.nil?
841
+
842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest
843
+
844
+ # Converts hash and nil to an options object
845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
846
+
847
+ # Customize the options with defaults
848
+ call_metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h
849
+
850
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
851
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
853
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
854
+ transports_version_send: [:rest]
855
+
856
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
857
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
858
+
859
+ options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout,
860
+ metadata: call_metadata,
861
+ retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy
862
+
863
+ options.apply_defaults timeout: @config.timeout,
864
+ metadata: @config.metadata,
865
+ retry_policy: @config.retry_policy
866
+
867
+ @identity_mapping_store_service_stub.list_identity_mapping_stores request, options do |result, operation|
868
+ result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, "identity_mapping_stores", request, result, options
869
+ yield result, operation if block_given?
870
+ throw :response, result
871
+ end
872
+ rescue ::Gapic::Rest::Error => e
873
+ raise ::Google::Cloud::Error.from_error(e)
874
+ end
875
+
876
+ ##
877
+ # Configuration class for the IdentityMappingStoreService REST API.
878
+ #
879
+ # This class represents the configuration for IdentityMappingStoreService REST,
880
+ # providing control over timeouts, retry behavior, logging, transport
881
+ # parameters, and other low-level controls. Certain parameters can also be
882
+ # applied individually to specific RPCs. See
883
+ # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration::Rpcs}
884
+ # for a list of RPCs that can be configured independently.
885
+ #
886
+ # Configuration can be applied globally to all clients, or to a single client
887
+ # on construction.
888
+ #
889
+ # @example
890
+ #
891
+ # # Modify the global config, setting the timeout for
892
+ # # create_identity_mapping_store to 20 seconds,
893
+ # # and all remaining timeouts to 10 seconds.
894
+ # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config|
895
+ # config.timeout = 10.0
896
+ # config.rpcs.create_identity_mapping_store.timeout = 20.0
897
+ # end
898
+ #
899
+ # # Apply the above configuration only to a new client.
900
+ # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config|
901
+ # config.timeout = 10.0
902
+ # config.rpcs.create_identity_mapping_store.timeout = 20.0
903
+ # end
904
+ #
905
+ # @!attribute [rw] endpoint
906
+ # A custom service endpoint, as a hostname or hostname:port. The default is
907
+ # nil, indicating to use the default endpoint in the current universe domain.
908
+ # @return [::String,nil]
909
+ # @!attribute [rw] credentials
910
+ # Credentials to send with calls. You may provide any of the following types:
911
+ # * (`String`) The path to a service account key file in JSON format
912
+ # * (`Hash`) A service account key as a Hash
913
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
914
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
915
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
916
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
917
+ # * (`nil`) indicating no credentials
918
+ #
919
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
920
+ # external source for authentication to Google Cloud, you must validate it before
921
+ # providing it to a Google API client library. Providing an unvalidated credential
922
+ # configuration to Google APIs can compromise the security of your systems and data.
923
+ # For more information, refer to [Validate credential configurations from external
924
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
925
+ # @return [::Object]
926
+ # @!attribute [rw] scope
927
+ # The OAuth scopes
928
+ # @return [::Array<::String>]
929
+ # @!attribute [rw] lib_name
930
+ # The library name as recorded in instrumentation and logging
931
+ # @return [::String]
932
+ # @!attribute [rw] lib_version
933
+ # The library version as recorded in instrumentation and logging
934
+ # @return [::String]
935
+ # @!attribute [rw] timeout
936
+ # The call timeout in seconds.
937
+ # @return [::Numeric]
938
+ # @!attribute [rw] metadata
939
+ # Additional headers to be sent with the call.
940
+ # @return [::Hash{::Symbol=>::String}]
941
+ # @!attribute [rw] retry_policy
942
+ # The retry policy. The value is a hash with the following keys:
943
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
944
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
945
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
946
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
947
+ # trigger a retry.
948
+ # @return [::Hash]
949
+ # @!attribute [rw] quota_project
950
+ # A separate project against which to charge quota.
951
+ # @return [::String]
952
+ # @!attribute [rw] universe_domain
953
+ # The universe domain within which to make requests. This determines the
954
+ # default endpoint URL. The default value of nil uses the environment
955
+ # universe (usually the default "googleapis.com" universe).
956
+ # @return [::String,nil]
957
+ # @!attribute [rw] logger
958
+ # A custom logger to use for request/response debug logging, or the value
959
+ # `:default` (the default) to construct a default logger, or `nil` to
960
+ # explicitly disable logging.
961
+ # @return [::Logger,:default,nil]
962
+ #
963
+ class Configuration
964
+ extend ::Gapic::Config
965
+
966
+ # @private
967
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
968
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
969
+
970
+ config_attr :endpoint, nil, ::String, nil
971
+ config_attr :credentials, nil do |value|
972
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
973
+ allowed.any? { |klass| klass === value }
974
+ end
975
+ config_attr :scope, nil, ::String, ::Array, nil
976
+ config_attr :lib_name, nil, ::String, nil
977
+ config_attr :lib_version, nil, ::String, nil
978
+ config_attr :timeout, nil, ::Numeric, nil
979
+ config_attr :metadata, nil, ::Hash, nil
980
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
981
+ config_attr :quota_project, nil, ::String, nil
982
+ config_attr :universe_domain, nil, ::String, nil
983
+ config_attr :logger, :default, ::Logger, nil, :default
984
+
985
+ # @private
986
+ def initialize parent_config = nil
987
+ @parent_config = parent_config unless parent_config.nil?
988
+
989
+ yield self if block_given?
990
+ end
991
+
992
+ ##
993
+ # Configurations for individual RPCs
994
+ # @return [Rpcs]
995
+ #
996
+ def rpcs
997
+ @rpcs ||= begin
998
+ parent_rpcs = nil
999
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1000
+ Rpcs.new parent_rpcs
1001
+ end
1002
+ end
1003
+
1004
+ ##
1005
+ # Configuration RPC class for the IdentityMappingStoreService API.
1006
+ #
1007
+ # Includes fields providing the configuration for each RPC in this service.
1008
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1009
+ # the following configuration fields:
1010
+ #
1011
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1012
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1013
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1014
+ # include the following keys:
1015
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1016
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1017
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1018
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1019
+ # trigger a retry.
1020
+ #
1021
+ class Rpcs
1022
+ ##
1023
+ # RPC-specific configuration for `create_identity_mapping_store`
1024
+ # @return [::Gapic::Config::Method]
1025
+ #
1026
+ attr_reader :create_identity_mapping_store
1027
+ ##
1028
+ # RPC-specific configuration for `get_identity_mapping_store`
1029
+ # @return [::Gapic::Config::Method]
1030
+ #
1031
+ attr_reader :get_identity_mapping_store
1032
+ ##
1033
+ # RPC-specific configuration for `delete_identity_mapping_store`
1034
+ # @return [::Gapic::Config::Method]
1035
+ #
1036
+ attr_reader :delete_identity_mapping_store
1037
+ ##
1038
+ # RPC-specific configuration for `import_identity_mappings`
1039
+ # @return [::Gapic::Config::Method]
1040
+ #
1041
+ attr_reader :import_identity_mappings
1042
+ ##
1043
+ # RPC-specific configuration for `purge_identity_mappings`
1044
+ # @return [::Gapic::Config::Method]
1045
+ #
1046
+ attr_reader :purge_identity_mappings
1047
+ ##
1048
+ # RPC-specific configuration for `list_identity_mappings`
1049
+ # @return [::Gapic::Config::Method]
1050
+ #
1051
+ attr_reader :list_identity_mappings
1052
+ ##
1053
+ # RPC-specific configuration for `list_identity_mapping_stores`
1054
+ # @return [::Gapic::Config::Method]
1055
+ #
1056
+ attr_reader :list_identity_mapping_stores
1057
+
1058
+ # @private
1059
+ def initialize parent_rpcs = nil
1060
+ create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store
1061
+ @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config
1062
+ get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store
1063
+ @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config
1064
+ delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store
1065
+ @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config
1066
+ import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings
1067
+ @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config
1068
+ purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings
1069
+ @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config
1070
+ list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings
1071
+ @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config
1072
+ list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores
1073
+ @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config
1074
+
1075
+ yield self if block_given?
1076
+ end
1077
+ end
1078
+ end
1079
+ end
1080
+ end
1081
+ end
1082
+ end
1083
+ end
1084
+ end
1085
+ end