google-cloud-chronicle-v1 1.3.0 → 1.5.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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/chronicle/v1/curated_rule_pb.rb +31 -0
  3. data/lib/google/cloud/chronicle/v1/entity_pb.rb +6 -1
  4. data/lib/google/cloud/chronicle/v1/event_pb.rb +24 -0
  5. data/lib/google/cloud/chronicle/v1/featured_content_rule_pb.rb +33 -0
  6. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/client.rb +540 -0
  7. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/credentials.rb +49 -0
  8. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/paths.rb +52 -0
  9. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/rest/client.rb +490 -0
  10. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/rest/service_stub.rb +142 -0
  11. data/lib/google/cloud/chronicle/v1/featured_content_rule_service/rest.rb +53 -0
  12. data/lib/google/cloud/chronicle/v1/featured_content_rule_service.rb +56 -0
  13. data/lib/google/cloud/chronicle/v1/featured_content_rule_services_pb.rb +46 -0
  14. data/lib/google/cloud/chronicle/v1/rest.rb +3 -1
  15. data/lib/google/cloud/chronicle/v1/rule_execution_error_pb.rb +1 -1
  16. data/lib/google/cloud/chronicle/v1/search_pb.rb +64 -0
  17. data/lib/google/cloud/chronicle/v1/search_service/client.rb +643 -0
  18. data/lib/google/cloud/chronicle/v1/search_service/credentials.rb +49 -0
  19. data/lib/google/cloud/chronicle/v1/search_service/operations.rb +843 -0
  20. data/lib/google/cloud/chronicle/v1/search_service/paths.rb +94 -0
  21. data/lib/google/cloud/chronicle/v1/search_service/rest/client.rb +586 -0
  22. data/lib/google/cloud/chronicle/v1/search_service/rest/operations.rb +927 -0
  23. data/lib/google/cloud/chronicle/v1/search_service/rest/service_stub.rb +204 -0
  24. data/lib/google/cloud/chronicle/v1/search_service/rest.rb +53 -0
  25. data/lib/google/cloud/chronicle/v1/search_service.rb +56 -0
  26. data/lib/google/cloud/chronicle/v1/search_services_pb.rb +47 -0
  27. data/lib/google/cloud/chronicle/v1/simulated_data_pb.rb +21 -0
  28. data/lib/google/cloud/chronicle/v1/version.rb +1 -1
  29. data/lib/google/cloud/chronicle/v1.rb +3 -1
  30. data/proto_docs/backstory/collection.rb +371 -0
  31. data/proto_docs/backstory/data_access.rb +59 -0
  32. data/proto_docs/backstory/entity.rb +639 -0
  33. data/proto_docs/backstory/entity_risk.rb +98 -0
  34. data/proto_docs/backstory/id.rb +73 -0
  35. data/proto_docs/backstory/udm.rb +7008 -0
  36. data/proto_docs/google/cloud/chronicle/v1/curated_rule.rb +117 -0
  37. data/proto_docs/google/cloud/chronicle/v1/entity.rb +38 -0
  38. data/proto_docs/google/cloud/chronicle/v1/event.rb +42 -0
  39. data/proto_docs/google/cloud/chronicle/v1/featured_content_rule.rb +208 -0
  40. data/proto_docs/google/cloud/chronicle/v1/search.rb +593 -0
  41. data/proto_docs/google/cloud/chronicle/v1/simulated_data.rb +40 -0
  42. data/proto_docs/google/protobuf/struct.rb +108 -0
  43. data/proto_docs/google/type/latlng.rb +38 -0
  44. metadata +57 -1
@@ -0,0 +1,490 @@
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/featured_content_rule_pb"
21
+ require "google/cloud/chronicle/v1/featured_content_rule_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Chronicle
26
+ module V1
27
+ module FeaturedContentRuleService
28
+ module Rest
29
+ ##
30
+ # REST client for the FeaturedContentRuleService service.
31
+ #
32
+ # This service provides functionality for managing
33
+ # FeaturedContentRule.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "chronicle.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :featured_content_rule_service_stub
46
+
47
+ ##
48
+ # Configure the FeaturedContentRuleService Client class.
49
+ #
50
+ # See {::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all FeaturedContentRuleService clients
56
+ # ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "Chronicle", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.rpcs.list_featured_content_rules.timeout = 60.0
77
+ default_config.rpcs.list_featured_content_rules.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the FeaturedContentRuleService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @featured_content_rule_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new FeaturedContentRuleService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the FeaturedContentRuleService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @featured_content_rule_service_stub = ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::ServiceStub.new(
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ credentials: credentials,
160
+ logger: @config.logger
161
+ )
162
+
163
+ @featured_content_rule_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @featured_content_rule_service_stub.logger
181
+ end
182
+
183
+ # Service calls
184
+
185
+ ##
186
+ # Lists FeaturedContentRules
187
+ #
188
+ # @overload list_featured_content_rules(request, options = nil)
189
+ # Pass arguments to `list_featured_content_rules` via a request object, either of type
190
+ # {::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest} or an equivalent Hash.
191
+ #
192
+ # @param request [::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest, ::Hash]
193
+ # A request object representing the call parameters. Required. To specify no
194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
195
+ # @param options [::Gapic::CallOptions, ::Hash]
196
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
+ #
198
+ # @overload list_featured_content_rules(parent: nil, page_size: nil, page_token: nil, filter: nil)
199
+ # Pass arguments to `list_featured_content_rules` via keyword arguments. Note that at
200
+ # least one keyword argument is required. To specify no parameters, or to keep all
201
+ # the default parameter values, pass an empty Hash as a request object (see above).
202
+ #
203
+ # @param parent [::String]
204
+ # Required. The parent which owns this collection of FeaturedContentRules.
205
+ # Format:
206
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/contentHub
207
+ # @param page_size [::Integer]
208
+ # Optional. The maximum number of featured contents to return. The service
209
+ # may return fewer than this value. If unspecified, at most 100 featured
210
+ # contents will be returned. The maximum value is 1000; values above 1000
211
+ # will be coerced to 100.
212
+ # @param page_token [::String]
213
+ # Optional. A page token, received from a previous `ListFeaturedContentRules`
214
+ # call. Provide this to retrieve the subsequent page.
215
+ # @param filter [::String]
216
+ # Optional. Only the following filters are allowed:
217
+ # Under HAS operator: Filtering through category names:
218
+ # - Singular: `category_name:"<category_name>"`
219
+ # - Multiple: `category_name:"<category_name1>" OR
220
+ # category_name:"<category_name2>"`
221
+ # -- You can only use OR operator between multiple category_name filters.
222
+ #
223
+ # Filtering through policy names:
224
+ # - Singular: `policy_name:"<policy_name>"`
225
+ # - Multiple: `policy_name:"<policy_name1>" OR
226
+ # policy_name:"<policy_name2>"`
227
+ # -- You can only use OR operator between multiple policy_name filters.
228
+ #
229
+ # Filtering through rule IDs:
230
+ # - Singular: `rule_id:"ur_<id>"`
231
+ # - Multiple: `rule_id:"ur_<rule_id1>" OR rule_id:"ur_<rule_id2>"`
232
+ # -- You can only use OR operator between multiple rule_id filters.
233
+ #
234
+ # Filtering through rule precision: `rule_precision:"<rule_precision>"`
235
+ # -- Rule precision values can be "Precise" or "Broad". If something else
236
+ # is passed, the rule precision will default to "Unknown". You can only
237
+ # filter by one rule precision value.
238
+ #
239
+ # Under MATCHES_REGEXP operator: Search through rule name or description
240
+ # (behaves like a string contains): This search is case-insensitive and
241
+ # filters through the rule metadata, specifically the rule_name and
242
+ # description keys. `search_rule_name_or_description=~"<rule_name> or
243
+ # <rule_description>"`. You can only filter by one rule name or description
244
+ # value.
245
+ #
246
+ # Multiple filters can also be used together:
247
+ # Ex 1: `category_name:"<category_name>" AND policy_name:"<policy_name>"`
248
+ # Ex 2: Since category_name and policy_name are repeated fields, we can also
249
+ # use multiple values for each:
250
+ # `(category_name:"<category_name1>" OR category_name:"<category_name2>")
251
+ # AND policy_name:"<policy_name>"`
252
+ # -- Note that the AND operator has higher precedence than the OR operator.
253
+ # Additionally, parentheses must be used to create a valid filter.
254
+ #
255
+ # Requests using filter comparators other than HAS(:) or MATCHES_REGEXP(=~)
256
+ # will result in an InvalidArgument error.
257
+ # @yield [result, operation] Access the result along with the TransportOperation object
258
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentRule>]
259
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
260
+ #
261
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::FeaturedContentRule>]
262
+ #
263
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
264
+ #
265
+ # @example Basic example
266
+ # require "google/cloud/chronicle/v1"
267
+ #
268
+ # # Create a client object. The client can be reused for multiple calls.
269
+ # client = Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.new
270
+ #
271
+ # # Create a request. To set request fields, pass in keyword arguments.
272
+ # request = Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest.new
273
+ #
274
+ # # Call the list_featured_content_rules method.
275
+ # result = client.list_featured_content_rules request
276
+ #
277
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
278
+ # # over elements, and API calls will be issued to fetch pages as needed.
279
+ # result.each do |item|
280
+ # # Each element is of type ::Google::Cloud::Chronicle::V1::FeaturedContentRule.
281
+ # p item
282
+ # end
283
+ #
284
+ def list_featured_content_rules request, options = nil
285
+ raise ::ArgumentError, "request must be provided" if request.nil?
286
+
287
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest
288
+
289
+ # Converts hash and nil to an options object
290
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
291
+
292
+ # Customize the options with defaults
293
+ call_metadata = @config.rpcs.list_featured_content_rules.metadata.to_h
294
+
295
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
296
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
297
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
298
+ gapic_version: ::Google::Cloud::Chronicle::V1::VERSION,
299
+ transports_version_send: [:rest]
300
+
301
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
302
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
+
304
+ options.apply_defaults timeout: @config.rpcs.list_featured_content_rules.timeout,
305
+ metadata: call_metadata,
306
+ retry_policy: @config.rpcs.list_featured_content_rules.retry_policy
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @featured_content_rule_service_stub.list_featured_content_rules request, options do |result, operation|
313
+ result = ::Gapic::Rest::PagedEnumerable.new @featured_content_rule_service_stub, :list_featured_content_rules, "featured_content_rules", request, result, options
314
+ yield result, operation if block_given?
315
+ throw :response, result
316
+ end
317
+ rescue ::Gapic::Rest::Error => e
318
+ raise ::Google::Cloud::Error.from_error(e)
319
+ end
320
+
321
+ ##
322
+ # Configuration class for the FeaturedContentRuleService REST API.
323
+ #
324
+ # This class represents the configuration for FeaturedContentRuleService REST,
325
+ # providing control over timeouts, retry behavior, logging, transport
326
+ # parameters, and other low-level controls. Certain parameters can also be
327
+ # applied individually to specific RPCs. See
328
+ # {::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client::Configuration::Rpcs}
329
+ # for a list of RPCs that can be configured independently.
330
+ #
331
+ # Configuration can be applied globally to all clients, or to a single client
332
+ # on construction.
333
+ #
334
+ # @example
335
+ #
336
+ # # Modify the global config, setting the timeout for
337
+ # # list_featured_content_rules to 20 seconds,
338
+ # # and all remaining timeouts to 10 seconds.
339
+ # ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.configure do |config|
340
+ # config.timeout = 10.0
341
+ # config.rpcs.list_featured_content_rules.timeout = 20.0
342
+ # end
343
+ #
344
+ # # Apply the above configuration only to a new client.
345
+ # client = ::Google::Cloud::Chronicle::V1::FeaturedContentRuleService::Rest::Client.new do |config|
346
+ # config.timeout = 10.0
347
+ # config.rpcs.list_featured_content_rules.timeout = 20.0
348
+ # end
349
+ #
350
+ # @!attribute [rw] endpoint
351
+ # A custom service endpoint, as a hostname or hostname:port. The default is
352
+ # nil, indicating to use the default endpoint in the current universe domain.
353
+ # @return [::String,nil]
354
+ # @!attribute [rw] credentials
355
+ # Credentials to send with calls. You may provide any of the following types:
356
+ # * (`String`) The path to a service account key file in JSON format
357
+ # * (`Hash`) A service account key as a Hash
358
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
359
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
360
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
361
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
362
+ # * (`nil`) indicating no credentials
363
+ #
364
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
365
+ # external source for authentication to Google Cloud, you must validate it before
366
+ # providing it to a Google API client library. Providing an unvalidated credential
367
+ # configuration to Google APIs can compromise the security of your systems and data.
368
+ # For more information, refer to [Validate credential configurations from external
369
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
370
+ # @return [::Object]
371
+ # @!attribute [rw] scope
372
+ # The OAuth scopes
373
+ # @return [::Array<::String>]
374
+ # @!attribute [rw] lib_name
375
+ # The library name as recorded in instrumentation and logging
376
+ # @return [::String]
377
+ # @!attribute [rw] lib_version
378
+ # The library version as recorded in instrumentation and logging
379
+ # @return [::String]
380
+ # @!attribute [rw] timeout
381
+ # The call timeout in seconds.
382
+ # @return [::Numeric]
383
+ # @!attribute [rw] metadata
384
+ # Additional headers to be sent with the call.
385
+ # @return [::Hash{::Symbol=>::String}]
386
+ # @!attribute [rw] retry_policy
387
+ # The retry policy. The value is a hash with the following keys:
388
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
389
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
390
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
391
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
392
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
393
+ # trigger a retry.
394
+ # @return [::Hash]
395
+ # @!attribute [rw] quota_project
396
+ # A separate project against which to charge quota.
397
+ # @return [::String]
398
+ # @!attribute [rw] universe_domain
399
+ # The universe domain within which to make requests. This determines the
400
+ # default endpoint URL. The default value of nil uses the environment
401
+ # universe (usually the default "googleapis.com" universe).
402
+ # @return [::String,nil]
403
+ # @!attribute [rw] logger
404
+ # A custom logger to use for request/response debug logging, or the value
405
+ # `:default` (the default) to construct a default logger, or `nil` to
406
+ # explicitly disable logging.
407
+ # @return [::Logger,:default,nil]
408
+ #
409
+ class Configuration
410
+ extend ::Gapic::Config
411
+
412
+ # @private
413
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
414
+ DEFAULT_ENDPOINT = "chronicle.googleapis.com"
415
+
416
+ config_attr :endpoint, nil, ::String, nil
417
+ config_attr :credentials, nil do |value|
418
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
419
+ allowed.any? { |klass| klass === value }
420
+ end
421
+ config_attr :scope, nil, ::String, ::Array, nil
422
+ config_attr :lib_name, nil, ::String, nil
423
+ config_attr :lib_version, nil, ::String, nil
424
+ config_attr :timeout, nil, ::Numeric, nil
425
+ config_attr :metadata, nil, ::Hash, nil
426
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
427
+ config_attr :quota_project, nil, ::String, nil
428
+ config_attr :universe_domain, nil, ::String, nil
429
+ config_attr :logger, :default, ::Logger, nil, :default
430
+
431
+ # @private
432
+ def initialize parent_config = nil
433
+ @parent_config = parent_config unless parent_config.nil?
434
+
435
+ yield self if block_given?
436
+ end
437
+
438
+ ##
439
+ # Configurations for individual RPCs
440
+ # @return [Rpcs]
441
+ #
442
+ def rpcs
443
+ @rpcs ||= begin
444
+ parent_rpcs = nil
445
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
446
+ Rpcs.new parent_rpcs
447
+ end
448
+ end
449
+
450
+ ##
451
+ # Configuration RPC class for the FeaturedContentRuleService API.
452
+ #
453
+ # Includes fields providing the configuration for each RPC in this service.
454
+ # Each configuration object is of type `Gapic::Config::Method` and includes
455
+ # the following configuration fields:
456
+ #
457
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
458
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
459
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
460
+ # include the following keys:
461
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
462
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
463
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
464
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
465
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
466
+ # trigger a retry.
467
+ #
468
+ class Rpcs
469
+ ##
470
+ # RPC-specific configuration for `list_featured_content_rules`
471
+ # @return [::Gapic::Config::Method]
472
+ #
473
+ attr_reader :list_featured_content_rules
474
+
475
+ # @private
476
+ def initialize parent_rpcs = nil
477
+ list_featured_content_rules_config = parent_rpcs.list_featured_content_rules if parent_rpcs.respond_to? :list_featured_content_rules
478
+ @list_featured_content_rules = ::Gapic::Config::Method.new list_featured_content_rules_config
479
+
480
+ yield self if block_given?
481
+ end
482
+ end
483
+ end
484
+ end
485
+ end
486
+ end
487
+ end
488
+ end
489
+ end
490
+ end
@@ -0,0 +1,142 @@
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/chronicle/v1/featured_content_rule_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Chronicle
24
+ module V1
25
+ module FeaturedContentRuleService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the FeaturedContentRuleService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the list_featured_content_rules REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesResponse]
89
+ # A result object deserialized from the server's reply
90
+ def list_featured_content_rules request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_featured_content_rules_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_featured_content_rules",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the list_featured_content_rules REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Chronicle::V1::ListFeaturedContentRulesRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_list_featured_content_rules_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :get,
129
+ uri_template: "/v1/{parent}/featuredContentRules",
130
+ matches: [
131
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/contentHub/?$}, false]
132
+ ]
133
+ )
134
+ transcoder.transcode request_pb
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end