google-cloud-chronicle-v1 0.a → 0.1.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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/chronicle/v1/data_access_control_pb.rb +67 -0
  6. data/lib/google/cloud/chronicle/v1/data_access_control_service/client.rb +1414 -0
  7. data/lib/google/cloud/chronicle/v1/data_access_control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/chronicle/v1/data_access_control_service/paths.rb +94 -0
  9. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/client.rb +1318 -0
  10. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/service_stub.rb +695 -0
  11. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest.rb +53 -0
  12. data/lib/google/cloud/chronicle/v1/data_access_control_service.rb +56 -0
  13. data/lib/google/cloud/chronicle/v1/data_access_control_services_pb.rb +76 -0
  14. data/lib/google/cloud/chronicle/v1/entity_pb.rb +62 -0
  15. data/lib/google/cloud/chronicle/v1/entity_service/client.rb +891 -0
  16. data/lib/google/cloud/chronicle/v1/entity_service/credentials.rb +47 -0
  17. data/lib/google/cloud/chronicle/v1/entity_service/paths.rb +73 -0
  18. data/lib/google/cloud/chronicle/v1/entity_service/rest/client.rb +830 -0
  19. data/lib/google/cloud/chronicle/v1/entity_service/rest/service_stub.rb +388 -0
  20. data/lib/google/cloud/chronicle/v1/entity_service/rest.rb +52 -0
  21. data/lib/google/cloud/chronicle/v1/entity_service.rb +55 -0
  22. data/lib/google/cloud/chronicle/v1/entity_services_pb.rb +54 -0
  23. data/lib/google/cloud/chronicle/v1/instance_pb.rb +48 -0
  24. data/lib/google/cloud/chronicle/v1/instance_service/client.rb +464 -0
  25. data/lib/google/cloud/chronicle/v1/instance_service/credentials.rb +47 -0
  26. data/lib/google/cloud/chronicle/v1/instance_service/paths.rb +52 -0
  27. data/lib/google/cloud/chronicle/v1/instance_service/rest/client.rb +431 -0
  28. data/lib/google/cloud/chronicle/v1/instance_service/rest/service_stub.rb +142 -0
  29. data/lib/google/cloud/chronicle/v1/instance_service/rest.rb +52 -0
  30. data/lib/google/cloud/chronicle/v1/instance_service.rb +55 -0
  31. data/lib/google/cloud/chronicle/v1/instance_services_pb.rb +45 -0
  32. data/lib/google/cloud/chronicle/v1/reference_list_pb.rb +61 -0
  33. data/lib/google/cloud/chronicle/v1/reference_list_service/client.rb +792 -0
  34. data/lib/google/cloud/chronicle/v1/reference_list_service/credentials.rb +47 -0
  35. data/lib/google/cloud/chronicle/v1/reference_list_service/paths.rb +73 -0
  36. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/client.rb +738 -0
  37. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/service_stub.rb +327 -0
  38. data/lib/google/cloud/chronicle/v1/reference_list_service/rest.rb +52 -0
  39. data/lib/google/cloud/chronicle/v1/reference_list_service.rb +55 -0
  40. data/lib/google/cloud/chronicle/v1/reference_list_services_pb.rb +51 -0
  41. data/lib/google/cloud/chronicle/v1/rest.rb +41 -0
  42. data/lib/google/cloud/chronicle/v1/rule_pb.rb +85 -0
  43. data/lib/google/cloud/chronicle/v1/rule_service/client.rb +1674 -0
  44. data/lib/google/cloud/chronicle/v1/rule_service/credentials.rb +47 -0
  45. data/lib/google/cloud/chronicle/v1/rule_service/operations.rb +813 -0
  46. data/lib/google/cloud/chronicle/v1/rule_service/paths.rb +159 -0
  47. data/lib/google/cloud/chronicle/v1/rule_service/rest/client.rb +1564 -0
  48. data/lib/google/cloud/chronicle/v1/rule_service/rest/operations.rb +914 -0
  49. data/lib/google/cloud/chronicle/v1/rule_service/rest/service_stub.rb +817 -0
  50. data/lib/google/cloud/chronicle/v1/rule_service/rest.rb +53 -0
  51. data/lib/google/cloud/chronicle/v1/rule_service.rb +56 -0
  52. data/lib/google/cloud/chronicle/v1/rule_services_pb.rb +70 -0
  53. data/lib/google/cloud/chronicle/v1/version.rb +7 -2
  54. data/lib/google/cloud/chronicle/v1.rb +49 -0
  55. data/lib/google-cloud-chronicle-v1.rb +21 -0
  56. data/proto_docs/README.md +4 -0
  57. data/proto_docs/google/api/client.rb +473 -0
  58. data/proto_docs/google/api/field_behavior.rb +85 -0
  59. data/proto_docs/google/api/launch_stage.rb +71 -0
  60. data/proto_docs/google/api/resource.rb +227 -0
  61. data/proto_docs/google/cloud/chronicle/v1/data_access_control.rb +364 -0
  62. data/proto_docs/google/cloud/chronicle/v1/entity.rb +210 -0
  63. data/proto_docs/google/cloud/chronicle/v1/instance.rb +47 -0
  64. data/proto_docs/google/cloud/chronicle/v1/reference_list.rb +232 -0
  65. data/proto_docs/google/cloud/chronicle/v1/rule.rb +701 -0
  66. data/proto_docs/google/longrunning/operations.rb +173 -0
  67. data/proto_docs/google/protobuf/any.rb +145 -0
  68. data/proto_docs/google/protobuf/duration.rb +98 -0
  69. data/proto_docs/google/protobuf/empty.rb +34 -0
  70. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  71. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  72. data/proto_docs/google/rpc/status.rb +48 -0
  73. data/proto_docs/google/type/interval.rb +45 -0
  74. metadata +110 -10
@@ -0,0 +1,738 @@
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/chronicle/v1/reference_list_pb"
21
+ require "google/cloud/chronicle/v1/reference_list_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Chronicle
26
+ module V1
27
+ module ReferenceListService
28
+ module Rest
29
+ ##
30
+ # REST client for the ReferenceListService service.
31
+ #
32
+ # ReferenceListService provides an interface for managing reference lists.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :reference_list_service_stub
45
+
46
+ ##
47
+ # Configure the ReferenceListService Client class.
48
+ #
49
+ # See {::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all ReferenceListService clients
55
+ # ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Chronicle", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.get_reference_list.timeout = 60.0
76
+ default_config.rpcs.get_reference_list.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.list_reference_lists.timeout = 60.0
81
+ default_config.rpcs.list_reference_lists.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.create_reference_list.timeout = 60.0
86
+
87
+ default_config.rpcs.update_reference_list.timeout = 60.0
88
+
89
+ default_config
90
+ end
91
+ yield @configure if block_given?
92
+ @configure
93
+ end
94
+
95
+ ##
96
+ # Configure the ReferenceListService Client instance.
97
+ #
98
+ # The configuration is set to the derived mode, meaning that values can be changed,
99
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
100
+ # should be made on {Client.configure}.
101
+ #
102
+ # See {::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client::Configuration}
103
+ # for a description of the configuration fields.
104
+ #
105
+ # @yield [config] Configure the Client client.
106
+ # @yieldparam config [Client::Configuration]
107
+ #
108
+ # @return [Client::Configuration]
109
+ #
110
+ def configure
111
+ yield @config if block_given?
112
+ @config
113
+ end
114
+
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @reference_list_service_stub.universe_domain
122
+ end
123
+
124
+ ##
125
+ # Create a new ReferenceListService REST client object.
126
+ #
127
+ # @example
128
+ #
129
+ # # Create a client using the default configuration
130
+ # client = ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new
131
+ #
132
+ # # Create a client using a custom configuration
133
+ # client = ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new do |config|
134
+ # config.timeout = 10.0
135
+ # end
136
+ #
137
+ # @yield [config] Configure the ReferenceListService client.
138
+ # @yieldparam config [Client::Configuration]
139
+ #
140
+ def initialize
141
+ # Create the configuration object
142
+ @config = Configuration.new Client.configure
143
+
144
+ # Yield the configuration if needed
145
+ yield @config if block_given?
146
+
147
+ # Create credentials
148
+ credentials = @config.credentials
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
+ # but only if the default endpoint does not have a region prefix.
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
154
+ credentials ||= Credentials.default scope: @config.scope,
155
+ enable_self_signed_jwt: enable_self_signed_jwt
156
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
157
+ credentials = Credentials.new credentials, scope: @config.scope
158
+ end
159
+
160
+ @quota_project_id = @config.quota_project
161
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
162
+
163
+ @reference_list_service_stub = ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::ServiceStub.new(
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ credentials: credentials,
168
+ logger: @config.logger
169
+ )
170
+
171
+ @reference_list_service_stub.logger(stub: true)&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+ end
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @reference_list_service_stub.logger
189
+ end
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Gets a single reference list.
195
+ #
196
+ # @overload get_reference_list(request, options = nil)
197
+ # Pass arguments to `get_reference_list` via a request object, either of type
198
+ # {::Google::Cloud::Chronicle::V1::GetReferenceListRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::Chronicle::V1::GetReferenceListRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
205
+ #
206
+ # @overload get_reference_list(name: nil, view: nil)
207
+ # Pass arguments to `get_reference_list` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param name [::String]
212
+ # Required. The resource name of the reference list to retrieve.
213
+ # Format:
214
+ # `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
215
+ # @param view [::Google::Cloud::Chronicle::V1::ReferenceListView]
216
+ # How much of the ReferenceList to view. Defaults to
217
+ # REFERENCE_LIST_VIEW_FULL.
218
+ # @yield [result, operation] Access the result along with the TransportOperation object
219
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::ReferenceList]
220
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
221
+ #
222
+ # @return [::Google::Cloud::Chronicle::V1::ReferenceList]
223
+ #
224
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
225
+ #
226
+ # @example Basic example
227
+ # require "google/cloud/chronicle/v1"
228
+ #
229
+ # # Create a client object. The client can be reused for multiple calls.
230
+ # client = Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new
231
+ #
232
+ # # Create a request. To set request fields, pass in keyword arguments.
233
+ # request = Google::Cloud::Chronicle::V1::GetReferenceListRequest.new
234
+ #
235
+ # # Call the get_reference_list method.
236
+ # result = client.get_reference_list request
237
+ #
238
+ # # The returned object is of type Google::Cloud::Chronicle::V1::ReferenceList.
239
+ # p result
240
+ #
241
+ def get_reference_list request, options = nil
242
+ raise ::ArgumentError, "request must be provided" if request.nil?
243
+
244
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetReferenceListRequest
245
+
246
+ # Converts hash and nil to an options object
247
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
248
+
249
+ # Customize the options with defaults
250
+ call_metadata = @config.rpcs.get_reference_list.metadata.to_h
251
+
252
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
253
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
254
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
255
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
256
+ transports_version_send: [:rest]
257
+
258
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
259
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
260
+
261
+ options.apply_defaults timeout: @config.rpcs.get_reference_list.timeout,
262
+ metadata: call_metadata,
263
+ retry_policy: @config.rpcs.get_reference_list.retry_policy
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
267
+ retry_policy: @config.retry_policy
268
+
269
+ @reference_list_service_stub.get_reference_list request, options do |result, operation|
270
+ yield result, operation if block_given?
271
+ end
272
+ rescue ::Gapic::Rest::Error => e
273
+ raise ::Google::Cloud::Error.from_error(e)
274
+ end
275
+
276
+ ##
277
+ # Lists a collection of reference lists.
278
+ #
279
+ # @overload list_reference_lists(request, options = nil)
280
+ # Pass arguments to `list_reference_lists` via a request object, either of type
281
+ # {::Google::Cloud::Chronicle::V1::ListReferenceListsRequest} or an equivalent Hash.
282
+ #
283
+ # @param request [::Google::Cloud::Chronicle::V1::ListReferenceListsRequest, ::Hash]
284
+ # A request object representing the call parameters. Required. To specify no
285
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
286
+ # @param options [::Gapic::CallOptions, ::Hash]
287
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
288
+ #
289
+ # @overload list_reference_lists(parent: nil, page_size: nil, page_token: nil, view: nil)
290
+ # Pass arguments to `list_reference_lists` via keyword arguments. Note that at
291
+ # least one keyword argument is required. To specify no parameters, or to keep all
292
+ # the default parameter values, pass an empty Hash as a request object (see above).
293
+ #
294
+ # @param parent [::String]
295
+ # Required. The parent, which owns this collection of reference lists.
296
+ # Format:
297
+ # `projects/{project}/locations/{location}/instances/{instance}`
298
+ # @param page_size [::Integer]
299
+ # The maximum number of reference lists to return.
300
+ # The service may return fewer than this value.
301
+ # If unspecified, at most 100 reference lists will be returned.
302
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
303
+ # @param page_token [::String]
304
+ # A page token, received from a previous `ListReferenceLists` call.
305
+ # Provide this to retrieve the subsequent page.
306
+ # When paginating, all other parameters provided to `ListReferenceLists` must
307
+ # match the call that provided the page token.
308
+ # @param view [::Google::Cloud::Chronicle::V1::ReferenceListView]
309
+ # How much of each ReferenceList to view. Defaults to
310
+ # REFERENCE_LIST_VIEW_BASIC.
311
+ # @yield [result, operation] Access the result along with the TransportOperation object
312
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::ReferenceList>]
313
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
314
+ #
315
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::ReferenceList>]
316
+ #
317
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/cloud/chronicle/v1"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::Chronicle::V1::ListReferenceListsRequest.new
327
+ #
328
+ # # Call the list_reference_lists method.
329
+ # result = client.list_reference_lists request
330
+ #
331
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
332
+ # # over elements, and API calls will be issued to fetch pages as needed.
333
+ # result.each do |item|
334
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::ReferenceList.
335
+ # p item
336
+ # end
337
+ #
338
+ def list_reference_lists request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListReferenceListsRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ call_metadata = @config.rpcs.list_reference_lists.metadata.to_h
348
+
349
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
350
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
353
+ transports_version_send: [:rest]
354
+
355
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
356
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ options.apply_defaults timeout: @config.rpcs.list_reference_lists.timeout,
359
+ metadata: call_metadata,
360
+ retry_policy: @config.rpcs.list_reference_lists.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @reference_list_service_stub.list_reference_lists request, options do |result, operation|
367
+ result = ::Gapic::Rest::PagedEnumerable.new @reference_list_service_stub, :list_reference_lists, "reference_lists", request, result, options
368
+ yield result, operation if block_given?
369
+ throw :response, result
370
+ end
371
+ rescue ::Gapic::Rest::Error => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Creates a new reference list.
377
+ #
378
+ # @overload create_reference_list(request, options = nil)
379
+ # Pass arguments to `create_reference_list` via a request object, either of type
380
+ # {::Google::Cloud::Chronicle::V1::CreateReferenceListRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::Chronicle::V1::CreateReferenceListRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ #
388
+ # @overload create_reference_list(parent: nil, reference_list: nil, reference_list_id: nil)
389
+ # Pass arguments to `create_reference_list` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param parent [::String]
394
+ # Required. The parent resource where this reference list will be created.
395
+ # Format: `projects/{project}/locations/{location}/instances/{instance}`
396
+ # @param reference_list [::Google::Cloud::Chronicle::V1::ReferenceList, ::Hash]
397
+ # Required. The reference list to create.
398
+ # @param reference_list_id [::String]
399
+ # Required. The ID to use for the reference list. This is also the display
400
+ # name for the reference list. It must satisfy the following requirements:
401
+ # - Starts with letter.
402
+ # - Contains only letters, numbers and underscore.
403
+ # - Has length less than 256.
404
+ # - Must be unique.
405
+ # @yield [result, operation] Access the result along with the TransportOperation object
406
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::ReferenceList]
407
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
408
+ #
409
+ # @return [::Google::Cloud::Chronicle::V1::ReferenceList]
410
+ #
411
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
412
+ #
413
+ # @example Basic example
414
+ # require "google/cloud/chronicle/v1"
415
+ #
416
+ # # Create a client object. The client can be reused for multiple calls.
417
+ # client = Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new
418
+ #
419
+ # # Create a request. To set request fields, pass in keyword arguments.
420
+ # request = Google::Cloud::Chronicle::V1::CreateReferenceListRequest.new
421
+ #
422
+ # # Call the create_reference_list method.
423
+ # result = client.create_reference_list request
424
+ #
425
+ # # The returned object is of type Google::Cloud::Chronicle::V1::ReferenceList.
426
+ # p result
427
+ #
428
+ def create_reference_list request, options = nil
429
+ raise ::ArgumentError, "request must be provided" if request.nil?
430
+
431
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateReferenceListRequest
432
+
433
+ # Converts hash and nil to an options object
434
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
435
+
436
+ # Customize the options with defaults
437
+ call_metadata = @config.rpcs.create_reference_list.metadata.to_h
438
+
439
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
440
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
441
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
442
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
443
+ transports_version_send: [:rest]
444
+
445
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
446
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
447
+
448
+ options.apply_defaults timeout: @config.rpcs.create_reference_list.timeout,
449
+ metadata: call_metadata,
450
+ retry_policy: @config.rpcs.create_reference_list.retry_policy
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @reference_list_service_stub.create_reference_list request, options do |result, operation|
457
+ yield result, operation if block_given?
458
+ end
459
+ rescue ::Gapic::Rest::Error => e
460
+ raise ::Google::Cloud::Error.from_error(e)
461
+ end
462
+
463
+ ##
464
+ # Updates an existing reference list.
465
+ #
466
+ # @overload update_reference_list(request, options = nil)
467
+ # Pass arguments to `update_reference_list` via a request object, either of type
468
+ # {::Google::Cloud::Chronicle::V1::UpdateReferenceListRequest} or an equivalent Hash.
469
+ #
470
+ # @param request [::Google::Cloud::Chronicle::V1::UpdateReferenceListRequest, ::Hash]
471
+ # A request object representing the call parameters. Required. To specify no
472
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
473
+ # @param options [::Gapic::CallOptions, ::Hash]
474
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
475
+ #
476
+ # @overload update_reference_list(reference_list: nil, update_mask: nil)
477
+ # Pass arguments to `update_reference_list` via keyword arguments. Note that at
478
+ # least one keyword argument is required. To specify no parameters, or to keep all
479
+ # the default parameter values, pass an empty Hash as a request object (see above).
480
+ #
481
+ # @param reference_list [::Google::Cloud::Chronicle::V1::ReferenceList, ::Hash]
482
+ # Required. The reference list to update.
483
+ #
484
+ # The reference list's `name` field is used to identify the reference list to
485
+ # update.
486
+ # Format:
487
+ # `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
488
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
489
+ # The list of fields to update.
490
+ # When no field mask is supplied, all non-empty fields will be updated.
491
+ # A field mask of "*" will update all fields, whether empty or not.
492
+ # @yield [result, operation] Access the result along with the TransportOperation object
493
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::ReferenceList]
494
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
495
+ #
496
+ # @return [::Google::Cloud::Chronicle::V1::ReferenceList]
497
+ #
498
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
499
+ #
500
+ # @example Basic example
501
+ # require "google/cloud/chronicle/v1"
502
+ #
503
+ # # Create a client object. The client can be reused for multiple calls.
504
+ # client = Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new
505
+ #
506
+ # # Create a request. To set request fields, pass in keyword arguments.
507
+ # request = Google::Cloud::Chronicle::V1::UpdateReferenceListRequest.new
508
+ #
509
+ # # Call the update_reference_list method.
510
+ # result = client.update_reference_list request
511
+ #
512
+ # # The returned object is of type Google::Cloud::Chronicle::V1::ReferenceList.
513
+ # p result
514
+ #
515
+ def update_reference_list request, options = nil
516
+ raise ::ArgumentError, "request must be provided" if request.nil?
517
+
518
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateReferenceListRequest
519
+
520
+ # Converts hash and nil to an options object
521
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
522
+
523
+ # Customize the options with defaults
524
+ call_metadata = @config.rpcs.update_reference_list.metadata.to_h
525
+
526
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
527
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
528
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
529
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
530
+ transports_version_send: [:rest]
531
+
532
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
533
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
534
+
535
+ options.apply_defaults timeout: @config.rpcs.update_reference_list.timeout,
536
+ metadata: call_metadata,
537
+ retry_policy: @config.rpcs.update_reference_list.retry_policy
538
+
539
+ options.apply_defaults timeout: @config.timeout,
540
+ metadata: @config.metadata,
541
+ retry_policy: @config.retry_policy
542
+
543
+ @reference_list_service_stub.update_reference_list request, options do |result, operation|
544
+ yield result, operation if block_given?
545
+ end
546
+ rescue ::Gapic::Rest::Error => e
547
+ raise ::Google::Cloud::Error.from_error(e)
548
+ end
549
+
550
+ ##
551
+ # Configuration class for the ReferenceListService REST API.
552
+ #
553
+ # This class represents the configuration for ReferenceListService REST,
554
+ # providing control over timeouts, retry behavior, logging, transport
555
+ # parameters, and other low-level controls. Certain parameters can also be
556
+ # applied individually to specific RPCs. See
557
+ # {::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client::Configuration::Rpcs}
558
+ # for a list of RPCs that can be configured independently.
559
+ #
560
+ # Configuration can be applied globally to all clients, or to a single client
561
+ # on construction.
562
+ #
563
+ # @example
564
+ #
565
+ # # Modify the global config, setting the timeout for
566
+ # # get_reference_list to 20 seconds,
567
+ # # and all remaining timeouts to 10 seconds.
568
+ # ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.configure do |config|
569
+ # config.timeout = 10.0
570
+ # config.rpcs.get_reference_list.timeout = 20.0
571
+ # end
572
+ #
573
+ # # Apply the above configuration only to a new client.
574
+ # client = ::Google::Cloud::Chronicle::V1::ReferenceListService::Rest::Client.new do |config|
575
+ # config.timeout = 10.0
576
+ # config.rpcs.get_reference_list.timeout = 20.0
577
+ # end
578
+ #
579
+ # @!attribute [rw] endpoint
580
+ # A custom service endpoint, as a hostname or hostname:port. The default is
581
+ # nil, indicating to use the default endpoint in the current universe domain.
582
+ # @return [::String,nil]
583
+ # @!attribute [rw] credentials
584
+ # Credentials to send with calls. You may provide any of the following types:
585
+ # * (`String`) The path to a service account key file in JSON format
586
+ # * (`Hash`) A service account key as a Hash
587
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
588
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
589
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
590
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
591
+ # * (`nil`) indicating no credentials
592
+ #
593
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
594
+ # external source for authentication to Google Cloud, you must validate it before
595
+ # providing it to a Google API client library. Providing an unvalidated credential
596
+ # configuration to Google APIs can compromise the security of your systems and data.
597
+ # For more information, refer to [Validate credential configurations from external
598
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
599
+ # @return [::Object]
600
+ # @!attribute [rw] scope
601
+ # The OAuth scopes
602
+ # @return [::Array<::String>]
603
+ # @!attribute [rw] lib_name
604
+ # The library name as recorded in instrumentation and logging
605
+ # @return [::String]
606
+ # @!attribute [rw] lib_version
607
+ # The library version as recorded in instrumentation and logging
608
+ # @return [::String]
609
+ # @!attribute [rw] timeout
610
+ # The call timeout in seconds.
611
+ # @return [::Numeric]
612
+ # @!attribute [rw] metadata
613
+ # Additional headers to be sent with the call.
614
+ # @return [::Hash{::Symbol=>::String}]
615
+ # @!attribute [rw] retry_policy
616
+ # The retry policy. The value is a hash with the following keys:
617
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
618
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
619
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
620
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
621
+ # trigger a retry.
622
+ # @return [::Hash]
623
+ # @!attribute [rw] quota_project
624
+ # A separate project against which to charge quota.
625
+ # @return [::String]
626
+ # @!attribute [rw] universe_domain
627
+ # The universe domain within which to make requests. This determines the
628
+ # default endpoint URL. The default value of nil uses the environment
629
+ # universe (usually the default "googleapis.com" universe).
630
+ # @return [::String,nil]
631
+ # @!attribute [rw] logger
632
+ # A custom logger to use for request/response debug logging, or the value
633
+ # `:default` (the default) to construct a default logger, or `nil` to
634
+ # explicitly disable logging.
635
+ # @return [::Logger,:default,nil]
636
+ #
637
+ class Configuration
638
+ extend ::Gapic::Config
639
+
640
+ # @private
641
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
642
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
643
+
644
+ config_attr :endpoint, nil, ::String, nil
645
+ config_attr :credentials, nil do |value|
646
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
647
+ allowed.any? { |klass| klass === value }
648
+ end
649
+ config_attr :scope, nil, ::String, ::Array, nil
650
+ config_attr :lib_name, nil, ::String, nil
651
+ config_attr :lib_version, nil, ::String, nil
652
+ config_attr :timeout, nil, ::Numeric, nil
653
+ config_attr :metadata, nil, ::Hash, nil
654
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
655
+ config_attr :quota_project, nil, ::String, nil
656
+ config_attr :universe_domain, nil, ::String, nil
657
+ config_attr :logger, :default, ::Logger, nil, :default
658
+
659
+ # @private
660
+ def initialize parent_config = nil
661
+ @parent_config = parent_config unless parent_config.nil?
662
+
663
+ yield self if block_given?
664
+ end
665
+
666
+ ##
667
+ # Configurations for individual RPCs
668
+ # @return [Rpcs]
669
+ #
670
+ def rpcs
671
+ @rpcs ||= begin
672
+ parent_rpcs = nil
673
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
674
+ Rpcs.new parent_rpcs
675
+ end
676
+ end
677
+
678
+ ##
679
+ # Configuration RPC class for the ReferenceListService API.
680
+ #
681
+ # Includes fields providing the configuration for each RPC in this service.
682
+ # Each configuration object is of type `Gapic::Config::Method` and includes
683
+ # the following configuration fields:
684
+ #
685
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
686
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
687
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
688
+ # include the following keys:
689
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
690
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
691
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
692
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
693
+ # trigger a retry.
694
+ #
695
+ class Rpcs
696
+ ##
697
+ # RPC-specific configuration for `get_reference_list`
698
+ # @return [::Gapic::Config::Method]
699
+ #
700
+ attr_reader :get_reference_list
701
+ ##
702
+ # RPC-specific configuration for `list_reference_lists`
703
+ # @return [::Gapic::Config::Method]
704
+ #
705
+ attr_reader :list_reference_lists
706
+ ##
707
+ # RPC-specific configuration for `create_reference_list`
708
+ # @return [::Gapic::Config::Method]
709
+ #
710
+ attr_reader :create_reference_list
711
+ ##
712
+ # RPC-specific configuration for `update_reference_list`
713
+ # @return [::Gapic::Config::Method]
714
+ #
715
+ attr_reader :update_reference_list
716
+
717
+ # @private
718
+ def initialize parent_rpcs = nil
719
+ get_reference_list_config = parent_rpcs.get_reference_list if parent_rpcs.respond_to? :get_reference_list
720
+ @get_reference_list = ::Gapic::Config::Method.new get_reference_list_config
721
+ list_reference_lists_config = parent_rpcs.list_reference_lists if parent_rpcs.respond_to? :list_reference_lists
722
+ @list_reference_lists = ::Gapic::Config::Method.new list_reference_lists_config
723
+ create_reference_list_config = parent_rpcs.create_reference_list if parent_rpcs.respond_to? :create_reference_list
724
+ @create_reference_list = ::Gapic::Config::Method.new create_reference_list_config
725
+ update_reference_list_config = parent_rpcs.update_reference_list if parent_rpcs.respond_to? :update_reference_list
726
+ @update_reference_list = ::Gapic::Config::Method.new update_reference_list_config
727
+
728
+ yield self if block_given?
729
+ end
730
+ end
731
+ end
732
+ end
733
+ end
734
+ end
735
+ end
736
+ end
737
+ end
738
+ end