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,749 @@
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/cmek_config_service_pb"
21
+ require "google/cloud/discovery_engine/v1/cmek_config_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 CmekConfigService
29
+ module Rest
30
+ ##
31
+ # REST client for the CmekConfigService service.
32
+ #
33
+ # Service for managing CMEK related tasks
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 :cmek_config_service_stub
46
+
47
+ ##
48
+ # Configure the CmekConfigService Client class.
49
+ #
50
+ # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all CmekConfigService clients
56
+ # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::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 CmekConfigService 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::CmekConfigService::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
+ @cmek_config_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new CmekConfigService REST client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the CmekConfigService 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::CmekConfigService::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
+ @cmek_config_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::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
+ @cmek_config_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 = @cmek_config_service_stub.endpoint
179
+ config.universe_domain = @cmek_config_service_stub.universe_domain
180
+ config.logger = @cmek_config_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::CmekConfigService::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
+ @cmek_config_service_stub.logger
205
+ end
206
+
207
+ # Service calls
208
+
209
+ ##
210
+ # Provisions a CMEK key for use in a location of a customer's project.
211
+ # This method will also conduct location validation on the provided
212
+ # cmekConfig to make sure the key is valid and can be used in the
213
+ # selected location.
214
+ #
215
+ # @overload update_cmek_config(request, options = nil)
216
+ # Pass arguments to `update_cmek_config` via a request object, either of type
217
+ # {::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest} or an equivalent Hash.
218
+ #
219
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Hash]
220
+ # A request object representing the call parameters. Required. To specify no
221
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
222
+ # @param options [::Gapic::CallOptions, ::Hash]
223
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
224
+ #
225
+ # @overload update_cmek_config(config: nil, set_default: nil)
226
+ # Pass arguments to `update_cmek_config` via keyword arguments. Note that at
227
+ # least one keyword argument is required. To specify no parameters, or to keep all
228
+ # the default parameter values, pass an empty Hash as a request object (see above).
229
+ #
230
+ # @param config [::Google::Cloud::DiscoveryEngine::V1::CmekConfig, ::Hash]
231
+ # Required. The CmekConfig resource.
232
+ # @param set_default [::Boolean]
233
+ # Set the following CmekConfig as the default to be used for child
234
+ # resources if one is not specified.
235
+ # @yield [result, operation] Access the result along with the TransportOperation object
236
+ # @yieldparam result [::Gapic::Operation]
237
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
238
+ #
239
+ # @return [::Gapic::Operation]
240
+ #
241
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
242
+ #
243
+ # @example Basic example
244
+ # require "google/cloud/discovery_engine/v1"
245
+ #
246
+ # # Create a client object. The client can be reused for multiple calls.
247
+ # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
248
+ #
249
+ # # Create a request. To set request fields, pass in keyword arguments.
250
+ # request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new
251
+ #
252
+ # # Call the update_cmek_config method.
253
+ # result = client.update_cmek_config request
254
+ #
255
+ # # The returned object is of type Gapic::Operation. You can use it to
256
+ # # check the status of an operation, cancel it, or wait for results.
257
+ # # Here is how to wait for a response.
258
+ # result.wait_until_done! timeout: 60
259
+ # if result.response?
260
+ # p result.response
261
+ # else
262
+ # puts "No response received."
263
+ # end
264
+ #
265
+ def update_cmek_config request, options = nil
266
+ raise ::ArgumentError, "request must be provided" if request.nil?
267
+
268
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest
269
+
270
+ # Converts hash and nil to an options object
271
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
272
+
273
+ # Customize the options with defaults
274
+ call_metadata = @config.rpcs.update_cmek_config.metadata.to_h
275
+
276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
277
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
279
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
280
+ transports_version_send: [:rest]
281
+
282
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
283
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
+
285
+ options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout,
286
+ metadata: call_metadata,
287
+ retry_policy: @config.rpcs.update_cmek_config.retry_policy
288
+
289
+ options.apply_defaults timeout: @config.timeout,
290
+ metadata: @config.metadata,
291
+ retry_policy: @config.retry_policy
292
+
293
+ @cmek_config_service_stub.update_cmek_config request, options do |result, operation|
294
+ result = ::Gapic::Operation.new result, @operations_client, options: options
295
+ yield result, operation if block_given?
296
+ throw :response, result
297
+ end
298
+ rescue ::Gapic::Rest::Error => e
299
+ raise ::Google::Cloud::Error.from_error(e)
300
+ end
301
+
302
+ ##
303
+ # Gets the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}.
304
+ #
305
+ # @overload get_cmek_config(request, options = nil)
306
+ # Pass arguments to `get_cmek_config` via a request object, either of type
307
+ # {::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest} or an equivalent Hash.
308
+ #
309
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Hash]
310
+ # A request object representing the call parameters. Required. To specify no
311
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
312
+ # @param options [::Gapic::CallOptions, ::Hash]
313
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
314
+ #
315
+ # @overload get_cmek_config(name: nil)
316
+ # Pass arguments to `get_cmek_config` via keyword arguments. Note that at
317
+ # least one keyword argument is required. To specify no parameters, or to keep all
318
+ # the default parameter values, pass an empty Hash as a request object (see above).
319
+ #
320
+ # @param name [::String]
321
+ # Required. Resource name of
322
+ # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as
323
+ # `projects/*/locations/*/cmekConfig` or
324
+ # `projects/*/locations/*/cmekConfigs/*`.
325
+ #
326
+ # If the caller does not have permission to access the
327
+ # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of
328
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
329
+ # @yield [result, operation] Access the result along with the TransportOperation object
330
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CmekConfig]
331
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
332
+ #
333
+ # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig]
334
+ #
335
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
336
+ #
337
+ # @example Basic example
338
+ # require "google/cloud/discovery_engine/v1"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new
345
+ #
346
+ # # Call the get_cmek_config method.
347
+ # result = client.get_cmek_config request
348
+ #
349
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig.
350
+ # p result
351
+ #
352
+ def get_cmek_config request, options = nil
353
+ raise ::ArgumentError, "request must be provided" if request.nil?
354
+
355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest
356
+
357
+ # Converts hash and nil to an options object
358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
359
+
360
+ # Customize the options with defaults
361
+ call_metadata = @config.rpcs.get_cmek_config.metadata.to_h
362
+
363
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
364
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
366
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
367
+ transports_version_send: [:rest]
368
+
369
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
370
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
+
372
+ options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout,
373
+ metadata: call_metadata,
374
+ retry_policy: @config.rpcs.get_cmek_config.retry_policy
375
+
376
+ options.apply_defaults timeout: @config.timeout,
377
+ metadata: @config.metadata,
378
+ retry_policy: @config.retry_policy
379
+
380
+ @cmek_config_service_stub.get_cmek_config request, options do |result, operation|
381
+ yield result, operation if block_given?
382
+ end
383
+ rescue ::Gapic::Rest::Error => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s
389
+ # with the project.
390
+ #
391
+ # @overload list_cmek_configs(request, options = nil)
392
+ # Pass arguments to `list_cmek_configs` via a request object, either of type
393
+ # {::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest} or an equivalent Hash.
394
+ #
395
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Hash]
396
+ # A request object representing the call parameters. Required. To specify no
397
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
398
+ # @param options [::Gapic::CallOptions, ::Hash]
399
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
400
+ #
401
+ # @overload list_cmek_configs(parent: nil)
402
+ # Pass arguments to `list_cmek_configs` via keyword arguments. Note that at
403
+ # least one keyword argument is required. To specify no parameters, or to keep all
404
+ # the default parameter values, pass an empty Hash as a request object (see above).
405
+ #
406
+ # @param parent [::String]
407
+ # Required. The parent location resource name, such as
408
+ # `projects/{project}/locations/{location}`.
409
+ #
410
+ # If the caller does not have permission to list
411
+ # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this
412
+ # location, regardless of whether or not a CmekConfig exists, a
413
+ # PERMISSION_DENIED error is returned.
414
+ # @yield [result, operation] Access the result along with the TransportOperation object
415
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse]
416
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
417
+ #
418
+ # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse]
419
+ #
420
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
421
+ #
422
+ # @example Basic example
423
+ # require "google/cloud/discovery_engine/v1"
424
+ #
425
+ # # Create a client object. The client can be reused for multiple calls.
426
+ # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
427
+ #
428
+ # # Create a request. To set request fields, pass in keyword arguments.
429
+ # request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new
430
+ #
431
+ # # Call the list_cmek_configs method.
432
+ # result = client.list_cmek_configs request
433
+ #
434
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.
435
+ # p result
436
+ #
437
+ def list_cmek_configs request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ call_metadata = @config.rpcs.list_cmek_configs.metadata.to_h
447
+
448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
449
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
452
+ transports_version_send: [:rest]
453
+
454
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
455
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
456
+
457
+ options.apply_defaults timeout: @config.rpcs.list_cmek_configs.timeout,
458
+ metadata: call_metadata,
459
+ retry_policy: @config.rpcs.list_cmek_configs.retry_policy
460
+
461
+ options.apply_defaults timeout: @config.timeout,
462
+ metadata: @config.metadata,
463
+ retry_policy: @config.retry_policy
464
+
465
+ @cmek_config_service_stub.list_cmek_configs request, options do |result, operation|
466
+ yield result, operation if block_given?
467
+ end
468
+ rescue ::Gapic::Rest::Error => e
469
+ raise ::Google::Cloud::Error.from_error(e)
470
+ end
471
+
472
+ ##
473
+ # De-provisions a CmekConfig.
474
+ #
475
+ # @overload delete_cmek_config(request, options = nil)
476
+ # Pass arguments to `delete_cmek_config` via a request object, either of type
477
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest} or an equivalent Hash.
478
+ #
479
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Hash]
480
+ # A request object representing the call parameters. Required. To specify no
481
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
482
+ # @param options [::Gapic::CallOptions, ::Hash]
483
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
484
+ #
485
+ # @overload delete_cmek_config(name: nil)
486
+ # Pass arguments to `delete_cmek_config` via keyword arguments. Note that at
487
+ # least one keyword argument is required. To specify no parameters, or to keep all
488
+ # the default parameter values, pass an empty Hash as a request object (see above).
489
+ #
490
+ # @param name [::String]
491
+ # Required. The resource name of the
492
+ # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as
493
+ # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`.
494
+ # @yield [result, operation] Access the result along with the TransportOperation object
495
+ # @yieldparam result [::Gapic::Operation]
496
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
497
+ #
498
+ # @return [::Gapic::Operation]
499
+ #
500
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
501
+ #
502
+ # @example Basic example
503
+ # require "google/cloud/discovery_engine/v1"
504
+ #
505
+ # # Create a client object. The client can be reused for multiple calls.
506
+ # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
507
+ #
508
+ # # Create a request. To set request fields, pass in keyword arguments.
509
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new
510
+ #
511
+ # # Call the delete_cmek_config method.
512
+ # result = client.delete_cmek_config request
513
+ #
514
+ # # The returned object is of type Gapic::Operation. You can use it to
515
+ # # check the status of an operation, cancel it, or wait for results.
516
+ # # Here is how to wait for a response.
517
+ # result.wait_until_done! timeout: 60
518
+ # if result.response?
519
+ # p result.response
520
+ # else
521
+ # puts "No response received."
522
+ # end
523
+ #
524
+ def delete_cmek_config request, options = nil
525
+ raise ::ArgumentError, "request must be provided" if request.nil?
526
+
527
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest
528
+
529
+ # Converts hash and nil to an options object
530
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
531
+
532
+ # Customize the options with defaults
533
+ call_metadata = @config.rpcs.delete_cmek_config.metadata.to_h
534
+
535
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
536
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
537
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
538
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION,
539
+ transports_version_send: [:rest]
540
+
541
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
542
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
543
+
544
+ options.apply_defaults timeout: @config.rpcs.delete_cmek_config.timeout,
545
+ metadata: call_metadata,
546
+ retry_policy: @config.rpcs.delete_cmek_config.retry_policy
547
+
548
+ options.apply_defaults timeout: @config.timeout,
549
+ metadata: @config.metadata,
550
+ retry_policy: @config.retry_policy
551
+
552
+ @cmek_config_service_stub.delete_cmek_config request, options do |result, operation|
553
+ result = ::Gapic::Operation.new result, @operations_client, options: options
554
+ yield result, operation if block_given?
555
+ throw :response, result
556
+ end
557
+ rescue ::Gapic::Rest::Error => e
558
+ raise ::Google::Cloud::Error.from_error(e)
559
+ end
560
+
561
+ ##
562
+ # Configuration class for the CmekConfigService REST API.
563
+ #
564
+ # This class represents the configuration for CmekConfigService REST,
565
+ # providing control over timeouts, retry behavior, logging, transport
566
+ # parameters, and other low-level controls. Certain parameters can also be
567
+ # applied individually to specific RPCs. See
568
+ # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration::Rpcs}
569
+ # for a list of RPCs that can be configured independently.
570
+ #
571
+ # Configuration can be applied globally to all clients, or to a single client
572
+ # on construction.
573
+ #
574
+ # @example
575
+ #
576
+ # # Modify the global config, setting the timeout for
577
+ # # update_cmek_config to 20 seconds,
578
+ # # and all remaining timeouts to 10 seconds.
579
+ # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.configure do |config|
580
+ # config.timeout = 10.0
581
+ # config.rpcs.update_cmek_config.timeout = 20.0
582
+ # end
583
+ #
584
+ # # Apply the above configuration only to a new client.
585
+ # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config|
586
+ # config.timeout = 10.0
587
+ # config.rpcs.update_cmek_config.timeout = 20.0
588
+ # end
589
+ #
590
+ # @!attribute [rw] endpoint
591
+ # A custom service endpoint, as a hostname or hostname:port. The default is
592
+ # nil, indicating to use the default endpoint in the current universe domain.
593
+ # @return [::String,nil]
594
+ # @!attribute [rw] credentials
595
+ # Credentials to send with calls. You may provide any of the following types:
596
+ # * (`String`) The path to a service account key file in JSON format
597
+ # * (`Hash`) A service account key as a Hash
598
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
599
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
600
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
601
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
602
+ # * (`nil`) indicating no credentials
603
+ #
604
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
605
+ # external source for authentication to Google Cloud, you must validate it before
606
+ # providing it to a Google API client library. Providing an unvalidated credential
607
+ # configuration to Google APIs can compromise the security of your systems and data.
608
+ # For more information, refer to [Validate credential configurations from external
609
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
610
+ # @return [::Object]
611
+ # @!attribute [rw] scope
612
+ # The OAuth scopes
613
+ # @return [::Array<::String>]
614
+ # @!attribute [rw] lib_name
615
+ # The library name as recorded in instrumentation and logging
616
+ # @return [::String]
617
+ # @!attribute [rw] lib_version
618
+ # The library version as recorded in instrumentation and logging
619
+ # @return [::String]
620
+ # @!attribute [rw] timeout
621
+ # The call timeout in seconds.
622
+ # @return [::Numeric]
623
+ # @!attribute [rw] metadata
624
+ # Additional headers to be sent with the call.
625
+ # @return [::Hash{::Symbol=>::String}]
626
+ # @!attribute [rw] retry_policy
627
+ # The retry policy. The value is a hash with the following keys:
628
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
629
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
630
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
631
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
632
+ # trigger a retry.
633
+ # @return [::Hash]
634
+ # @!attribute [rw] quota_project
635
+ # A separate project against which to charge quota.
636
+ # @return [::String]
637
+ # @!attribute [rw] universe_domain
638
+ # The universe domain within which to make requests. This determines the
639
+ # default endpoint URL. The default value of nil uses the environment
640
+ # universe (usually the default "googleapis.com" universe).
641
+ # @return [::String,nil]
642
+ # @!attribute [rw] logger
643
+ # A custom logger to use for request/response debug logging, or the value
644
+ # `:default` (the default) to construct a default logger, or `nil` to
645
+ # explicitly disable logging.
646
+ # @return [::Logger,:default,nil]
647
+ #
648
+ class Configuration
649
+ extend ::Gapic::Config
650
+
651
+ # @private
652
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
653
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
654
+
655
+ config_attr :endpoint, nil, ::String, nil
656
+ config_attr :credentials, nil do |value|
657
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
658
+ allowed.any? { |klass| klass === value }
659
+ end
660
+ config_attr :scope, nil, ::String, ::Array, nil
661
+ config_attr :lib_name, nil, ::String, nil
662
+ config_attr :lib_version, nil, ::String, nil
663
+ config_attr :timeout, nil, ::Numeric, nil
664
+ config_attr :metadata, nil, ::Hash, nil
665
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
666
+ config_attr :quota_project, nil, ::String, nil
667
+ config_attr :universe_domain, nil, ::String, nil
668
+ config_attr :logger, :default, ::Logger, nil, :default
669
+
670
+ # @private
671
+ def initialize parent_config = nil
672
+ @parent_config = parent_config unless parent_config.nil?
673
+
674
+ yield self if block_given?
675
+ end
676
+
677
+ ##
678
+ # Configurations for individual RPCs
679
+ # @return [Rpcs]
680
+ #
681
+ def rpcs
682
+ @rpcs ||= begin
683
+ parent_rpcs = nil
684
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
685
+ Rpcs.new parent_rpcs
686
+ end
687
+ end
688
+
689
+ ##
690
+ # Configuration RPC class for the CmekConfigService API.
691
+ #
692
+ # Includes fields providing the configuration for each RPC in this service.
693
+ # Each configuration object is of type `Gapic::Config::Method` and includes
694
+ # the following configuration fields:
695
+ #
696
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
697
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
698
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
699
+ # include the following keys:
700
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
701
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
702
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
703
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
704
+ # trigger a retry.
705
+ #
706
+ class Rpcs
707
+ ##
708
+ # RPC-specific configuration for `update_cmek_config`
709
+ # @return [::Gapic::Config::Method]
710
+ #
711
+ attr_reader :update_cmek_config
712
+ ##
713
+ # RPC-specific configuration for `get_cmek_config`
714
+ # @return [::Gapic::Config::Method]
715
+ #
716
+ attr_reader :get_cmek_config
717
+ ##
718
+ # RPC-specific configuration for `list_cmek_configs`
719
+ # @return [::Gapic::Config::Method]
720
+ #
721
+ attr_reader :list_cmek_configs
722
+ ##
723
+ # RPC-specific configuration for `delete_cmek_config`
724
+ # @return [::Gapic::Config::Method]
725
+ #
726
+ attr_reader :delete_cmek_config
727
+
728
+ # @private
729
+ def initialize parent_rpcs = nil
730
+ update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config
731
+ @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config
732
+ get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config
733
+ @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config
734
+ list_cmek_configs_config = parent_rpcs.list_cmek_configs if parent_rpcs.respond_to? :list_cmek_configs
735
+ @list_cmek_configs = ::Gapic::Config::Method.new list_cmek_configs_config
736
+ delete_cmek_config_config = parent_rpcs.delete_cmek_config if parent_rpcs.respond_to? :delete_cmek_config
737
+ @delete_cmek_config = ::Gapic::Config::Method.new delete_cmek_config_config
738
+
739
+ yield self if block_given?
740
+ end
741
+ end
742
+ end
743
+ end
744
+ end
745
+ end
746
+ end
747
+ end
748
+ end
749
+ end