google-cloud-chronicle-v1 1.0.0 → 1.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/lib/google/cloud/chronicle/v1/data_access_control_service/client.rb +1 -1
  4. data/lib/google/cloud/chronicle/v1/data_access_control_service/credentials.rb +1 -1
  5. data/lib/google/cloud/chronicle/v1/data_access_control_service/paths.rb +1 -1
  6. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/client.rb +1 -1
  7. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest/service_stub.rb +1 -1
  8. data/lib/google/cloud/chronicle/v1/data_access_control_service/rest.rb +1 -1
  9. data/lib/google/cloud/chronicle/v1/data_access_control_service.rb +1 -1
  10. data/lib/google/cloud/chronicle/v1/entity_service/client.rb +1 -1
  11. data/lib/google/cloud/chronicle/v1/entity_service/credentials.rb +1 -1
  12. data/lib/google/cloud/chronicle/v1/entity_service/paths.rb +1 -1
  13. data/lib/google/cloud/chronicle/v1/entity_service/rest/client.rb +1 -1
  14. data/lib/google/cloud/chronicle/v1/entity_service/rest/service_stub.rb +1 -1
  15. data/lib/google/cloud/chronicle/v1/entity_service/rest.rb +1 -1
  16. data/lib/google/cloud/chronicle/v1/entity_service.rb +1 -1
  17. data/lib/google/cloud/chronicle/v1/feed_pb.rb +205 -0
  18. data/lib/google/cloud/chronicle/v1/feed_services_pb.rb +79 -0
  19. data/lib/google/cloud/chronicle/v1/feeds_service/client.rb +1827 -0
  20. data/lib/google/cloud/chronicle/v1/feeds_service/credentials.rb +49 -0
  21. data/lib/google/cloud/chronicle/v1/feeds_service/paths.rb +136 -0
  22. data/lib/google/cloud/chronicle/v1/feeds_service/rest/client.rb +1686 -0
  23. data/lib/google/cloud/chronicle/v1/feeds_service/rest/service_stub.rb +941 -0
  24. data/lib/google/cloud/chronicle/v1/feeds_service/rest.rb +52 -0
  25. data/lib/google/cloud/chronicle/v1/feeds_service.rb +55 -0
  26. data/lib/google/cloud/chronicle/v1/instance_service/client.rb +1 -1
  27. data/lib/google/cloud/chronicle/v1/instance_service/credentials.rb +1 -1
  28. data/lib/google/cloud/chronicle/v1/instance_service/paths.rb +1 -1
  29. data/lib/google/cloud/chronicle/v1/instance_service/rest/client.rb +1 -1
  30. data/lib/google/cloud/chronicle/v1/instance_service/rest/service_stub.rb +1 -1
  31. data/lib/google/cloud/chronicle/v1/instance_service/rest.rb +1 -1
  32. data/lib/google/cloud/chronicle/v1/instance_service.rb +1 -1
  33. data/lib/google/cloud/chronicle/v1/reference_list_service/client.rb +1 -1
  34. data/lib/google/cloud/chronicle/v1/reference_list_service/credentials.rb +1 -1
  35. data/lib/google/cloud/chronicle/v1/reference_list_service/paths.rb +1 -1
  36. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/client.rb +1 -1
  37. data/lib/google/cloud/chronicle/v1/reference_list_service/rest/service_stub.rb +1 -1
  38. data/lib/google/cloud/chronicle/v1/reference_list_service/rest.rb +1 -1
  39. data/lib/google/cloud/chronicle/v1/reference_list_service.rb +1 -1
  40. data/lib/google/cloud/chronicle/v1/reference_list_services_pb.rb +1 -1
  41. data/lib/google/cloud/chronicle/v1/rest.rb +2 -1
  42. data/lib/google/cloud/chronicle/v1/rule_execution_error_service/client.rb +5 -5
  43. data/lib/google/cloud/chronicle/v1/rule_execution_error_service/rest/client.rb +5 -5
  44. data/lib/google/cloud/chronicle/v1/rule_service/client.rb +1 -1
  45. data/lib/google/cloud/chronicle/v1/rule_service/credentials.rb +1 -1
  46. data/lib/google/cloud/chronicle/v1/rule_service/operations.rb +1 -1
  47. data/lib/google/cloud/chronicle/v1/rule_service/paths.rb +1 -1
  48. data/lib/google/cloud/chronicle/v1/rule_service/rest/client.rb +1 -1
  49. data/lib/google/cloud/chronicle/v1/rule_service/rest/operations.rb +1 -1
  50. data/lib/google/cloud/chronicle/v1/rule_service/rest/service_stub.rb +1 -1
  51. data/lib/google/cloud/chronicle/v1/rule_service/rest.rb +1 -1
  52. data/lib/google/cloud/chronicle/v1/rule_service.rb +1 -1
  53. data/lib/google/cloud/chronicle/v1/rule_services_pb.rb +1 -1
  54. data/lib/google/cloud/chronicle/v1/version.rb +1 -1
  55. data/lib/google/cloud/chronicle/v1.rb +2 -1
  56. data/lib/google-cloud-chronicle-v1.rb +1 -1
  57. data/proto_docs/google/api/client.rb +1 -1
  58. data/proto_docs/google/api/field_behavior.rb +1 -1
  59. data/proto_docs/google/api/field_info.rb +88 -0
  60. data/proto_docs/google/api/httpbody.rb +80 -0
  61. data/proto_docs/google/api/launch_stage.rb +1 -1
  62. data/proto_docs/google/api/resource.rb +1 -1
  63. data/proto_docs/google/cloud/chronicle/v1/data_access_control.rb +1 -1
  64. data/proto_docs/google/cloud/chronicle/v1/entity.rb +1 -1
  65. data/proto_docs/google/cloud/chronicle/v1/feed.rb +3427 -0
  66. data/proto_docs/google/cloud/chronicle/v1/instance.rb +1 -1
  67. data/proto_docs/google/cloud/chronicle/v1/reference_list.rb +1 -1
  68. data/proto_docs/google/cloud/chronicle/v1/rule.rb +1 -1
  69. data/proto_docs/google/cloud/chronicle/v1/rule_execution_error.rb +5 -5
  70. data/proto_docs/google/longrunning/operations.rb +1 -1
  71. data/proto_docs/google/protobuf/any.rb +1 -1
  72. data/proto_docs/google/protobuf/duration.rb +1 -1
  73. data/proto_docs/google/protobuf/empty.rb +1 -1
  74. data/proto_docs/google/protobuf/field_mask.rb +1 -1
  75. data/proto_docs/google/protobuf/timestamp.rb +8 -7
  76. data/proto_docs/google/rpc/status.rb +1 -1
  77. data/proto_docs/google/type/interval.rb +1 -1
  78. metadata +13 -1
@@ -0,0 +1,1686 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/feed_pb"
21
+ require "google/cloud/chronicle/v1/feeds_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Chronicle
26
+ module V1
27
+ module FeedsService
28
+ module Rest
29
+ ##
30
+ # REST client for the FeedsService service.
31
+ #
32
+ # FeedsService contains procedures for managing Chronicle third-party feeds.
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 :feeds_service_stub
45
+
46
+ ##
47
+ # Configure the FeedsService Client class.
48
+ #
49
+ # See {::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all FeedsService clients
55
+ # ::Google::Cloud::Chronicle::V1::FeedsService::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.fetch_service_account_for_customer.timeout = 60.0
76
+ default_config.rpcs.fetch_service_account_for_customer.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.create_feed.timeout = 300.0
81
+
82
+ default_config.rpcs.get_feed.timeout = 30.0
83
+ default_config.rpcs.get_feed.retry_policy = {
84
+ initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
85
+ }
86
+
87
+ default_config.rpcs.delete_feed.timeout = 300.0
88
+
89
+ default_config.rpcs.enable_feed.timeout = 300.0
90
+
91
+ default_config.rpcs.disable_feed.timeout = 300.0
92
+
93
+ default_config.rpcs.list_feeds.timeout = 300.0
94
+ default_config.rpcs.list_feeds.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 300.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.list_feed_packs.timeout = 60.0
99
+ default_config.rpcs.list_feed_packs.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.get_feed_pack.timeout = 30.0
104
+ default_config.rpcs.get_feed_pack.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.update_feed.timeout = 300.0
109
+
110
+ default_config.rpcs.list_feed_source_type_schemas.timeout = 60.0
111
+ default_config.rpcs.list_feed_source_type_schemas.retry_policy = {
112
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
113
+ }
114
+
115
+ default_config.rpcs.list_log_type_schemas.timeout = 60.0
116
+ default_config.rpcs.list_log_type_schemas.retry_policy = {
117
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
118
+ }
119
+
120
+ default_config.rpcs.import_push_logs.timeout = 120.0
121
+
122
+ default_config.rpcs.generate_secret.timeout = 60.0
123
+
124
+ default_config
125
+ end
126
+ yield @configure if block_given?
127
+ @configure
128
+ end
129
+
130
+ ##
131
+ # Configure the FeedsService Client instance.
132
+ #
133
+ # The configuration is set to the derived mode, meaning that values can be changed,
134
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
135
+ # should be made on {Client.configure}.
136
+ #
137
+ # See {::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client::Configuration}
138
+ # for a description of the configuration fields.
139
+ #
140
+ # @yield [config] Configure the Client client.
141
+ # @yieldparam config [Client::Configuration]
142
+ #
143
+ # @return [Client::Configuration]
144
+ #
145
+ def configure
146
+ yield @config if block_given?
147
+ @config
148
+ end
149
+
150
+ ##
151
+ # The effective universe domain
152
+ #
153
+ # @return [String]
154
+ #
155
+ def universe_domain
156
+ @feeds_service_stub.universe_domain
157
+ end
158
+
159
+ ##
160
+ # Create a new FeedsService REST client object.
161
+ #
162
+ # @example
163
+ #
164
+ # # Create a client using the default configuration
165
+ # client = ::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
166
+ #
167
+ # # Create a client using a custom configuration
168
+ # client = ::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new do |config|
169
+ # config.timeout = 10.0
170
+ # end
171
+ #
172
+ # @yield [config] Configure the FeedsService client.
173
+ # @yieldparam config [Client::Configuration]
174
+ #
175
+ def initialize
176
+ # Create the configuration object
177
+ @config = Configuration.new Client.configure
178
+
179
+ # Yield the configuration if needed
180
+ yield @config if block_given?
181
+
182
+ # Create credentials
183
+ credentials = @config.credentials
184
+ # Use self-signed JWT if the endpoint is unchanged from default,
185
+ # but only if the default endpoint does not have a region prefix.
186
+ enable_self_signed_jwt = @config.endpoint.nil? ||
187
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
188
+ !@config.endpoint.split(".").first.include?("-"))
189
+ credentials ||= Credentials.default scope: @config.scope,
190
+ enable_self_signed_jwt: enable_self_signed_jwt
191
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
192
+ credentials = Credentials.new credentials, scope: @config.scope
193
+ end
194
+
195
+ @quota_project_id = @config.quota_project
196
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
197
+
198
+ @feeds_service_stub = ::Google::Cloud::Chronicle::V1::FeedsService::Rest::ServiceStub.new(
199
+ endpoint: @config.endpoint,
200
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
201
+ universe_domain: @config.universe_domain,
202
+ credentials: credentials,
203
+ logger: @config.logger
204
+ )
205
+
206
+ @feeds_service_stub.logger(stub: true)&.info do |entry|
207
+ entry.set_system_name
208
+ entry.set_service
209
+ entry.message = "Created client for #{entry.service}"
210
+ entry.set_credentials_fields credentials
211
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
212
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
213
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
214
+ end
215
+ end
216
+
217
+ ##
218
+ # The logger used for request/response debug logging.
219
+ #
220
+ # @return [Logger]
221
+ #
222
+ def logger
223
+ @feeds_service_stub.logger
224
+ end
225
+
226
+ # Service calls
227
+
228
+ ##
229
+ # Fetch Chronicle's service account used for ingesting data from Cloud
230
+ # Storage buckets.
231
+ #
232
+ # @overload fetch_service_account_for_customer(request, options = nil)
233
+ # Pass arguments to `fetch_service_account_for_customer` via a request object, either of type
234
+ # {::Google::Cloud::Chronicle::V1::FetchServiceAccountForCustomerRequest} or an equivalent Hash.
235
+ #
236
+ # @param request [::Google::Cloud::Chronicle::V1::FetchServiceAccountForCustomerRequest, ::Hash]
237
+ # A request object representing the call parameters. Required. To specify no
238
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
239
+ # @param options [::Gapic::CallOptions, ::Hash]
240
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
241
+ #
242
+ # @overload fetch_service_account_for_customer(parent: nil)
243
+ # Pass arguments to `fetch_service_account_for_customer` via keyword arguments. Note that at
244
+ # least one keyword argument is required. To specify no parameters, or to keep all
245
+ # the default parameter values, pass an empty Hash as a request object (see above).
246
+ #
247
+ # @param parent [::String]
248
+ # Required. The parent resource where this FeedServiceAccount will be
249
+ # created. Format:
250
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}
251
+ # @yield [result, operation] Access the result along with the TransportOperation object
252
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::FeedServiceAccount]
253
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
254
+ #
255
+ # @return [::Google::Cloud::Chronicle::V1::FeedServiceAccount]
256
+ #
257
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
258
+ #
259
+ # @example Basic example
260
+ # require "google/cloud/chronicle/v1"
261
+ #
262
+ # # Create a client object. The client can be reused for multiple calls.
263
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
264
+ #
265
+ # # Create a request. To set request fields, pass in keyword arguments.
266
+ # request = Google::Cloud::Chronicle::V1::FetchServiceAccountForCustomerRequest.new
267
+ #
268
+ # # Call the fetch_service_account_for_customer method.
269
+ # result = client.fetch_service_account_for_customer request
270
+ #
271
+ # # The returned object is of type Google::Cloud::Chronicle::V1::FeedServiceAccount.
272
+ # p result
273
+ #
274
+ def fetch_service_account_for_customer request, options = nil
275
+ raise ::ArgumentError, "request must be provided" if request.nil?
276
+
277
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::FetchServiceAccountForCustomerRequest
278
+
279
+ # Converts hash and nil to an options object
280
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
281
+
282
+ # Customize the options with defaults
283
+ call_metadata = @config.rpcs.fetch_service_account_for_customer.metadata.to_h
284
+
285
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
286
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
287
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
288
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
289
+ transports_version_send: [:rest]
290
+
291
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
292
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ options.apply_defaults timeout: @config.rpcs.fetch_service_account_for_customer.timeout,
295
+ metadata: call_metadata,
296
+ retry_policy: @config.rpcs.fetch_service_account_for_customer.retry_policy
297
+
298
+ options.apply_defaults timeout: @config.timeout,
299
+ metadata: @config.metadata,
300
+ retry_policy: @config.retry_policy
301
+
302
+ @feeds_service_stub.fetch_service_account_for_customer request, options do |result, operation|
303
+ yield result, operation if block_given?
304
+ end
305
+ rescue ::Gapic::Rest::Error => e
306
+ raise ::Google::Cloud::Error.from_error(e)
307
+ end
308
+
309
+ ##
310
+ # Creates a feed.
311
+ #
312
+ # @overload create_feed(request, options = nil)
313
+ # Pass arguments to `create_feed` via a request object, either of type
314
+ # {::Google::Cloud::Chronicle::V1::CreateFeedRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::Chronicle::V1::CreateFeedRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
321
+ #
322
+ # @overload create_feed(parent: nil, feed: nil)
323
+ # Pass arguments to `create_feed` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param parent [::String]
328
+ # Required. The parent resource where this Feed will be created.
329
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
330
+ # @param feed [::Google::Cloud::Chronicle::V1::Feed, ::Hash]
331
+ # Required. Feed to create.
332
+ # @yield [result, operation] Access the result along with the TransportOperation object
333
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Feed]
334
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
335
+ #
336
+ # @return [::Google::Cloud::Chronicle::V1::Feed]
337
+ #
338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
339
+ #
340
+ # @example Basic example
341
+ # require "google/cloud/chronicle/v1"
342
+ #
343
+ # # Create a client object. The client can be reused for multiple calls.
344
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
345
+ #
346
+ # # Create a request. To set request fields, pass in keyword arguments.
347
+ # request = Google::Cloud::Chronicle::V1::CreateFeedRequest.new
348
+ #
349
+ # # Call the create_feed method.
350
+ # result = client.create_feed request
351
+ #
352
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Feed.
353
+ # p result
354
+ #
355
+ def create_feed request, options = nil
356
+ raise ::ArgumentError, "request must be provided" if request.nil?
357
+
358
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::CreateFeedRequest
359
+
360
+ # Converts hash and nil to an options object
361
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
362
+
363
+ # Customize the options with defaults
364
+ call_metadata = @config.rpcs.create_feed.metadata.to_h
365
+
366
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
367
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
368
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
369
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
370
+ transports_version_send: [:rest]
371
+
372
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
373
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
374
+
375
+ options.apply_defaults timeout: @config.rpcs.create_feed.timeout,
376
+ metadata: call_metadata,
377
+ retry_policy: @config.rpcs.create_feed.retry_policy
378
+
379
+ options.apply_defaults timeout: @config.timeout,
380
+ metadata: @config.metadata,
381
+ retry_policy: @config.retry_policy
382
+
383
+ @feeds_service_stub.create_feed request, options do |result, operation|
384
+ yield result, operation if block_given?
385
+ end
386
+ rescue ::Gapic::Rest::Error => e
387
+ raise ::Google::Cloud::Error.from_error(e)
388
+ end
389
+
390
+ ##
391
+ # Gets a feed.
392
+ #
393
+ # @overload get_feed(request, options = nil)
394
+ # Pass arguments to `get_feed` via a request object, either of type
395
+ # {::Google::Cloud::Chronicle::V1::GetFeedRequest} or an equivalent Hash.
396
+ #
397
+ # @param request [::Google::Cloud::Chronicle::V1::GetFeedRequest, ::Hash]
398
+ # A request object representing the call parameters. Required. To specify no
399
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
400
+ # @param options [::Gapic::CallOptions, ::Hash]
401
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
402
+ #
403
+ # @overload get_feed(name: nil)
404
+ # Pass arguments to `get_feed` via keyword arguments. Note that at
405
+ # least one keyword argument is required. To specify no parameters, or to keep all
406
+ # the default parameter values, pass an empty Hash as a request object (see above).
407
+ #
408
+ # @param name [::String]
409
+ # Required. The ID of the feed to retrieve.
410
+ # Format:
411
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
412
+ # @yield [result, operation] Access the result along with the TransportOperation object
413
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Feed]
414
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
415
+ #
416
+ # @return [::Google::Cloud::Chronicle::V1::Feed]
417
+ #
418
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
419
+ #
420
+ # @example Basic example
421
+ # require "google/cloud/chronicle/v1"
422
+ #
423
+ # # Create a client object. The client can be reused for multiple calls.
424
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
425
+ #
426
+ # # Create a request. To set request fields, pass in keyword arguments.
427
+ # request = Google::Cloud::Chronicle::V1::GetFeedRequest.new
428
+ #
429
+ # # Call the get_feed method.
430
+ # result = client.get_feed request
431
+ #
432
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Feed.
433
+ # p result
434
+ #
435
+ def get_feed request, options = nil
436
+ raise ::ArgumentError, "request must be provided" if request.nil?
437
+
438
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetFeedRequest
439
+
440
+ # Converts hash and nil to an options object
441
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
442
+
443
+ # Customize the options with defaults
444
+ call_metadata = @config.rpcs.get_feed.metadata.to_h
445
+
446
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
447
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
448
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
449
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
450
+ transports_version_send: [:rest]
451
+
452
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
453
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
454
+
455
+ options.apply_defaults timeout: @config.rpcs.get_feed.timeout,
456
+ metadata: call_metadata,
457
+ retry_policy: @config.rpcs.get_feed.retry_policy
458
+
459
+ options.apply_defaults timeout: @config.timeout,
460
+ metadata: @config.metadata,
461
+ retry_policy: @config.retry_policy
462
+
463
+ @feeds_service_stub.get_feed request, options do |result, operation|
464
+ yield result, operation if block_given?
465
+ end
466
+ rescue ::Gapic::Rest::Error => e
467
+ raise ::Google::Cloud::Error.from_error(e)
468
+ end
469
+
470
+ ##
471
+ # Deletes a feed.
472
+ #
473
+ # @overload delete_feed(request, options = nil)
474
+ # Pass arguments to `delete_feed` via a request object, either of type
475
+ # {::Google::Cloud::Chronicle::V1::DeleteFeedRequest} or an equivalent Hash.
476
+ #
477
+ # @param request [::Google::Cloud::Chronicle::V1::DeleteFeedRequest, ::Hash]
478
+ # A request object representing the call parameters. Required. To specify no
479
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
480
+ # @param options [::Gapic::CallOptions, ::Hash]
481
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
482
+ #
483
+ # @overload delete_feed(name: nil, delete_backlog: nil)
484
+ # Pass arguments to `delete_feed` via keyword arguments. Note that at
485
+ # least one keyword argument is required. To specify no parameters, or to keep all
486
+ # the default parameter values, pass an empty Hash as a request object (see above).
487
+ #
488
+ # @param name [::String]
489
+ # Required. The ID of the feed to retrieve.
490
+ # Format:
491
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
492
+ # @param delete_backlog [::Boolean]
493
+ # Optional. If true, delete the uningested backlog in OOB retry queue for the
494
+ # feed.
495
+ # @yield [result, operation] Access the result along with the TransportOperation object
496
+ # @yieldparam result [::Google::Protobuf::Empty]
497
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
498
+ #
499
+ # @return [::Google::Protobuf::Empty]
500
+ #
501
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
502
+ #
503
+ # @example Basic example
504
+ # require "google/cloud/chronicle/v1"
505
+ #
506
+ # # Create a client object. The client can be reused for multiple calls.
507
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
508
+ #
509
+ # # Create a request. To set request fields, pass in keyword arguments.
510
+ # request = Google::Cloud::Chronicle::V1::DeleteFeedRequest.new
511
+ #
512
+ # # Call the delete_feed method.
513
+ # result = client.delete_feed request
514
+ #
515
+ # # The returned object is of type Google::Protobuf::Empty.
516
+ # p result
517
+ #
518
+ def delete_feed request, options = nil
519
+ raise ::ArgumentError, "request must be provided" if request.nil?
520
+
521
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DeleteFeedRequest
522
+
523
+ # Converts hash and nil to an options object
524
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
525
+
526
+ # Customize the options with defaults
527
+ call_metadata = @config.rpcs.delete_feed.metadata.to_h
528
+
529
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
530
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
531
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
532
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
533
+ transports_version_send: [:rest]
534
+
535
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
536
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
537
+
538
+ options.apply_defaults timeout: @config.rpcs.delete_feed.timeout,
539
+ metadata: call_metadata,
540
+ retry_policy: @config.rpcs.delete_feed.retry_policy
541
+
542
+ options.apply_defaults timeout: @config.timeout,
543
+ metadata: @config.metadata,
544
+ retry_policy: @config.retry_policy
545
+
546
+ @feeds_service_stub.delete_feed request, options do |result, operation|
547
+ yield result, operation if block_given?
548
+ end
549
+ rescue ::Gapic::Rest::Error => e
550
+ raise ::Google::Cloud::Error.from_error(e)
551
+ end
552
+
553
+ ##
554
+ # Enable feed for ingestion.
555
+ #
556
+ # @overload enable_feed(request, options = nil)
557
+ # Pass arguments to `enable_feed` via a request object, either of type
558
+ # {::Google::Cloud::Chronicle::V1::EnableFeedRequest} or an equivalent Hash.
559
+ #
560
+ # @param request [::Google::Cloud::Chronicle::V1::EnableFeedRequest, ::Hash]
561
+ # A request object representing the call parameters. Required. To specify no
562
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
563
+ # @param options [::Gapic::CallOptions, ::Hash]
564
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
565
+ #
566
+ # @overload enable_feed(name: nil)
567
+ # Pass arguments to `enable_feed` via keyword arguments. Note that at
568
+ # least one keyword argument is required. To specify no parameters, or to keep all
569
+ # the default parameter values, pass an empty Hash as a request object (see above).
570
+ #
571
+ # @param name [::String]
572
+ # Required. The name of the feed to enable.
573
+ # Format:
574
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
575
+ # @yield [result, operation] Access the result along with the TransportOperation object
576
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Feed]
577
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
578
+ #
579
+ # @return [::Google::Cloud::Chronicle::V1::Feed]
580
+ #
581
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
582
+ #
583
+ # @example Basic example
584
+ # require "google/cloud/chronicle/v1"
585
+ #
586
+ # # Create a client object. The client can be reused for multiple calls.
587
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
588
+ #
589
+ # # Create a request. To set request fields, pass in keyword arguments.
590
+ # request = Google::Cloud::Chronicle::V1::EnableFeedRequest.new
591
+ #
592
+ # # Call the enable_feed method.
593
+ # result = client.enable_feed request
594
+ #
595
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Feed.
596
+ # p result
597
+ #
598
+ def enable_feed request, options = nil
599
+ raise ::ArgumentError, "request must be provided" if request.nil?
600
+
601
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::EnableFeedRequest
602
+
603
+ # Converts hash and nil to an options object
604
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
605
+
606
+ # Customize the options with defaults
607
+ call_metadata = @config.rpcs.enable_feed.metadata.to_h
608
+
609
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
610
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
611
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
612
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
613
+ transports_version_send: [:rest]
614
+
615
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
616
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
617
+
618
+ options.apply_defaults timeout: @config.rpcs.enable_feed.timeout,
619
+ metadata: call_metadata,
620
+ retry_policy: @config.rpcs.enable_feed.retry_policy
621
+
622
+ options.apply_defaults timeout: @config.timeout,
623
+ metadata: @config.metadata,
624
+ retry_policy: @config.retry_policy
625
+
626
+ @feeds_service_stub.enable_feed request, options do |result, operation|
627
+ yield result, operation if block_given?
628
+ end
629
+ rescue ::Gapic::Rest::Error => e
630
+ raise ::Google::Cloud::Error.from_error(e)
631
+ end
632
+
633
+ ##
634
+ # Disable feed for ingestion. Make FeedState ARCHIVED.
635
+ #
636
+ # @overload disable_feed(request, options = nil)
637
+ # Pass arguments to `disable_feed` via a request object, either of type
638
+ # {::Google::Cloud::Chronicle::V1::DisableFeedRequest} or an equivalent Hash.
639
+ #
640
+ # @param request [::Google::Cloud::Chronicle::V1::DisableFeedRequest, ::Hash]
641
+ # A request object representing the call parameters. Required. To specify no
642
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
643
+ # @param options [::Gapic::CallOptions, ::Hash]
644
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
645
+ #
646
+ # @overload disable_feed(name: nil)
647
+ # Pass arguments to `disable_feed` via keyword arguments. Note that at
648
+ # least one keyword argument is required. To specify no parameters, or to keep all
649
+ # the default parameter values, pass an empty Hash as a request object (see above).
650
+ #
651
+ # @param name [::String]
652
+ # Required. The name of the feed to disable.
653
+ # Format:
654
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
655
+ # @yield [result, operation] Access the result along with the TransportOperation object
656
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Feed]
657
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
658
+ #
659
+ # @return [::Google::Cloud::Chronicle::V1::Feed]
660
+ #
661
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
662
+ #
663
+ # @example Basic example
664
+ # require "google/cloud/chronicle/v1"
665
+ #
666
+ # # Create a client object. The client can be reused for multiple calls.
667
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
668
+ #
669
+ # # Create a request. To set request fields, pass in keyword arguments.
670
+ # request = Google::Cloud::Chronicle::V1::DisableFeedRequest.new
671
+ #
672
+ # # Call the disable_feed method.
673
+ # result = client.disable_feed request
674
+ #
675
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Feed.
676
+ # p result
677
+ #
678
+ def disable_feed request, options = nil
679
+ raise ::ArgumentError, "request must be provided" if request.nil?
680
+
681
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::DisableFeedRequest
682
+
683
+ # Converts hash and nil to an options object
684
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
685
+
686
+ # Customize the options with defaults
687
+ call_metadata = @config.rpcs.disable_feed.metadata.to_h
688
+
689
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
690
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
691
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
692
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
693
+ transports_version_send: [:rest]
694
+
695
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
696
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
697
+
698
+ options.apply_defaults timeout: @config.rpcs.disable_feed.timeout,
699
+ metadata: call_metadata,
700
+ retry_policy: @config.rpcs.disable_feed.retry_policy
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
704
+ retry_policy: @config.retry_policy
705
+
706
+ @feeds_service_stub.disable_feed request, options do |result, operation|
707
+ yield result, operation if block_given?
708
+ end
709
+ rescue ::Gapic::Rest::Error => e
710
+ raise ::Google::Cloud::Error.from_error(e)
711
+ end
712
+
713
+ ##
714
+ # Lists all feeds for the customer.
715
+ #
716
+ # @overload list_feeds(request, options = nil)
717
+ # Pass arguments to `list_feeds` via a request object, either of type
718
+ # {::Google::Cloud::Chronicle::V1::ListFeedsRequest} or an equivalent Hash.
719
+ #
720
+ # @param request [::Google::Cloud::Chronicle::V1::ListFeedsRequest, ::Hash]
721
+ # A request object representing the call parameters. Required. To specify no
722
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
723
+ # @param options [::Gapic::CallOptions, ::Hash]
724
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
725
+ #
726
+ # @overload list_feeds(parent: nil, page_size: nil, page_token: nil)
727
+ # Pass arguments to `list_feeds` via keyword arguments. Note that at
728
+ # least one keyword argument is required. To specify no parameters, or to keep all
729
+ # the default parameter values, pass an empty Hash as a request object (see above).
730
+ #
731
+ # @param parent [::String]
732
+ # Required. The parent resource where this Feed will be created.
733
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
734
+ # @param page_size [::Integer]
735
+ # The maximum number of feeds to return. The service may return fewer than
736
+ # this value.
737
+ # If unspecified, at most 100 feeds will be returned.
738
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
739
+ # @param page_token [::String]
740
+ # A page token, received from a previous `ListFeeds` call. Provide this to
741
+ # retrieve the subsequent page.
742
+ # @yield [result, operation] Access the result along with the TransportOperation object
743
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Feed>]
744
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
745
+ #
746
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::Feed>]
747
+ #
748
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
749
+ #
750
+ # @example Basic example
751
+ # require "google/cloud/chronicle/v1"
752
+ #
753
+ # # Create a client object. The client can be reused for multiple calls.
754
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
755
+ #
756
+ # # Create a request. To set request fields, pass in keyword arguments.
757
+ # request = Google::Cloud::Chronicle::V1::ListFeedsRequest.new
758
+ #
759
+ # # Call the list_feeds method.
760
+ # result = client.list_feeds request
761
+ #
762
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
763
+ # # over elements, and API calls will be issued to fetch pages as needed.
764
+ # result.each do |item|
765
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::Feed.
766
+ # p item
767
+ # end
768
+ #
769
+ def list_feeds request, options = nil
770
+ raise ::ArgumentError, "request must be provided" if request.nil?
771
+
772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeedsRequest
773
+
774
+ # Converts hash and nil to an options object
775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
776
+
777
+ # Customize the options with defaults
778
+ call_metadata = @config.rpcs.list_feeds.metadata.to_h
779
+
780
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
781
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
783
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
784
+ transports_version_send: [:rest]
785
+
786
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
787
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
788
+
789
+ options.apply_defaults timeout: @config.rpcs.list_feeds.timeout,
790
+ metadata: call_metadata,
791
+ retry_policy: @config.rpcs.list_feeds.retry_policy
792
+
793
+ options.apply_defaults timeout: @config.timeout,
794
+ metadata: @config.metadata,
795
+ retry_policy: @config.retry_policy
796
+
797
+ @feeds_service_stub.list_feeds request, options do |result, operation|
798
+ result = ::Gapic::Rest::PagedEnumerable.new @feeds_service_stub, :list_feeds, "feeds", request, result, options
799
+ yield result, operation if block_given?
800
+ throw :response, result
801
+ end
802
+ rescue ::Gapic::Rest::Error => e
803
+ raise ::Google::Cloud::Error.from_error(e)
804
+ end
805
+
806
+ ##
807
+ # Lists Packs for which feeds can be configured.
808
+ #
809
+ # @overload list_feed_packs(request, options = nil)
810
+ # Pass arguments to `list_feed_packs` via a request object, either of type
811
+ # {::Google::Cloud::Chronicle::V1::ListFeedPacksRequest} or an equivalent Hash.
812
+ #
813
+ # @param request [::Google::Cloud::Chronicle::V1::ListFeedPacksRequest, ::Hash]
814
+ # A request object representing the call parameters. Required. To specify no
815
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
816
+ # @param options [::Gapic::CallOptions, ::Hash]
817
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
818
+ #
819
+ # @overload list_feed_packs(parent: nil, page_size: nil, page_token: nil)
820
+ # Pass arguments to `list_feed_packs` via keyword arguments. Note that at
821
+ # least one keyword argument is required. To specify no parameters, or to keep all
822
+ # the default parameter values, pass an empty Hash as a request object (see above).
823
+ #
824
+ # @param parent [::String]
825
+ # Required. The parent resource where this content pack will be created.
826
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
827
+ # @param page_size [::Integer]
828
+ # Optional. The maximum number of feed content packs to return. The service
829
+ # may return fewer than this value. If unspecified, at most 50 feed content
830
+ # packs will be returned. The maximum value is 1000; values above 1000 will
831
+ # be coerced to 1000.
832
+ # @param page_token [::String]
833
+ # Optional. A page token, received from a previous `ListFeedPacks` call.
834
+ # Provide this to retrieve the subsequent page. When paginating, all other
835
+ # parameters provided to `ListFeedPacks` must match the call that provided
836
+ # the page token.
837
+ # @yield [result, operation] Access the result along with the TransportOperation object
838
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeedPack>]
839
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
840
+ #
841
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeedPack>]
842
+ #
843
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
844
+ #
845
+ # @example Basic example
846
+ # require "google/cloud/chronicle/v1"
847
+ #
848
+ # # Create a client object. The client can be reused for multiple calls.
849
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
850
+ #
851
+ # # Create a request. To set request fields, pass in keyword arguments.
852
+ # request = Google::Cloud::Chronicle::V1::ListFeedPacksRequest.new
853
+ #
854
+ # # Call the list_feed_packs method.
855
+ # result = client.list_feed_packs request
856
+ #
857
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
858
+ # # over elements, and API calls will be issued to fetch pages as needed.
859
+ # result.each do |item|
860
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::FeedPack.
861
+ # p item
862
+ # end
863
+ #
864
+ def list_feed_packs request, options = nil
865
+ raise ::ArgumentError, "request must be provided" if request.nil?
866
+
867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeedPacksRequest
868
+
869
+ # Converts hash and nil to an options object
870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
871
+
872
+ # Customize the options with defaults
873
+ call_metadata = @config.rpcs.list_feed_packs.metadata.to_h
874
+
875
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
876
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
877
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
878
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
879
+ transports_version_send: [:rest]
880
+
881
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
882
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
883
+
884
+ options.apply_defaults timeout: @config.rpcs.list_feed_packs.timeout,
885
+ metadata: call_metadata,
886
+ retry_policy: @config.rpcs.list_feed_packs.retry_policy
887
+
888
+ options.apply_defaults timeout: @config.timeout,
889
+ metadata: @config.metadata,
890
+ retry_policy: @config.retry_policy
891
+
892
+ @feeds_service_stub.list_feed_packs request, options do |result, operation|
893
+ result = ::Gapic::Rest::PagedEnumerable.new @feeds_service_stub, :list_feed_packs, "feed_packs", request, result, options
894
+ yield result, operation if block_given?
895
+ throw :response, result
896
+ end
897
+ rescue ::Gapic::Rest::Error => e
898
+ raise ::Google::Cloud::Error.from_error(e)
899
+ end
900
+
901
+ ##
902
+ # Gets a feed pack.
903
+ #
904
+ # @overload get_feed_pack(request, options = nil)
905
+ # Pass arguments to `get_feed_pack` via a request object, either of type
906
+ # {::Google::Cloud::Chronicle::V1::GetFeedPackRequest} or an equivalent Hash.
907
+ #
908
+ # @param request [::Google::Cloud::Chronicle::V1::GetFeedPackRequest, ::Hash]
909
+ # A request object representing the call parameters. Required. To specify no
910
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
911
+ # @param options [::Gapic::CallOptions, ::Hash]
912
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
913
+ #
914
+ # @overload get_feed_pack(name: nil)
915
+ # Pass arguments to `get_feed_pack` via keyword arguments. Note that at
916
+ # least one keyword argument is required. To specify no parameters, or to keep all
917
+ # the default parameter values, pass an empty Hash as a request object (see above).
918
+ #
919
+ # @param name [::String]
920
+ # Required. The ID of the feed pack to retrieve.
921
+ # Format:
922
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feedPacks/\\{feedPack}
923
+ # @yield [result, operation] Access the result along with the TransportOperation object
924
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::FeedPack]
925
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
926
+ #
927
+ # @return [::Google::Cloud::Chronicle::V1::FeedPack]
928
+ #
929
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
930
+ #
931
+ # @example Basic example
932
+ # require "google/cloud/chronicle/v1"
933
+ #
934
+ # # Create a client object. The client can be reused for multiple calls.
935
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
936
+ #
937
+ # # Create a request. To set request fields, pass in keyword arguments.
938
+ # request = Google::Cloud::Chronicle::V1::GetFeedPackRequest.new
939
+ #
940
+ # # Call the get_feed_pack method.
941
+ # result = client.get_feed_pack request
942
+ #
943
+ # # The returned object is of type Google::Cloud::Chronicle::V1::FeedPack.
944
+ # p result
945
+ #
946
+ def get_feed_pack request, options = nil
947
+ raise ::ArgumentError, "request must be provided" if request.nil?
948
+
949
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GetFeedPackRequest
950
+
951
+ # Converts hash and nil to an options object
952
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
953
+
954
+ # Customize the options with defaults
955
+ call_metadata = @config.rpcs.get_feed_pack.metadata.to_h
956
+
957
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
958
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
959
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
960
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
961
+ transports_version_send: [:rest]
962
+
963
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
964
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
965
+
966
+ options.apply_defaults timeout: @config.rpcs.get_feed_pack.timeout,
967
+ metadata: call_metadata,
968
+ retry_policy: @config.rpcs.get_feed_pack.retry_policy
969
+
970
+ options.apply_defaults timeout: @config.timeout,
971
+ metadata: @config.metadata,
972
+ retry_policy: @config.retry_policy
973
+
974
+ @feeds_service_stub.get_feed_pack request, options do |result, operation|
975
+ yield result, operation if block_given?
976
+ end
977
+ rescue ::Gapic::Rest::Error => e
978
+ raise ::Google::Cloud::Error.from_error(e)
979
+ end
980
+
981
+ ##
982
+ # Updates the full feed.
983
+ #
984
+ # @overload update_feed(request, options = nil)
985
+ # Pass arguments to `update_feed` via a request object, either of type
986
+ # {::Google::Cloud::Chronicle::V1::UpdateFeedRequest} or an equivalent Hash.
987
+ #
988
+ # @param request [::Google::Cloud::Chronicle::V1::UpdateFeedRequest, ::Hash]
989
+ # A request object representing the call parameters. Required. To specify no
990
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
991
+ # @param options [::Gapic::CallOptions, ::Hash]
992
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
993
+ #
994
+ # @overload update_feed(feed: nil, update_mask: nil)
995
+ # Pass arguments to `update_feed` via keyword arguments. Note that at
996
+ # least one keyword argument is required. To specify no parameters, or to keep all
997
+ # the default parameter values, pass an empty Hash as a request object (see above).
998
+ #
999
+ # @param feed [::Google::Cloud::Chronicle::V1::Feed, ::Hash]
1000
+ # Required. Feed to update. Updates full feed object.
1001
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1002
+ # Optional. Specifies which fields to update. If empty, update the full feed.
1003
+ # To update the display name, pass only `displayName` and no other
1004
+ # fields. To update other fields, pass a comma-separated list of fields to
1005
+ # update and omit `displayName`. The update fails if an existing
1006
+ # `displayName` is sent in the update request.
1007
+ # @yield [result, operation] Access the result along with the TransportOperation object
1008
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::Feed]
1009
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1010
+ #
1011
+ # @return [::Google::Cloud::Chronicle::V1::Feed]
1012
+ #
1013
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1014
+ #
1015
+ # @example Basic example
1016
+ # require "google/cloud/chronicle/v1"
1017
+ #
1018
+ # # Create a client object. The client can be reused for multiple calls.
1019
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
1020
+ #
1021
+ # # Create a request. To set request fields, pass in keyword arguments.
1022
+ # request = Google::Cloud::Chronicle::V1::UpdateFeedRequest.new
1023
+ #
1024
+ # # Call the update_feed method.
1025
+ # result = client.update_feed request
1026
+ #
1027
+ # # The returned object is of type Google::Cloud::Chronicle::V1::Feed.
1028
+ # p result
1029
+ #
1030
+ def update_feed request, options = nil
1031
+ raise ::ArgumentError, "request must be provided" if request.nil?
1032
+
1033
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::UpdateFeedRequest
1034
+
1035
+ # Converts hash and nil to an options object
1036
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1037
+
1038
+ # Customize the options with defaults
1039
+ call_metadata = @config.rpcs.update_feed.metadata.to_h
1040
+
1041
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1042
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1043
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1044
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1045
+ transports_version_send: [:rest]
1046
+
1047
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1048
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1049
+
1050
+ options.apply_defaults timeout: @config.rpcs.update_feed.timeout,
1051
+ metadata: call_metadata,
1052
+ retry_policy: @config.rpcs.update_feed.retry_policy
1053
+
1054
+ options.apply_defaults timeout: @config.timeout,
1055
+ metadata: @config.metadata,
1056
+ retry_policy: @config.retry_policy
1057
+
1058
+ @feeds_service_stub.update_feed request, options do |result, operation|
1059
+ yield result, operation if block_given?
1060
+ end
1061
+ rescue ::Gapic::Rest::Error => e
1062
+ raise ::Google::Cloud::Error.from_error(e)
1063
+ end
1064
+
1065
+ ##
1066
+ # List all FeedSourceTypeSchemas.
1067
+ #
1068
+ # @overload list_feed_source_type_schemas(request, options = nil)
1069
+ # Pass arguments to `list_feed_source_type_schemas` via a request object, either of type
1070
+ # {::Google::Cloud::Chronicle::V1::ListFeedSourceTypeSchemasRequest} or an equivalent Hash.
1071
+ #
1072
+ # @param request [::Google::Cloud::Chronicle::V1::ListFeedSourceTypeSchemasRequest, ::Hash]
1073
+ # A request object representing the call parameters. Required. To specify no
1074
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1075
+ # @param options [::Gapic::CallOptions, ::Hash]
1076
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1077
+ #
1078
+ # @overload list_feed_source_type_schemas(parent: nil, page_size: nil, page_token: nil)
1079
+ # Pass arguments to `list_feed_source_type_schemas` via keyword arguments. Note that at
1080
+ # least one keyword argument is required. To specify no parameters, or to keep all
1081
+ # the default parameter values, pass an empty Hash as a request object (see above).
1082
+ #
1083
+ # @param parent [::String]
1084
+ # Required. The parent, which owns this collection of FeedSourceTypeSchemas.
1085
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
1086
+ # @param page_size [::Integer]
1087
+ # The maximum number of FeedSourceTypeSchemas to return. The service may
1088
+ # return fewer than this value. If unspecified all FeedSourceTypeSchemas will
1089
+ # be returned, meaning one FeedSourceTypeSchema for each
1090
+ # FeedDetails.FeedSourceType.
1091
+ # The maximum value is 100; values above 100 will be coerced to 100.
1092
+ # @param page_token [::String]
1093
+ # A page token, received from a previous `ListFeedSourceTypeSchemas` call.
1094
+ # Provide this to retrieve the subsequent page.
1095
+ # @yield [result, operation] Access the result along with the TransportOperation object
1096
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeedSourceTypeSchema>]
1097
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1098
+ #
1099
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeedSourceTypeSchema>]
1100
+ #
1101
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1102
+ #
1103
+ # @example Basic example
1104
+ # require "google/cloud/chronicle/v1"
1105
+ #
1106
+ # # Create a client object. The client can be reused for multiple calls.
1107
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
1108
+ #
1109
+ # # Create a request. To set request fields, pass in keyword arguments.
1110
+ # request = Google::Cloud::Chronicle::V1::ListFeedSourceTypeSchemasRequest.new
1111
+ #
1112
+ # # Call the list_feed_source_type_schemas method.
1113
+ # result = client.list_feed_source_type_schemas request
1114
+ #
1115
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1116
+ # # over elements, and API calls will be issued to fetch pages as needed.
1117
+ # result.each do |item|
1118
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::FeedSourceTypeSchema.
1119
+ # p item
1120
+ # end
1121
+ #
1122
+ def list_feed_source_type_schemas request, options = nil
1123
+ raise ::ArgumentError, "request must be provided" if request.nil?
1124
+
1125
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeedSourceTypeSchemasRequest
1126
+
1127
+ # Converts hash and nil to an options object
1128
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1129
+
1130
+ # Customize the options with defaults
1131
+ call_metadata = @config.rpcs.list_feed_source_type_schemas.metadata.to_h
1132
+
1133
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1134
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1135
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1136
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1137
+ transports_version_send: [:rest]
1138
+
1139
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1140
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1141
+
1142
+ options.apply_defaults timeout: @config.rpcs.list_feed_source_type_schemas.timeout,
1143
+ metadata: call_metadata,
1144
+ retry_policy: @config.rpcs.list_feed_source_type_schemas.retry_policy
1145
+
1146
+ options.apply_defaults timeout: @config.timeout,
1147
+ metadata: @config.metadata,
1148
+ retry_policy: @config.retry_policy
1149
+
1150
+ @feeds_service_stub.list_feed_source_type_schemas request, options do |result, operation|
1151
+ result = ::Gapic::Rest::PagedEnumerable.new @feeds_service_stub, :list_feed_source_type_schemas, "feed_source_type_schemas", request, result, options
1152
+ yield result, operation if block_given?
1153
+ throw :response, result
1154
+ end
1155
+ rescue ::Gapic::Rest::Error => e
1156
+ raise ::Google::Cloud::Error.from_error(e)
1157
+ end
1158
+
1159
+ ##
1160
+ # List all LogTypeSchemas compatible with a given
1161
+ # FeedSourceType.
1162
+ #
1163
+ # @overload list_log_type_schemas(request, options = nil)
1164
+ # Pass arguments to `list_log_type_schemas` via a request object, either of type
1165
+ # {::Google::Cloud::Chronicle::V1::ListLogTypeSchemasRequest} or an equivalent Hash.
1166
+ #
1167
+ # @param request [::Google::Cloud::Chronicle::V1::ListLogTypeSchemasRequest, ::Hash]
1168
+ # A request object representing the call parameters. Required. To specify no
1169
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1170
+ # @param options [::Gapic::CallOptions, ::Hash]
1171
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1172
+ #
1173
+ # @overload list_log_type_schemas(parent: nil, page_size: nil, page_token: nil)
1174
+ # Pass arguments to `list_log_type_schemas` via keyword arguments. Note that at
1175
+ # least one keyword argument is required. To specify no parameters, or to keep all
1176
+ # the default parameter values, pass an empty Hash as a request object (see above).
1177
+ #
1178
+ # @param parent [::String]
1179
+ # Required. The parent, which owns this collection of LogTypeSchemas.
1180
+ # Format: Format:
1181
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feedSourceTypeSchemas/\\{feed_source_type}
1182
+ # @param page_size [::Integer]
1183
+ # The maximum number of LogTypeSchemas to return. The service may return
1184
+ # fewer than this value.
1185
+ # If unspecified, at most 5000 LogTypeSchemas will be returned.
1186
+ # The maximum value is 10000; values above 10000 will be coerced to 10000.
1187
+ # @param page_token [::String]
1188
+ # A page token, received from a previous `ListLogTypeSchemas` call. Provide
1189
+ # this to retrieve the subsequent page.
1190
+ # @yield [result, operation] Access the result along with the TransportOperation object
1191
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::LogTypeSchema>]
1192
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1193
+ #
1194
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::LogTypeSchema>]
1195
+ #
1196
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1197
+ #
1198
+ # @example Basic example
1199
+ # require "google/cloud/chronicle/v1"
1200
+ #
1201
+ # # Create a client object. The client can be reused for multiple calls.
1202
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
1203
+ #
1204
+ # # Create a request. To set request fields, pass in keyword arguments.
1205
+ # request = Google::Cloud::Chronicle::V1::ListLogTypeSchemasRequest.new
1206
+ #
1207
+ # # Call the list_log_type_schemas method.
1208
+ # result = client.list_log_type_schemas request
1209
+ #
1210
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1211
+ # # over elements, and API calls will be issued to fetch pages as needed.
1212
+ # result.each do |item|
1213
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::LogTypeSchema.
1214
+ # p item
1215
+ # end
1216
+ #
1217
+ def list_log_type_schemas request, options = nil
1218
+ raise ::ArgumentError, "request must be provided" if request.nil?
1219
+
1220
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListLogTypeSchemasRequest
1221
+
1222
+ # Converts hash and nil to an options object
1223
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1224
+
1225
+ # Customize the options with defaults
1226
+ call_metadata = @config.rpcs.list_log_type_schemas.metadata.to_h
1227
+
1228
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1229
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1230
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1231
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1232
+ transports_version_send: [:rest]
1233
+
1234
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1235
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1236
+
1237
+ options.apply_defaults timeout: @config.rpcs.list_log_type_schemas.timeout,
1238
+ metadata: call_metadata,
1239
+ retry_policy: @config.rpcs.list_log_type_schemas.retry_policy
1240
+
1241
+ options.apply_defaults timeout: @config.timeout,
1242
+ metadata: @config.metadata,
1243
+ retry_policy: @config.retry_policy
1244
+
1245
+ @feeds_service_stub.list_log_type_schemas request, options do |result, operation|
1246
+ result = ::Gapic::Rest::PagedEnumerable.new @feeds_service_stub, :list_log_type_schemas, "log_type_schemas", request, result, options
1247
+ yield result, operation if block_given?
1248
+ throw :response, result
1249
+ end
1250
+ rescue ::Gapic::Rest::Error => e
1251
+ raise ::Google::Cloud::Error.from_error(e)
1252
+ end
1253
+
1254
+ ##
1255
+ # Import logs coming from https push feeds.
1256
+ # All log entries must be valid UTF-8. A single invalid event will cause the
1257
+ # entire request to be rejected.
1258
+ #
1259
+ # @overload import_push_logs(request, options = nil)
1260
+ # Pass arguments to `import_push_logs` via a request object, either of type
1261
+ # {::Google::Cloud::Chronicle::V1::ImportPushLogsRequest} or an equivalent Hash.
1262
+ #
1263
+ # @param request [::Google::Cloud::Chronicle::V1::ImportPushLogsRequest, ::Hash]
1264
+ # A request object representing the call parameters. Required. To specify no
1265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1266
+ # @param options [::Gapic::CallOptions, ::Hash]
1267
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1268
+ #
1269
+ # @overload import_push_logs(parent: nil, http_body: nil, secret: nil)
1270
+ # Pass arguments to `import_push_logs` via keyword arguments. Note that at
1271
+ # least one keyword argument is required. To specify no parameters, or to keep all
1272
+ # the default parameter values, pass an empty Hash as a request object (see above).
1273
+ #
1274
+ # @param parent [::String]
1275
+ # Required. The parent, which owns this collection of logs.
1276
+ # Format:
1277
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
1278
+ # @param http_body [::Google::Api::HttpBody, ::Hash]
1279
+ # Required. The raw HTTP body is bound to this field.
1280
+ # All log entries must be valid UTF-8. A single invalid event will cause the
1281
+ # entire request to be rejected.
1282
+ # @param secret [::String]
1283
+ # Immutable. The secret for the feed.
1284
+ # @yield [result, operation] Access the result along with the TransportOperation object
1285
+ # @yieldparam result [::Google::Api::HttpBody]
1286
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1287
+ #
1288
+ # @return [::Google::Api::HttpBody]
1289
+ #
1290
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1291
+ #
1292
+ # @example Basic example
1293
+ # require "google/cloud/chronicle/v1"
1294
+ #
1295
+ # # Create a client object. The client can be reused for multiple calls.
1296
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
1297
+ #
1298
+ # # Create a request. To set request fields, pass in keyword arguments.
1299
+ # request = Google::Cloud::Chronicle::V1::ImportPushLogsRequest.new
1300
+ #
1301
+ # # Call the import_push_logs method.
1302
+ # result = client.import_push_logs request
1303
+ #
1304
+ # # The returned object is of type Google::Api::HttpBody.
1305
+ # p result
1306
+ #
1307
+ def import_push_logs request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ImportPushLogsRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ call_metadata = @config.rpcs.import_push_logs.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1319
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1322
+ transports_version_send: [:rest]
1323
+
1324
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1325
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1326
+
1327
+ options.apply_defaults timeout: @config.rpcs.import_push_logs.timeout,
1328
+ metadata: call_metadata,
1329
+ retry_policy: @config.rpcs.import_push_logs.retry_policy
1330
+
1331
+ options.apply_defaults timeout: @config.timeout,
1332
+ metadata: @config.metadata,
1333
+ retry_policy: @config.retry_policy
1334
+
1335
+ @feeds_service_stub.import_push_logs request, options do |result, operation|
1336
+ yield result, operation if block_given?
1337
+ end
1338
+ rescue ::Gapic::Rest::Error => e
1339
+ raise ::Google::Cloud::Error.from_error(e)
1340
+ end
1341
+
1342
+ ##
1343
+ # Generates a new secret for https push feeds which do not support jwt
1344
+ # tokens. Secrets once generated should be copied and stored in safe place
1345
+ # to be used while configuring https push feeds.Please note that you can
1346
+ # always generate a new secret again for a feed using this API but it will
1347
+ # invalidate the previously generated secret for the feed.
1348
+ #
1349
+ # @overload generate_secret(request, options = nil)
1350
+ # Pass arguments to `generate_secret` via a request object, either of type
1351
+ # {::Google::Cloud::Chronicle::V1::GenerateSecretRequest} or an equivalent Hash.
1352
+ #
1353
+ # @param request [::Google::Cloud::Chronicle::V1::GenerateSecretRequest, ::Hash]
1354
+ # A request object representing the call parameters. Required. To specify no
1355
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1356
+ # @param options [::Gapic::CallOptions, ::Hash]
1357
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1358
+ #
1359
+ # @overload generate_secret(name: nil)
1360
+ # Pass arguments to `generate_secret` via keyword arguments. Note that at
1361
+ # least one keyword argument is required. To specify no parameters, or to keep all
1362
+ # the default parameter values, pass an empty Hash as a request object (see above).
1363
+ #
1364
+ # @param name [::String]
1365
+ # Required. The name of the feed to for which to generate secret.
1366
+ # Format:
1367
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/feeds/\\{feed}
1368
+ # @yield [result, operation] Access the result along with the TransportOperation object
1369
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::GenerateSecretResponse]
1370
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1371
+ #
1372
+ # @return [::Google::Cloud::Chronicle::V1::GenerateSecretResponse]
1373
+ #
1374
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1375
+ #
1376
+ # @example Basic example
1377
+ # require "google/cloud/chronicle/v1"
1378
+ #
1379
+ # # Create a client object. The client can be reused for multiple calls.
1380
+ # client = Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new
1381
+ #
1382
+ # # Create a request. To set request fields, pass in keyword arguments.
1383
+ # request = Google::Cloud::Chronicle::V1::GenerateSecretRequest.new
1384
+ #
1385
+ # # Call the generate_secret method.
1386
+ # result = client.generate_secret request
1387
+ #
1388
+ # # The returned object is of type Google::Cloud::Chronicle::V1::GenerateSecretResponse.
1389
+ # p result
1390
+ #
1391
+ def generate_secret request, options = nil
1392
+ raise ::ArgumentError, "request must be provided" if request.nil?
1393
+
1394
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::GenerateSecretRequest
1395
+
1396
+ # Converts hash and nil to an options object
1397
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1398
+
1399
+ # Customize the options with defaults
1400
+ call_metadata = @config.rpcs.generate_secret.metadata.to_h
1401
+
1402
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1403
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1404
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1405
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
1406
+ transports_version_send: [:rest]
1407
+
1408
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1409
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1410
+
1411
+ options.apply_defaults timeout: @config.rpcs.generate_secret.timeout,
1412
+ metadata: call_metadata,
1413
+ retry_policy: @config.rpcs.generate_secret.retry_policy
1414
+
1415
+ options.apply_defaults timeout: @config.timeout,
1416
+ metadata: @config.metadata,
1417
+ retry_policy: @config.retry_policy
1418
+
1419
+ @feeds_service_stub.generate_secret request, options do |result, operation|
1420
+ yield result, operation if block_given?
1421
+ end
1422
+ rescue ::Gapic::Rest::Error => e
1423
+ raise ::Google::Cloud::Error.from_error(e)
1424
+ end
1425
+
1426
+ ##
1427
+ # Configuration class for the FeedsService REST API.
1428
+ #
1429
+ # This class represents the configuration for FeedsService REST,
1430
+ # providing control over timeouts, retry behavior, logging, transport
1431
+ # parameters, and other low-level controls. Certain parameters can also be
1432
+ # applied individually to specific RPCs. See
1433
+ # {::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client::Configuration::Rpcs}
1434
+ # for a list of RPCs that can be configured independently.
1435
+ #
1436
+ # Configuration can be applied globally to all clients, or to a single client
1437
+ # on construction.
1438
+ #
1439
+ # @example
1440
+ #
1441
+ # # Modify the global config, setting the timeout for
1442
+ # # fetch_service_account_for_customer to 20 seconds,
1443
+ # # and all remaining timeouts to 10 seconds.
1444
+ # ::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.configure do |config|
1445
+ # config.timeout = 10.0
1446
+ # config.rpcs.fetch_service_account_for_customer.timeout = 20.0
1447
+ # end
1448
+ #
1449
+ # # Apply the above configuration only to a new client.
1450
+ # client = ::Google::Cloud::Chronicle::V1::FeedsService::Rest::Client.new do |config|
1451
+ # config.timeout = 10.0
1452
+ # config.rpcs.fetch_service_account_for_customer.timeout = 20.0
1453
+ # end
1454
+ #
1455
+ # @!attribute [rw] endpoint
1456
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1457
+ # nil, indicating to use the default endpoint in the current universe domain.
1458
+ # @return [::String,nil]
1459
+ # @!attribute [rw] credentials
1460
+ # Credentials to send with calls. You may provide any of the following types:
1461
+ # * (`String`) The path to a service account key file in JSON format
1462
+ # * (`Hash`) A service account key as a Hash
1463
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1464
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1465
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1466
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1467
+ # * (`nil`) indicating no credentials
1468
+ #
1469
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1470
+ # external source for authentication to Google Cloud, you must validate it before
1471
+ # providing it to a Google API client library. Providing an unvalidated credential
1472
+ # configuration to Google APIs can compromise the security of your systems and data.
1473
+ # For more information, refer to [Validate credential configurations from external
1474
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1475
+ # @return [::Object]
1476
+ # @!attribute [rw] scope
1477
+ # The OAuth scopes
1478
+ # @return [::Array<::String>]
1479
+ # @!attribute [rw] lib_name
1480
+ # The library name as recorded in instrumentation and logging
1481
+ # @return [::String]
1482
+ # @!attribute [rw] lib_version
1483
+ # The library version as recorded in instrumentation and logging
1484
+ # @return [::String]
1485
+ # @!attribute [rw] timeout
1486
+ # The call timeout in seconds.
1487
+ # @return [::Numeric]
1488
+ # @!attribute [rw] metadata
1489
+ # Additional headers to be sent with the call.
1490
+ # @return [::Hash{::Symbol=>::String}]
1491
+ # @!attribute [rw] retry_policy
1492
+ # The retry policy. The value is a hash with the following keys:
1493
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1494
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1495
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1496
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1497
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1498
+ # trigger a retry.
1499
+ # @return [::Hash]
1500
+ # @!attribute [rw] quota_project
1501
+ # A separate project against which to charge quota.
1502
+ # @return [::String]
1503
+ # @!attribute [rw] universe_domain
1504
+ # The universe domain within which to make requests. This determines the
1505
+ # default endpoint URL. The default value of nil uses the environment
1506
+ # universe (usually the default "googleapis.com" universe).
1507
+ # @return [::String,nil]
1508
+ # @!attribute [rw] logger
1509
+ # A custom logger to use for request/response debug logging, or the value
1510
+ # `:default` (the default) to construct a default logger, or `nil` to
1511
+ # explicitly disable logging.
1512
+ # @return [::Logger,:default,nil]
1513
+ #
1514
+ class Configuration
1515
+ extend ::Gapic::Config
1516
+
1517
+ # @private
1518
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1519
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
1520
+
1521
+ config_attr :endpoint, nil, ::String, nil
1522
+ config_attr :credentials, nil do |value|
1523
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1524
+ allowed.any? { |klass| klass === value }
1525
+ end
1526
+ config_attr :scope, nil, ::String, ::Array, nil
1527
+ config_attr :lib_name, nil, ::String, nil
1528
+ config_attr :lib_version, nil, ::String, nil
1529
+ config_attr :timeout, nil, ::Numeric, nil
1530
+ config_attr :metadata, nil, ::Hash, nil
1531
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1532
+ config_attr :quota_project, nil, ::String, nil
1533
+ config_attr :universe_domain, nil, ::String, nil
1534
+ config_attr :logger, :default, ::Logger, nil, :default
1535
+
1536
+ # @private
1537
+ def initialize parent_config = nil
1538
+ @parent_config = parent_config unless parent_config.nil?
1539
+
1540
+ yield self if block_given?
1541
+ end
1542
+
1543
+ ##
1544
+ # Configurations for individual RPCs
1545
+ # @return [Rpcs]
1546
+ #
1547
+ def rpcs
1548
+ @rpcs ||= begin
1549
+ parent_rpcs = nil
1550
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1551
+ Rpcs.new parent_rpcs
1552
+ end
1553
+ end
1554
+
1555
+ ##
1556
+ # Configuration RPC class for the FeedsService API.
1557
+ #
1558
+ # Includes fields providing the configuration for each RPC in this service.
1559
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1560
+ # the following configuration fields:
1561
+ #
1562
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1563
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1564
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1565
+ # include the following keys:
1566
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1567
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1568
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1569
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1570
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1571
+ # trigger a retry.
1572
+ #
1573
+ class Rpcs
1574
+ ##
1575
+ # RPC-specific configuration for `fetch_service_account_for_customer`
1576
+ # @return [::Gapic::Config::Method]
1577
+ #
1578
+ attr_reader :fetch_service_account_for_customer
1579
+ ##
1580
+ # RPC-specific configuration for `create_feed`
1581
+ # @return [::Gapic::Config::Method]
1582
+ #
1583
+ attr_reader :create_feed
1584
+ ##
1585
+ # RPC-specific configuration for `get_feed`
1586
+ # @return [::Gapic::Config::Method]
1587
+ #
1588
+ attr_reader :get_feed
1589
+ ##
1590
+ # RPC-specific configuration for `delete_feed`
1591
+ # @return [::Gapic::Config::Method]
1592
+ #
1593
+ attr_reader :delete_feed
1594
+ ##
1595
+ # RPC-specific configuration for `enable_feed`
1596
+ # @return [::Gapic::Config::Method]
1597
+ #
1598
+ attr_reader :enable_feed
1599
+ ##
1600
+ # RPC-specific configuration for `disable_feed`
1601
+ # @return [::Gapic::Config::Method]
1602
+ #
1603
+ attr_reader :disable_feed
1604
+ ##
1605
+ # RPC-specific configuration for `list_feeds`
1606
+ # @return [::Gapic::Config::Method]
1607
+ #
1608
+ attr_reader :list_feeds
1609
+ ##
1610
+ # RPC-specific configuration for `list_feed_packs`
1611
+ # @return [::Gapic::Config::Method]
1612
+ #
1613
+ attr_reader :list_feed_packs
1614
+ ##
1615
+ # RPC-specific configuration for `get_feed_pack`
1616
+ # @return [::Gapic::Config::Method]
1617
+ #
1618
+ attr_reader :get_feed_pack
1619
+ ##
1620
+ # RPC-specific configuration for `update_feed`
1621
+ # @return [::Gapic::Config::Method]
1622
+ #
1623
+ attr_reader :update_feed
1624
+ ##
1625
+ # RPC-specific configuration for `list_feed_source_type_schemas`
1626
+ # @return [::Gapic::Config::Method]
1627
+ #
1628
+ attr_reader :list_feed_source_type_schemas
1629
+ ##
1630
+ # RPC-specific configuration for `list_log_type_schemas`
1631
+ # @return [::Gapic::Config::Method]
1632
+ #
1633
+ attr_reader :list_log_type_schemas
1634
+ ##
1635
+ # RPC-specific configuration for `import_push_logs`
1636
+ # @return [::Gapic::Config::Method]
1637
+ #
1638
+ attr_reader :import_push_logs
1639
+ ##
1640
+ # RPC-specific configuration for `generate_secret`
1641
+ # @return [::Gapic::Config::Method]
1642
+ #
1643
+ attr_reader :generate_secret
1644
+
1645
+ # @private
1646
+ def initialize parent_rpcs = nil
1647
+ fetch_service_account_for_customer_config = parent_rpcs.fetch_service_account_for_customer if parent_rpcs.respond_to? :fetch_service_account_for_customer
1648
+ @fetch_service_account_for_customer = ::Gapic::Config::Method.new fetch_service_account_for_customer_config
1649
+ create_feed_config = parent_rpcs.create_feed if parent_rpcs.respond_to? :create_feed
1650
+ @create_feed = ::Gapic::Config::Method.new create_feed_config
1651
+ get_feed_config = parent_rpcs.get_feed if parent_rpcs.respond_to? :get_feed
1652
+ @get_feed = ::Gapic::Config::Method.new get_feed_config
1653
+ delete_feed_config = parent_rpcs.delete_feed if parent_rpcs.respond_to? :delete_feed
1654
+ @delete_feed = ::Gapic::Config::Method.new delete_feed_config
1655
+ enable_feed_config = parent_rpcs.enable_feed if parent_rpcs.respond_to? :enable_feed
1656
+ @enable_feed = ::Gapic::Config::Method.new enable_feed_config
1657
+ disable_feed_config = parent_rpcs.disable_feed if parent_rpcs.respond_to? :disable_feed
1658
+ @disable_feed = ::Gapic::Config::Method.new disable_feed_config
1659
+ list_feeds_config = parent_rpcs.list_feeds if parent_rpcs.respond_to? :list_feeds
1660
+ @list_feeds = ::Gapic::Config::Method.new list_feeds_config
1661
+ list_feed_packs_config = parent_rpcs.list_feed_packs if parent_rpcs.respond_to? :list_feed_packs
1662
+ @list_feed_packs = ::Gapic::Config::Method.new list_feed_packs_config
1663
+ get_feed_pack_config = parent_rpcs.get_feed_pack if parent_rpcs.respond_to? :get_feed_pack
1664
+ @get_feed_pack = ::Gapic::Config::Method.new get_feed_pack_config
1665
+ update_feed_config = parent_rpcs.update_feed if parent_rpcs.respond_to? :update_feed
1666
+ @update_feed = ::Gapic::Config::Method.new update_feed_config
1667
+ list_feed_source_type_schemas_config = parent_rpcs.list_feed_source_type_schemas if parent_rpcs.respond_to? :list_feed_source_type_schemas
1668
+ @list_feed_source_type_schemas = ::Gapic::Config::Method.new list_feed_source_type_schemas_config
1669
+ list_log_type_schemas_config = parent_rpcs.list_log_type_schemas if parent_rpcs.respond_to? :list_log_type_schemas
1670
+ @list_log_type_schemas = ::Gapic::Config::Method.new list_log_type_schemas_config
1671
+ import_push_logs_config = parent_rpcs.import_push_logs if parent_rpcs.respond_to? :import_push_logs
1672
+ @import_push_logs = ::Gapic::Config::Method.new import_push_logs_config
1673
+ generate_secret_config = parent_rpcs.generate_secret if parent_rpcs.respond_to? :generate_secret
1674
+ @generate_secret = ::Gapic::Config::Method.new generate_secret_config
1675
+
1676
+ yield self if block_given?
1677
+ end
1678
+ end
1679
+ end
1680
+ end
1681
+ end
1682
+ end
1683
+ end
1684
+ end
1685
+ end
1686
+ end