google-cloud-service_health-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/service_health/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/service_health/v1/rest.rb +38 -0
  7. data/lib/google/cloud/service_health/v1/service_health/client.rb +1084 -0
  8. data/lib/google/cloud/service_health/v1/service_health/credentials.rb +47 -0
  9. data/lib/google/cloud/service_health/v1/service_health/paths.rb +124 -0
  10. data/lib/google/cloud/service_health/v1/service_health/rest/client.rb +1021 -0
  11. data/lib/google/cloud/service_health/v1/service_health/rest/service_stub.rb +423 -0
  12. data/lib/google/cloud/service_health/v1/service_health/rest.rb +53 -0
  13. data/lib/google/cloud/service_health/v1/service_health.rb +55 -0
  14. data/lib/google/cloud/service_health/v1/version.rb +7 -2
  15. data/lib/google/cloud/service_health/v1.rb +45 -0
  16. data/lib/google/cloud/servicehealth/v1/event_resources_pb.rb +74 -0
  17. data/lib/google/cloud/servicehealth/v1/event_service_pb.rb +45 -0
  18. data/lib/google/cloud/servicehealth/v1/event_service_services_pb.rb +58 -0
  19. data/lib/google-cloud-service_health-v1.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/client.rb +395 -0
  22. data/proto_docs/google/api/field_behavior.rb +85 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +222 -0
  25. data/proto_docs/google/cloud/servicehealth/v1/event_resources.rb +694 -0
  26. data/proto_docs/google/protobuf/any.rb +144 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  29. metadata +202 -10
@@ -0,0 +1,1084 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/servicehealth/v1/event_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ServiceHealth
26
+ module V1
27
+ module ServiceHealth
28
+ ##
29
+ # Client for the ServiceHealth service.
30
+ #
31
+ # Request service health events relevant to your Google Cloud project.
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "servicehealth.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :service_health_stub
41
+
42
+ ##
43
+ # Configure the ServiceHealth Client class.
44
+ #
45
+ # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all ServiceHealth clients
51
+ # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "ServiceHealth", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.list_events.timeout = 60.0
72
+ default_config.rpcs.list_events.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.get_event.timeout = 60.0
77
+ default_config.rpcs.get_event.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.list_organization_events.timeout = 60.0
82
+ default_config.rpcs.list_organization_events.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.get_organization_event.timeout = 60.0
87
+ default_config.rpcs.get_organization_event.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.list_organization_impacts.timeout = 60.0
92
+ default_config.rpcs.list_organization_impacts.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.get_organization_impact.timeout = 60.0
97
+ default_config.rpcs.get_organization_impact.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config
102
+ end
103
+ yield @configure if block_given?
104
+ @configure
105
+ end
106
+
107
+ ##
108
+ # Configure the ServiceHealth Client instance.
109
+ #
110
+ # The configuration is set to the derived mode, meaning that values can be changed,
111
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
112
+ # should be made on {Client.configure}.
113
+ #
114
+ # See {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration}
115
+ # for a description of the configuration fields.
116
+ #
117
+ # @yield [config] Configure the Client client.
118
+ # @yieldparam config [Client::Configuration]
119
+ #
120
+ # @return [Client::Configuration]
121
+ #
122
+ def configure
123
+ yield @config if block_given?
124
+ @config
125
+ end
126
+
127
+ ##
128
+ # The effective universe domain
129
+ #
130
+ # @return [String]
131
+ #
132
+ def universe_domain
133
+ @service_health_stub.universe_domain
134
+ end
135
+
136
+ ##
137
+ # Create a new ServiceHealth client object.
138
+ #
139
+ # @example
140
+ #
141
+ # # Create a client using the default configuration
142
+ # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
143
+ #
144
+ # # Create a client using a custom configuration
145
+ # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config|
146
+ # config.timeout = 10.0
147
+ # end
148
+ #
149
+ # @yield [config] Configure the ServiceHealth client.
150
+ # @yieldparam config [Client::Configuration]
151
+ #
152
+ def initialize
153
+ # These require statements are intentionally placed here to initialize
154
+ # the gRPC module only when it's required.
155
+ # See https://github.com/googleapis/toolkit/issues/446
156
+ require "gapic/grpc"
157
+ require "google/cloud/servicehealth/v1/event_service_services_pb"
158
+
159
+ # Create the configuration object
160
+ @config = Configuration.new Client.configure
161
+
162
+ # Yield the configuration if needed
163
+ yield @config if block_given?
164
+
165
+ # Create credentials
166
+ credentials = @config.credentials
167
+ # Use self-signed JWT if the endpoint is unchanged from default,
168
+ # but only if the default endpoint does not have a region prefix.
169
+ enable_self_signed_jwt = @config.endpoint.nil? ||
170
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
171
+ !@config.endpoint.split(".").first.include?("-"))
172
+ credentials ||= Credentials.default scope: @config.scope,
173
+ enable_self_signed_jwt: enable_self_signed_jwt
174
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
175
+ credentials = Credentials.new credentials, scope: @config.scope
176
+ end
177
+ @quota_project_id = @config.quota_project
178
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
179
+
180
+ @service_health_stub = ::Gapic::ServiceStub.new(
181
+ ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Stub,
182
+ credentials: credentials,
183
+ endpoint: @config.endpoint,
184
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
185
+ universe_domain: @config.universe_domain,
186
+ channel_args: @config.channel_args,
187
+ interceptors: @config.interceptors,
188
+ channel_pool_config: @config.channel_pool
189
+ )
190
+
191
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
192
+ config.credentials = credentials
193
+ config.quota_project = @quota_project_id
194
+ config.endpoint = @service_health_stub.endpoint
195
+ config.universe_domain = @service_health_stub.universe_domain
196
+ end
197
+ end
198
+
199
+ ##
200
+ # Get the associated client for mix-in of the Locations.
201
+ #
202
+ # @return [Google::Cloud::Location::Locations::Client]
203
+ #
204
+ attr_reader :location_client
205
+
206
+ # Service calls
207
+
208
+ ##
209
+ # Lists events under a given project and location.
210
+ #
211
+ # @overload list_events(request, options = nil)
212
+ # Pass arguments to `list_events` via a request object, either of type
213
+ # {::Google::Cloud::ServiceHealth::V1::ListEventsRequest} or an equivalent Hash.
214
+ #
215
+ # @param request [::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::Hash]
216
+ # A request object representing the call parameters. Required. To specify no
217
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
218
+ # @param options [::Gapic::CallOptions, ::Hash]
219
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
220
+ #
221
+ # @overload list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil)
222
+ # Pass arguments to `list_events` via keyword arguments. Note that at
223
+ # least one keyword argument is required. To specify no parameters, or to keep all
224
+ # the default parameter values, pass an empty Hash as a request object (see above).
225
+ #
226
+ # @param parent [::String]
227
+ # Required. Parent value using the form
228
+ # `projects/{project_id}/locations/{location}/events`.
229
+ #
230
+ # `project_id` - ID of the project for which to list service health
231
+ # events.
232
+ # `location` - The location to get the service health events from.
233
+ # To retrieve service health events of category = INCIDENT, use `location` =
234
+ # `global`.
235
+ # @param page_size [::Integer]
236
+ # Optional. The maximum number of events that should be returned. Acceptable
237
+ # values are 1 to 100, inclusive. (The default value is 10.) If more results
238
+ # are available, the service returns a next_page_token that you can use to
239
+ # get the next page of results in subsequent list requests. The service may
240
+ # return fewer events than the requested page_size.
241
+ # @param page_token [::String]
242
+ # Optional. A token identifying a page of results the server should return.
243
+ # Provide Page token returned by a previous `ListEvents` call to retrieve the
244
+ # next page of results. When paginating, all other parameters provided to
245
+ # `ListEvents` must match the call that provided the page token.
246
+ # @param filter [::String]
247
+ # Optional. A filter expression that filters resources listed in the
248
+ # response. The expression takes the following forms: <br>
249
+ # * field=value for `category` and `state`<br>
250
+ # * field &lt;, >, &lt;=, or >= value for `update_time` <br>
251
+ # Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
252
+ # <br>
253
+ #
254
+ # Multiple filter queries are separated by spaces. Example:
255
+ # `category=INCIDENT state=ACTIVE`.
256
+ #
257
+ # By default, each expression is an AND expression. However, you can include
258
+ # AND and OR expressions explicitly.
259
+ #
260
+ # Filter is supported for the following fields: `category`, `state`,
261
+ # `update_time`
262
+ # @param view [::Google::Cloud::ServiceHealth::V1::EventView]
263
+ # Optional. Event fields to include in response.
264
+ #
265
+ # @yield [response, operation] Access the result along with the RPC operation
266
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>]
267
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
268
+ #
269
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>]
270
+ #
271
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
272
+ #
273
+ # @example Basic example
274
+ # require "google/cloud/service_health/v1"
275
+ #
276
+ # # Create a client object. The client can be reused for multiple calls.
277
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
278
+ #
279
+ # # Create a request. To set request fields, pass in keyword arguments.
280
+ # request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new
281
+ #
282
+ # # Call the list_events method.
283
+ # result = client.list_events request
284
+ #
285
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
286
+ # # over elements, and API calls will be issued to fetch pages as needed.
287
+ # result.each do |item|
288
+ # # Each element is of type ::Google::Cloud::ServiceHealth::V1::Event.
289
+ # p item
290
+ # end
291
+ #
292
+ def list_events request, options = nil
293
+ raise ::ArgumentError, "request must be provided" if request.nil?
294
+
295
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListEventsRequest
296
+
297
+ # Converts hash and nil to an options object
298
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
299
+
300
+ # Customize the options with defaults
301
+ metadata = @config.rpcs.list_events.metadata.to_h
302
+
303
+ # Set x-goog-api-client and x-goog-user-project headers
304
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
306
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
307
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ header_params = {}
310
+ if request.parent
311
+ header_params["parent"] = request.parent
312
+ end
313
+
314
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
315
+ metadata[:"x-goog-request-params"] ||= request_params_header
316
+
317
+ options.apply_defaults timeout: @config.rpcs.list_events.timeout,
318
+ metadata: metadata,
319
+ retry_policy: @config.rpcs.list_events.retry_policy
320
+
321
+ options.apply_defaults timeout: @config.timeout,
322
+ metadata: @config.metadata,
323
+ retry_policy: @config.retry_policy
324
+
325
+ @service_health_stub.call_rpc :list_events, request, options: options do |response, operation|
326
+ response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_events, request, response, operation, options
327
+ yield response, operation if block_given?
328
+ return response
329
+ end
330
+ rescue ::GRPC::BadStatus => e
331
+ raise ::Google::Cloud::Error.from_error(e)
332
+ end
333
+
334
+ ##
335
+ # Retrieves a resource containing information about an event.
336
+ #
337
+ # @overload get_event(request, options = nil)
338
+ # Pass arguments to `get_event` via a request object, either of type
339
+ # {::Google::Cloud::ServiceHealth::V1::GetEventRequest} or an equivalent Hash.
340
+ #
341
+ # @param request [::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::Hash]
342
+ # A request object representing the call parameters. Required. To specify no
343
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
344
+ # @param options [::Gapic::CallOptions, ::Hash]
345
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
346
+ #
347
+ # @overload get_event(name: nil)
348
+ # Pass arguments to `get_event` via keyword arguments. Note that at
349
+ # least one keyword argument is required. To specify no parameters, or to keep all
350
+ # the default parameter values, pass an empty Hash as a request object (see above).
351
+ #
352
+ # @param name [::String]
353
+ # Required. Unique name of the event in this scope including project
354
+ # and location using the form
355
+ # `projects/{project_id}/locations/{location}/events/{event_id}`.
356
+ #
357
+ # `project_id` - Project ID of the project that contains the event. <br>
358
+ # `location` - The location to get the service health events from. <br>
359
+ # `event_id` - Event ID to retrieve.
360
+ #
361
+ # @yield [response, operation] Access the result along with the RPC operation
362
+ # @yieldparam response [::Google::Cloud::ServiceHealth::V1::Event]
363
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
364
+ #
365
+ # @return [::Google::Cloud::ServiceHealth::V1::Event]
366
+ #
367
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
368
+ #
369
+ # @example Basic example
370
+ # require "google/cloud/service_health/v1"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new
377
+ #
378
+ # # Call the get_event method.
379
+ # result = client.get_event request
380
+ #
381
+ # # The returned object is of type Google::Cloud::ServiceHealth::V1::Event.
382
+ # p result
383
+ #
384
+ def get_event request, options = nil
385
+ raise ::ArgumentError, "request must be provided" if request.nil?
386
+
387
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetEventRequest
388
+
389
+ # Converts hash and nil to an options object
390
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
391
+
392
+ # Customize the options with defaults
393
+ metadata = @config.rpcs.get_event.metadata.to_h
394
+
395
+ # Set x-goog-api-client and x-goog-user-project headers
396
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
397
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
398
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ header_params = {}
402
+ if request.name
403
+ header_params["name"] = request.name
404
+ end
405
+
406
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
407
+ metadata[:"x-goog-request-params"] ||= request_params_header
408
+
409
+ options.apply_defaults timeout: @config.rpcs.get_event.timeout,
410
+ metadata: metadata,
411
+ retry_policy: @config.rpcs.get_event.retry_policy
412
+
413
+ options.apply_defaults timeout: @config.timeout,
414
+ metadata: @config.metadata,
415
+ retry_policy: @config.retry_policy
416
+
417
+ @service_health_stub.call_rpc :get_event, request, options: options do |response, operation|
418
+ yield response, operation if block_given?
419
+ return response
420
+ end
421
+ rescue ::GRPC::BadStatus => e
422
+ raise ::Google::Cloud::Error.from_error(e)
423
+ end
424
+
425
+ ##
426
+ # Lists organization events under a given organization and location.
427
+ #
428
+ # @overload list_organization_events(request, options = nil)
429
+ # Pass arguments to `list_organization_events` via a request object, either of type
430
+ # {::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest} or an equivalent Hash.
431
+ #
432
+ # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::Hash]
433
+ # A request object representing the call parameters. Required. To specify no
434
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
435
+ # @param options [::Gapic::CallOptions, ::Hash]
436
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
437
+ #
438
+ # @overload list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil)
439
+ # Pass arguments to `list_organization_events` via keyword arguments. Note that at
440
+ # least one keyword argument is required. To specify no parameters, or to keep all
441
+ # the default parameter values, pass an empty Hash as a request object (see above).
442
+ #
443
+ # @param parent [::String]
444
+ # Required. Parent value using the form
445
+ # `organizations/{organization_id}/locations/{location}/organizationEvents`.
446
+ #
447
+ # `organization_id` - ID (number) of the project that contains the event. To
448
+ # get your `organization_id`, see
449
+ # [Getting your organization resource
450
+ # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
451
+ # `location` - The location to get the service health events from. To
452
+ # retrieve service health events of category = INCIDENT, use `location` =
453
+ # `global`.
454
+ # @param page_size [::Integer]
455
+ # Optional. The maximum number of events that should be returned. Acceptable
456
+ # values are `1` to `100`, inclusive. (The default value is `10`.) If more
457
+ # results are available, the service returns a `next_page_token` that you can
458
+ # use to get the next page of results in subsequent list requests. The
459
+ # service may return fewer events than the requested `page_size`.
460
+ # @param page_token [::String]
461
+ # Optional. A token identifying a page of results the server should return.
462
+ #
463
+ # Provide Page token returned by a previous `ListOrganizationEvents` call to
464
+ # retrieve the next page of results.
465
+ #
466
+ # When paginating, all other parameters provided to
467
+ # `ListOrganizationEvents` must match the call that provided the page token.
468
+ # @param filter [::String]
469
+ # Optional. A filter expression that filters resources listed in the
470
+ # response. The expression takes the following forms:
471
+ #
472
+ # * field=value for `category` and `state`
473
+ # * field &lt;, >, &lt;=, or >= value for `update_time`
474
+ #
475
+ # Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
476
+ #
477
+ # Multiple filter queries are space-separated. Example:
478
+ # `category=INCIDENT state=ACTIVE`.
479
+ #
480
+ # By default, each expression is an AND expression. However, you can include
481
+ # AND and OR expressions explicitly.
482
+ #
483
+ # Filter is supported for the following fields: `category`, `state`,
484
+ # `update_time`
485
+ # @param view [::Google::Cloud::ServiceHealth::V1::OrganizationEventView]
486
+ # Optional. OrganizationEvent fields to include in response.
487
+ #
488
+ # @yield [response, operation] Access the result along with the RPC operation
489
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>]
490
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
491
+ #
492
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>]
493
+ #
494
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
495
+ #
496
+ # @example Basic example
497
+ # require "google/cloud/service_health/v1"
498
+ #
499
+ # # Create a client object. The client can be reused for multiple calls.
500
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
501
+ #
502
+ # # Create a request. To set request fields, pass in keyword arguments.
503
+ # request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new
504
+ #
505
+ # # Call the list_organization_events method.
506
+ # result = client.list_organization_events request
507
+ #
508
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
509
+ # # over elements, and API calls will be issued to fetch pages as needed.
510
+ # result.each do |item|
511
+ # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationEvent.
512
+ # p item
513
+ # end
514
+ #
515
+ def list_organization_events request, options = nil
516
+ raise ::ArgumentError, "request must be provided" if request.nil?
517
+
518
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest
519
+
520
+ # Converts hash and nil to an options object
521
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
522
+
523
+ # Customize the options with defaults
524
+ metadata = @config.rpcs.list_organization_events.metadata.to_h
525
+
526
+ # Set x-goog-api-client and x-goog-user-project headers
527
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
528
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
529
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
530
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
531
+
532
+ header_params = {}
533
+ if request.parent
534
+ header_params["parent"] = request.parent
535
+ end
536
+
537
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
538
+ metadata[:"x-goog-request-params"] ||= request_params_header
539
+
540
+ options.apply_defaults timeout: @config.rpcs.list_organization_events.timeout,
541
+ metadata: metadata,
542
+ retry_policy: @config.rpcs.list_organization_events.retry_policy
543
+
544
+ options.apply_defaults timeout: @config.timeout,
545
+ metadata: @config.metadata,
546
+ retry_policy: @config.retry_policy
547
+
548
+ @service_health_stub.call_rpc :list_organization_events, request, options: options do |response, operation|
549
+ response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_events, request, response, operation, options
550
+ yield response, operation if block_given?
551
+ return response
552
+ end
553
+ rescue ::GRPC::BadStatus => e
554
+ raise ::Google::Cloud::Error.from_error(e)
555
+ end
556
+
557
+ ##
558
+ # Retrieves a resource containing information about an event affecting an
559
+ # organization .
560
+ #
561
+ # @overload get_organization_event(request, options = nil)
562
+ # Pass arguments to `get_organization_event` via a request object, either of type
563
+ # {::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest} or an equivalent Hash.
564
+ #
565
+ # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::Hash]
566
+ # A request object representing the call parameters. Required. To specify no
567
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
568
+ # @param options [::Gapic::CallOptions, ::Hash]
569
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
570
+ #
571
+ # @overload get_organization_event(name: nil)
572
+ # Pass arguments to `get_organization_event` via keyword arguments. Note that at
573
+ # least one keyword argument is required. To specify no parameters, or to keep all
574
+ # the default parameter values, pass an empty Hash as a request object (see above).
575
+ #
576
+ # @param name [::String]
577
+ # Required. Unique name of the event in this scope including organization and
578
+ # event ID using the form
579
+ # `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
580
+ #
581
+ # `organization_id` - ID (number) of the project that contains the event. To
582
+ # get your `organization_id`, see
583
+ # [Getting your organization resource
584
+ # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
585
+ # `event_id` - Organization event ID to retrieve.
586
+ #
587
+ # @yield [response, operation] Access the result along with the RPC operation
588
+ # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationEvent]
589
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
590
+ #
591
+ # @return [::Google::Cloud::ServiceHealth::V1::OrganizationEvent]
592
+ #
593
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
594
+ #
595
+ # @example Basic example
596
+ # require "google/cloud/service_health/v1"
597
+ #
598
+ # # Create a client object. The client can be reused for multiple calls.
599
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
600
+ #
601
+ # # Create a request. To set request fields, pass in keyword arguments.
602
+ # request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new
603
+ #
604
+ # # Call the get_organization_event method.
605
+ # result = client.get_organization_event request
606
+ #
607
+ # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent.
608
+ # p result
609
+ #
610
+ def get_organization_event request, options = nil
611
+ raise ::ArgumentError, "request must be provided" if request.nil?
612
+
613
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest
614
+
615
+ # Converts hash and nil to an options object
616
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
617
+
618
+ # Customize the options with defaults
619
+ metadata = @config.rpcs.get_organization_event.metadata.to_h
620
+
621
+ # Set x-goog-api-client and x-goog-user-project headers
622
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
623
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
624
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
625
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
626
+
627
+ header_params = {}
628
+ if request.name
629
+ header_params["name"] = request.name
630
+ end
631
+
632
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
633
+ metadata[:"x-goog-request-params"] ||= request_params_header
634
+
635
+ options.apply_defaults timeout: @config.rpcs.get_organization_event.timeout,
636
+ metadata: metadata,
637
+ retry_policy: @config.rpcs.get_organization_event.retry_policy
638
+
639
+ options.apply_defaults timeout: @config.timeout,
640
+ metadata: @config.metadata,
641
+ retry_policy: @config.retry_policy
642
+
643
+ @service_health_stub.call_rpc :get_organization_event, request, options: options do |response, operation|
644
+ yield response, operation if block_given?
645
+ return response
646
+ end
647
+ rescue ::GRPC::BadStatus => e
648
+ raise ::Google::Cloud::Error.from_error(e)
649
+ end
650
+
651
+ ##
652
+ # Lists assets impacted by organization events under a given organization and
653
+ # location.
654
+ #
655
+ # @overload list_organization_impacts(request, options = nil)
656
+ # Pass arguments to `list_organization_impacts` via a request object, either of type
657
+ # {::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest} or an equivalent Hash.
658
+ #
659
+ # @param request [::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::Hash]
660
+ # A request object representing the call parameters. Required. To specify no
661
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
662
+ # @param options [::Gapic::CallOptions, ::Hash]
663
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
664
+ #
665
+ # @overload list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil)
666
+ # Pass arguments to `list_organization_impacts` via keyword arguments. Note that at
667
+ # least one keyword argument is required. To specify no parameters, or to keep all
668
+ # the default parameter values, pass an empty Hash as a request object (see above).
669
+ #
670
+ # @param parent [::String]
671
+ # Required. Parent value using the form
672
+ # `organizations/{organization_id}/locations/{location}/organizationImpacts`.
673
+ #
674
+ # `organization_id` - ID (number) of the project that contains the event. To
675
+ # get your `organization_id`, see
676
+ # [Getting your organization resource
677
+ # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
678
+ # @param page_size [::Integer]
679
+ # Optional. The maximum number of events that should be returned. Acceptable
680
+ # values are `1` to `100`, inclusive. The default value is `10`.
681
+ #
682
+ # If more results are available, the service returns a
683
+ # `next_page_token` that can be used to get the next page of results in
684
+ # subsequent list requests. The service may return fewer
685
+ # [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
686
+ # than the requested `page_size`.
687
+ # @param page_token [::String]
688
+ # Optional. A token identifying a page of results the server should return.
689
+ #
690
+ # Provide `page_token` returned by a previous `ListOrganizationImpacts` call
691
+ # to retrieve the next page of results.
692
+ #
693
+ # When paginating, all other parameters provided to `ListOrganizationImpacts`
694
+ # must match the call that provided the page token.
695
+ # @param filter [::String]
696
+ # Optional. A filter expression that filters resources listed in the
697
+ # response. The expression is in the form of `field:value` for checking if a
698
+ # repeated field contains a value.
699
+ #
700
+ # Example:
701
+ # `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
702
+ #
703
+ # To get your `{organization_id}`, see
704
+ # [Getting your organization resource
705
+ # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
706
+ #
707
+ # Multiple filter queries are separated by spaces.
708
+ #
709
+ # By default, each expression is an AND expression. However, you can include
710
+ # AND and OR expressions explicitly.
711
+ # Filter is supported for the following fields: `events`.
712
+ #
713
+ # @yield [response, operation] Access the result along with the RPC operation
714
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>]
715
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
716
+ #
717
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>]
718
+ #
719
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
720
+ #
721
+ # @example Basic example
722
+ # require "google/cloud/service_health/v1"
723
+ #
724
+ # # Create a client object. The client can be reused for multiple calls.
725
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
726
+ #
727
+ # # Create a request. To set request fields, pass in keyword arguments.
728
+ # request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new
729
+ #
730
+ # # Call the list_organization_impacts method.
731
+ # result = client.list_organization_impacts request
732
+ #
733
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
734
+ # # over elements, and API calls will be issued to fetch pages as needed.
735
+ # result.each do |item|
736
+ # # Each element is of type ::Google::Cloud::ServiceHealth::V1::OrganizationImpact.
737
+ # p item
738
+ # end
739
+ #
740
+ def list_organization_impacts request, options = nil
741
+ raise ::ArgumentError, "request must be provided" if request.nil?
742
+
743
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest
744
+
745
+ # Converts hash and nil to an options object
746
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
747
+
748
+ # Customize the options with defaults
749
+ metadata = @config.rpcs.list_organization_impacts.metadata.to_h
750
+
751
+ # Set x-goog-api-client and x-goog-user-project headers
752
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
753
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
754
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
755
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
756
+
757
+ header_params = {}
758
+ if request.parent
759
+ header_params["parent"] = request.parent
760
+ end
761
+
762
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
763
+ metadata[:"x-goog-request-params"] ||= request_params_header
764
+
765
+ options.apply_defaults timeout: @config.rpcs.list_organization_impacts.timeout,
766
+ metadata: metadata,
767
+ retry_policy: @config.rpcs.list_organization_impacts.retry_policy
768
+
769
+ options.apply_defaults timeout: @config.timeout,
770
+ metadata: @config.metadata,
771
+ retry_policy: @config.retry_policy
772
+
773
+ @service_health_stub.call_rpc :list_organization_impacts, request, options: options do |response, operation|
774
+ response = ::Gapic::PagedEnumerable.new @service_health_stub, :list_organization_impacts, request, response, operation, options
775
+ yield response, operation if block_given?
776
+ return response
777
+ end
778
+ rescue ::GRPC::BadStatus => e
779
+ raise ::Google::Cloud::Error.from_error(e)
780
+ end
781
+
782
+ ##
783
+ # Retrieves a resource containing information about impact to an asset under
784
+ # an organization affected by a service health event.
785
+ #
786
+ # @overload get_organization_impact(request, options = nil)
787
+ # Pass arguments to `get_organization_impact` via a request object, either of type
788
+ # {::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest} or an equivalent Hash.
789
+ #
790
+ # @param request [::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::Hash]
791
+ # A request object representing the call parameters. Required. To specify no
792
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
793
+ # @param options [::Gapic::CallOptions, ::Hash]
794
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
795
+ #
796
+ # @overload get_organization_impact(name: nil)
797
+ # Pass arguments to `get_organization_impact` via keyword arguments. Note that at
798
+ # least one keyword argument is required. To specify no parameters, or to keep all
799
+ # the default parameter values, pass an empty Hash as a request object (see above).
800
+ #
801
+ # @param name [::String]
802
+ # Required. Name of the resource using the form
803
+ # `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
804
+ #
805
+ # `organization_id` - ID (number) of the organization that contains the
806
+ # event. To get your `organization_id`, see
807
+ # [Getting your organization resource
808
+ # ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
809
+ # `organization_impact_id` - ID of the [OrganizationImpact
810
+ # resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
811
+ #
812
+ # @yield [response, operation] Access the result along with the RPC operation
813
+ # @yieldparam response [::Google::Cloud::ServiceHealth::V1::OrganizationImpact]
814
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
815
+ #
816
+ # @return [::Google::Cloud::ServiceHealth::V1::OrganizationImpact]
817
+ #
818
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
819
+ #
820
+ # @example Basic example
821
+ # require "google/cloud/service_health/v1"
822
+ #
823
+ # # Create a client object. The client can be reused for multiple calls.
824
+ # client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new
825
+ #
826
+ # # Create a request. To set request fields, pass in keyword arguments.
827
+ # request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new
828
+ #
829
+ # # Call the get_organization_impact method.
830
+ # result = client.get_organization_impact request
831
+ #
832
+ # # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact.
833
+ # p result
834
+ #
835
+ def get_organization_impact request, options = nil
836
+ raise ::ArgumentError, "request must be provided" if request.nil?
837
+
838
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest
839
+
840
+ # Converts hash and nil to an options object
841
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
842
+
843
+ # Customize the options with defaults
844
+ metadata = @config.rpcs.get_organization_impact.metadata.to_h
845
+
846
+ # Set x-goog-api-client and x-goog-user-project headers
847
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
848
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
849
+ gapic_version: ::Google::Cloud::ServiceHealth::V1::VERSION
850
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
851
+
852
+ header_params = {}
853
+ if request.name
854
+ header_params["name"] = request.name
855
+ end
856
+
857
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
858
+ metadata[:"x-goog-request-params"] ||= request_params_header
859
+
860
+ options.apply_defaults timeout: @config.rpcs.get_organization_impact.timeout,
861
+ metadata: metadata,
862
+ retry_policy: @config.rpcs.get_organization_impact.retry_policy
863
+
864
+ options.apply_defaults timeout: @config.timeout,
865
+ metadata: @config.metadata,
866
+ retry_policy: @config.retry_policy
867
+
868
+ @service_health_stub.call_rpc :get_organization_impact, request, options: options do |response, operation|
869
+ yield response, operation if block_given?
870
+ return response
871
+ end
872
+ rescue ::GRPC::BadStatus => e
873
+ raise ::Google::Cloud::Error.from_error(e)
874
+ end
875
+
876
+ ##
877
+ # Configuration class for the ServiceHealth API.
878
+ #
879
+ # This class represents the configuration for ServiceHealth,
880
+ # providing control over timeouts, retry behavior, logging, transport
881
+ # parameters, and other low-level controls. Certain parameters can also be
882
+ # applied individually to specific RPCs. See
883
+ # {::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client::Configuration::Rpcs}
884
+ # for a list of RPCs that can be configured independently.
885
+ #
886
+ # Configuration can be applied globally to all clients, or to a single client
887
+ # on construction.
888
+ #
889
+ # @example
890
+ #
891
+ # # Modify the global config, setting the timeout for
892
+ # # list_events to 20 seconds,
893
+ # # and all remaining timeouts to 10 seconds.
894
+ # ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config|
895
+ # config.timeout = 10.0
896
+ # config.rpcs.list_events.timeout = 20.0
897
+ # end
898
+ #
899
+ # # Apply the above configuration only to a new client.
900
+ # client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config|
901
+ # config.timeout = 10.0
902
+ # config.rpcs.list_events.timeout = 20.0
903
+ # end
904
+ #
905
+ # @!attribute [rw] endpoint
906
+ # A custom service endpoint, as a hostname or hostname:port. The default is
907
+ # nil, indicating to use the default endpoint in the current universe domain.
908
+ # @return [::String,nil]
909
+ # @!attribute [rw] credentials
910
+ # Credentials to send with calls. You may provide any of the following types:
911
+ # * (`String`) The path to a service account key file in JSON format
912
+ # * (`Hash`) A service account key as a Hash
913
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
914
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
915
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
916
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
917
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
918
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
919
+ # * (`nil`) indicating no credentials
920
+ # @return [::Object]
921
+ # @!attribute [rw] scope
922
+ # The OAuth scopes
923
+ # @return [::Array<::String>]
924
+ # @!attribute [rw] lib_name
925
+ # The library name as recorded in instrumentation and logging
926
+ # @return [::String]
927
+ # @!attribute [rw] lib_version
928
+ # The library version as recorded in instrumentation and logging
929
+ # @return [::String]
930
+ # @!attribute [rw] channel_args
931
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
932
+ # `GRPC::Core::Channel` object is provided as the credential.
933
+ # @return [::Hash]
934
+ # @!attribute [rw] interceptors
935
+ # An array of interceptors that are run before calls are executed.
936
+ # @return [::Array<::GRPC::ClientInterceptor>]
937
+ # @!attribute [rw] timeout
938
+ # The call timeout in seconds.
939
+ # @return [::Numeric]
940
+ # @!attribute [rw] metadata
941
+ # Additional gRPC headers to be sent with the call.
942
+ # @return [::Hash{::Symbol=>::String}]
943
+ # @!attribute [rw] retry_policy
944
+ # The retry policy. The value is a hash with the following keys:
945
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
946
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
947
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
948
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
949
+ # trigger a retry.
950
+ # @return [::Hash]
951
+ # @!attribute [rw] quota_project
952
+ # A separate project against which to charge quota.
953
+ # @return [::String]
954
+ # @!attribute [rw] universe_domain
955
+ # The universe domain within which to make requests. This determines the
956
+ # default endpoint URL. The default value of nil uses the environment
957
+ # universe (usually the default "googleapis.com" universe).
958
+ # @return [::String,nil]
959
+ #
960
+ class Configuration
961
+ extend ::Gapic::Config
962
+
963
+ # @private
964
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
965
+ DEFAULT_ENDPOINT = "servicehealth.googleapis.com"
966
+
967
+ config_attr :endpoint, nil, ::String, nil
968
+ config_attr :credentials, nil do |value|
969
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
970
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
971
+ allowed.any? { |klass| klass === value }
972
+ end
973
+ config_attr :scope, nil, ::String, ::Array, nil
974
+ config_attr :lib_name, nil, ::String, nil
975
+ config_attr :lib_version, nil, ::String, nil
976
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
977
+ config_attr :interceptors, nil, ::Array, nil
978
+ config_attr :timeout, nil, ::Numeric, nil
979
+ config_attr :metadata, nil, ::Hash, nil
980
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
981
+ config_attr :quota_project, nil, ::String, nil
982
+ config_attr :universe_domain, nil, ::String, nil
983
+
984
+ # @private
985
+ def initialize parent_config = nil
986
+ @parent_config = parent_config unless parent_config.nil?
987
+
988
+ yield self if block_given?
989
+ end
990
+
991
+ ##
992
+ # Configurations for individual RPCs
993
+ # @return [Rpcs]
994
+ #
995
+ def rpcs
996
+ @rpcs ||= begin
997
+ parent_rpcs = nil
998
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
999
+ Rpcs.new parent_rpcs
1000
+ end
1001
+ end
1002
+
1003
+ ##
1004
+ # Configuration for the channel pool
1005
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1006
+ #
1007
+ def channel_pool
1008
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1009
+ end
1010
+
1011
+ ##
1012
+ # Configuration RPC class for the ServiceHealth API.
1013
+ #
1014
+ # Includes fields providing the configuration for each RPC in this service.
1015
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1016
+ # the following configuration fields:
1017
+ #
1018
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1019
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1020
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1021
+ # include the following keys:
1022
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1023
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1024
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1025
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1026
+ # trigger a retry.
1027
+ #
1028
+ class Rpcs
1029
+ ##
1030
+ # RPC-specific configuration for `list_events`
1031
+ # @return [::Gapic::Config::Method]
1032
+ #
1033
+ attr_reader :list_events
1034
+ ##
1035
+ # RPC-specific configuration for `get_event`
1036
+ # @return [::Gapic::Config::Method]
1037
+ #
1038
+ attr_reader :get_event
1039
+ ##
1040
+ # RPC-specific configuration for `list_organization_events`
1041
+ # @return [::Gapic::Config::Method]
1042
+ #
1043
+ attr_reader :list_organization_events
1044
+ ##
1045
+ # RPC-specific configuration for `get_organization_event`
1046
+ # @return [::Gapic::Config::Method]
1047
+ #
1048
+ attr_reader :get_organization_event
1049
+ ##
1050
+ # RPC-specific configuration for `list_organization_impacts`
1051
+ # @return [::Gapic::Config::Method]
1052
+ #
1053
+ attr_reader :list_organization_impacts
1054
+ ##
1055
+ # RPC-specific configuration for `get_organization_impact`
1056
+ # @return [::Gapic::Config::Method]
1057
+ #
1058
+ attr_reader :get_organization_impact
1059
+
1060
+ # @private
1061
+ def initialize parent_rpcs = nil
1062
+ list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events
1063
+ @list_events = ::Gapic::Config::Method.new list_events_config
1064
+ get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event
1065
+ @get_event = ::Gapic::Config::Method.new get_event_config
1066
+ list_organization_events_config = parent_rpcs.list_organization_events if parent_rpcs.respond_to? :list_organization_events
1067
+ @list_organization_events = ::Gapic::Config::Method.new list_organization_events_config
1068
+ get_organization_event_config = parent_rpcs.get_organization_event if parent_rpcs.respond_to? :get_organization_event
1069
+ @get_organization_event = ::Gapic::Config::Method.new get_organization_event_config
1070
+ list_organization_impacts_config = parent_rpcs.list_organization_impacts if parent_rpcs.respond_to? :list_organization_impacts
1071
+ @list_organization_impacts = ::Gapic::Config::Method.new list_organization_impacts_config
1072
+ get_organization_impact_config = parent_rpcs.get_organization_impact if parent_rpcs.respond_to? :get_organization_impact
1073
+ @get_organization_impact = ::Gapic::Config::Method.new get_organization_impact_config
1074
+
1075
+ yield self if block_given?
1076
+ end
1077
+ end
1078
+ end
1079
+ end
1080
+ end
1081
+ end
1082
+ end
1083
+ end
1084
+ end