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