google-cloud-support-v2 1.9.0 → 1.10.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.
@@ -0,0 +1,979 @@
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/support/v2/support_event_subscription_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Support
25
+ module V2
26
+ module SupportEventSubscriptionService
27
+ ##
28
+ # Client for the SupportEventSubscriptionService service.
29
+ #
30
+ # Service for managing customer support event subscriptions.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :support_event_subscription_service_stub
43
+
44
+ ##
45
+ # Configure the SupportEventSubscriptionService Client class.
46
+ #
47
+ # See {::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all SupportEventSubscriptionService clients
53
+ # ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "Support", "V2"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the SupportEventSubscriptionService Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @support_event_subscription_service_stub.universe_domain
106
+ end
107
+
108
+ ##
109
+ # Create a new SupportEventSubscriptionService client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the SupportEventSubscriptionService client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # These require statements are intentionally placed here to initialize
126
+ # the gRPC module only when it's required.
127
+ # See https://github.com/googleapis/toolkit/issues/446
128
+ require "gapic/grpc"
129
+ require "google/cloud/support/v2/support_event_subscription_service_services_pb"
130
+
131
+ # Create the configuration object
132
+ @config = Configuration.new Client.configure
133
+
134
+ # Yield the configuration if needed
135
+ yield @config if block_given?
136
+
137
+ # Create credentials
138
+ credentials = @config.credentials
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
+ # but only if the default endpoint does not have a region prefix.
141
+ enable_self_signed_jwt = @config.endpoint.nil? ||
142
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
+ !@config.endpoint.split(".").first.include?("-"))
144
+ credentials ||= Credentials.default scope: @config.scope,
145
+ enable_self_signed_jwt: enable_self_signed_jwt
146
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
147
+ credentials = Credentials.new credentials, scope: @config.scope
148
+ end
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @support_event_subscription_service_stub = ::Gapic::ServiceStub.new(
153
+ ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Stub,
154
+ credentials: credentials,
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ channel_args: @config.channel_args,
159
+ interceptors: @config.interceptors,
160
+ channel_pool_config: @config.channel_pool,
161
+ logger: @config.logger
162
+ )
163
+
164
+ @support_event_subscription_service_stub.stub_logger&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+ end
174
+
175
+ ##
176
+ # The logger used for request/response debug logging.
177
+ #
178
+ # @return [Logger]
179
+ #
180
+ def logger
181
+ @support_event_subscription_service_stub.logger
182
+ end
183
+
184
+ # Service calls
185
+
186
+ ##
187
+ # Creates a support event subscription for an organization.
188
+ #
189
+ # @overload create_support_event_subscription(request, options = nil)
190
+ # Pass arguments to `create_support_event_subscription` via a request object, either of type
191
+ # {::Google::Cloud::Support::V2::CreateSupportEventSubscriptionRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Cloud::Support::V2::CreateSupportEventSubscriptionRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
198
+ #
199
+ # @overload create_support_event_subscription(parent: nil, support_event_subscription: nil)
200
+ # Pass arguments to `create_support_event_subscription` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param parent [::String]
205
+ # Required. The parent resource name where the support event subscription
206
+ # will be created. Format: organizations/\\{organization_id}
207
+ # @param support_event_subscription [::Google::Cloud::Support::V2::SupportEventSubscription, ::Hash]
208
+ # Required. The Pub/Sub configuration to create.
209
+ #
210
+ # @yield [response, operation] Access the result along with the RPC operation
211
+ # @yieldparam response [::Google::Cloud::Support::V2::SupportEventSubscription]
212
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
213
+ #
214
+ # @return [::Google::Cloud::Support::V2::SupportEventSubscription]
215
+ #
216
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
+ #
218
+ # @example Basic example
219
+ # require "google/cloud/support/v2"
220
+ #
221
+ # # Create a client object. The client can be reused for multiple calls.
222
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
223
+ #
224
+ # # Create a request. To set request fields, pass in keyword arguments.
225
+ # request = Google::Cloud::Support::V2::CreateSupportEventSubscriptionRequest.new
226
+ #
227
+ # # Call the create_support_event_subscription method.
228
+ # result = client.create_support_event_subscription request
229
+ #
230
+ # # The returned object is of type Google::Cloud::Support::V2::SupportEventSubscription.
231
+ # p result
232
+ #
233
+ def create_support_event_subscription request, options = nil
234
+ raise ::ArgumentError, "request must be provided" if request.nil?
235
+
236
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::CreateSupportEventSubscriptionRequest
237
+
238
+ # Converts hash and nil to an options object
239
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
240
+
241
+ # Customize the options with defaults
242
+ metadata = @config.rpcs.create_support_event_subscription.metadata.to_h
243
+
244
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
245
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
246
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
247
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
248
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
249
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
250
+
251
+ header_params = {}
252
+ if request.parent
253
+ header_params["parent"] = request.parent
254
+ end
255
+
256
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
257
+ metadata[:"x-goog-request-params"] ||= request_params_header
258
+
259
+ options.apply_defaults timeout: @config.rpcs.create_support_event_subscription.timeout,
260
+ metadata: metadata,
261
+ retry_policy: @config.rpcs.create_support_event_subscription.retry_policy
262
+
263
+ options.apply_defaults timeout: @config.timeout,
264
+ metadata: @config.metadata,
265
+ retry_policy: @config.retry_policy
266
+
267
+ @support_event_subscription_service_stub.call_rpc :create_support_event_subscription, request, options: options do |response, operation|
268
+ yield response, operation if block_given?
269
+ end
270
+ rescue ::GRPC::BadStatus => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # Gets a support event subscription.
276
+ #
277
+ # @overload get_support_event_subscription(request, options = nil)
278
+ # Pass arguments to `get_support_event_subscription` via a request object, either of type
279
+ # {::Google::Cloud::Support::V2::GetSupportEventSubscriptionRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Cloud::Support::V2::GetSupportEventSubscriptionRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
286
+ #
287
+ # @overload get_support_event_subscription(name: nil)
288
+ # Pass arguments to `get_support_event_subscription` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param name [::String]
293
+ # Required. The name of the support event subscription to retrieve.
294
+ # Format:
295
+ # organizations/\\{organization_id}/supportEventSubscriptions/\\{subscription_id}
296
+ #
297
+ # @yield [response, operation] Access the result along with the RPC operation
298
+ # @yieldparam response [::Google::Cloud::Support::V2::SupportEventSubscription]
299
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
300
+ #
301
+ # @return [::Google::Cloud::Support::V2::SupportEventSubscription]
302
+ #
303
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
304
+ #
305
+ # @example Basic example
306
+ # require "google/cloud/support/v2"
307
+ #
308
+ # # Create a client object. The client can be reused for multiple calls.
309
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
310
+ #
311
+ # # Create a request. To set request fields, pass in keyword arguments.
312
+ # request = Google::Cloud::Support::V2::GetSupportEventSubscriptionRequest.new
313
+ #
314
+ # # Call the get_support_event_subscription method.
315
+ # result = client.get_support_event_subscription request
316
+ #
317
+ # # The returned object is of type Google::Cloud::Support::V2::SupportEventSubscription.
318
+ # p result
319
+ #
320
+ def get_support_event_subscription request, options = nil
321
+ raise ::ArgumentError, "request must be provided" if request.nil?
322
+
323
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetSupportEventSubscriptionRequest
324
+
325
+ # Converts hash and nil to an options object
326
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
327
+
328
+ # Customize the options with defaults
329
+ metadata = @config.rpcs.get_support_event_subscription.metadata.to_h
330
+
331
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
332
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
333
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
334
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
335
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
336
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
337
+
338
+ header_params = {}
339
+ if request.name
340
+ header_params["name"] = request.name
341
+ end
342
+
343
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
344
+ metadata[:"x-goog-request-params"] ||= request_params_header
345
+
346
+ options.apply_defaults timeout: @config.rpcs.get_support_event_subscription.timeout,
347
+ metadata: metadata,
348
+ retry_policy: @config.rpcs.get_support_event_subscription.retry_policy
349
+
350
+ options.apply_defaults timeout: @config.timeout,
351
+ metadata: @config.metadata,
352
+ retry_policy: @config.retry_policy
353
+
354
+ @support_event_subscription_service_stub.call_rpc :get_support_event_subscription, request, options: options do |response, operation|
355
+ yield response, operation if block_given?
356
+ end
357
+ rescue ::GRPC::BadStatus => e
358
+ raise ::Google::Cloud::Error.from_error(e)
359
+ end
360
+
361
+ ##
362
+ # Lists support event subscriptions.
363
+ #
364
+ # @overload list_support_event_subscriptions(request, options = nil)
365
+ # Pass arguments to `list_support_event_subscriptions` via a request object, either of type
366
+ # {::Google::Cloud::Support::V2::ListSupportEventSubscriptionsRequest} or an equivalent Hash.
367
+ #
368
+ # @param request [::Google::Cloud::Support::V2::ListSupportEventSubscriptionsRequest, ::Hash]
369
+ # A request object representing the call parameters. Required. To specify no
370
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
371
+ # @param options [::Gapic::CallOptions, ::Hash]
372
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
373
+ #
374
+ # @overload list_support_event_subscriptions(parent: nil, filter: nil, show_deleted: nil, page_size: nil, page_token: nil)
375
+ # Pass arguments to `list_support_event_subscriptions` via keyword arguments. Note that at
376
+ # least one keyword argument is required. To specify no parameters, or to keep all
377
+ # the default parameter values, pass an empty Hash as a request object (see above).
378
+ #
379
+ # @param parent [::String]
380
+ # Required. The fully qualified name of the Cloud resource to list support
381
+ # event subscriptions under. Format: organizations/\\{organization_id}
382
+ # @param filter [::String]
383
+ # Optional. Filter expression based on AIP-160.
384
+ # Supported fields:
385
+ # - pub_sub_topic
386
+ # - state
387
+ #
388
+ # Examples:
389
+ # - `pub_sub_topic="projects/example-project/topics/example-topic"`
390
+ # - `state=WORKING`
391
+ # - `pub_sub_topic="projects/example-project/topics/example-topic" AND
392
+ # state=WORKING`
393
+ # @param show_deleted [::Boolean]
394
+ # Optional. Whether to show deleted subscriptions. By default, deleted
395
+ # subscriptions are not returned.
396
+ # @param page_size [::Integer]
397
+ # Optional. The maximum number of support event subscriptions to return.
398
+ # @param page_token [::String]
399
+ # Optional. A token identifying the page of results to return. If
400
+ # unspecified, the first page is retrieved.
401
+ #
402
+ # When paginating, all other parameters provided to
403
+ # `ListSupportEventSubscriptions` must match the call that provided the page
404
+ # token.
405
+ #
406
+ # @yield [response, operation] Access the result along with the RPC operation
407
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::SupportEventSubscription>]
408
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
409
+ #
410
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::SupportEventSubscription>]
411
+ #
412
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
413
+ #
414
+ # @example Basic example
415
+ # require "google/cloud/support/v2"
416
+ #
417
+ # # Create a client object. The client can be reused for multiple calls.
418
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
419
+ #
420
+ # # Create a request. To set request fields, pass in keyword arguments.
421
+ # request = Google::Cloud::Support::V2::ListSupportEventSubscriptionsRequest.new
422
+ #
423
+ # # Call the list_support_event_subscriptions method.
424
+ # result = client.list_support_event_subscriptions request
425
+ #
426
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
427
+ # # over elements, and API calls will be issued to fetch pages as needed.
428
+ # result.each do |item|
429
+ # # Each element is of type ::Google::Cloud::Support::V2::SupportEventSubscription.
430
+ # p item
431
+ # end
432
+ #
433
+ def list_support_event_subscriptions request, options = nil
434
+ raise ::ArgumentError, "request must be provided" if request.nil?
435
+
436
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListSupportEventSubscriptionsRequest
437
+
438
+ # Converts hash and nil to an options object
439
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
440
+
441
+ # Customize the options with defaults
442
+ metadata = @config.rpcs.list_support_event_subscriptions.metadata.to_h
443
+
444
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
445
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
446
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
447
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
448
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
449
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
450
+
451
+ header_params = {}
452
+ if request.parent
453
+ header_params["parent"] = request.parent
454
+ end
455
+
456
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
457
+ metadata[:"x-goog-request-params"] ||= request_params_header
458
+
459
+ options.apply_defaults timeout: @config.rpcs.list_support_event_subscriptions.timeout,
460
+ metadata: metadata,
461
+ retry_policy: @config.rpcs.list_support_event_subscriptions.retry_policy
462
+
463
+ options.apply_defaults timeout: @config.timeout,
464
+ metadata: @config.metadata,
465
+ retry_policy: @config.retry_policy
466
+
467
+ @support_event_subscription_service_stub.call_rpc :list_support_event_subscriptions, request, options: options do |response, operation|
468
+ response = ::Gapic::PagedEnumerable.new @support_event_subscription_service_stub, :list_support_event_subscriptions, request, response, operation, options
469
+ yield response, operation if block_given?
470
+ throw :response, response
471
+ end
472
+ rescue ::GRPC::BadStatus => e
473
+ raise ::Google::Cloud::Error.from_error(e)
474
+ end
475
+
476
+ ##
477
+ # Updates a support event subscription.
478
+ #
479
+ # @overload update_support_event_subscription(request, options = nil)
480
+ # Pass arguments to `update_support_event_subscription` via a request object, either of type
481
+ # {::Google::Cloud::Support::V2::UpdateSupportEventSubscriptionRequest} or an equivalent Hash.
482
+ #
483
+ # @param request [::Google::Cloud::Support::V2::UpdateSupportEventSubscriptionRequest, ::Hash]
484
+ # A request object representing the call parameters. Required. To specify no
485
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
486
+ # @param options [::Gapic::CallOptions, ::Hash]
487
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
488
+ #
489
+ # @overload update_support_event_subscription(support_event_subscription: nil, update_mask: nil)
490
+ # Pass arguments to `update_support_event_subscription` via keyword arguments. Note that at
491
+ # least one keyword argument is required. To specify no parameters, or to keep all
492
+ # the default parameter values, pass an empty Hash as a request object (see above).
493
+ #
494
+ # @param support_event_subscription [::Google::Cloud::Support::V2::SupportEventSubscription, ::Hash]
495
+ # Required. The support event subscription to update.
496
+ # The `name` field is used to identify the configuration to update.
497
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
498
+ # Optional. The list of fields to update. The only supported value is
499
+ # pub_sub_topic.
500
+ #
501
+ # @yield [response, operation] Access the result along with the RPC operation
502
+ # @yieldparam response [::Google::Cloud::Support::V2::SupportEventSubscription]
503
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
504
+ #
505
+ # @return [::Google::Cloud::Support::V2::SupportEventSubscription]
506
+ #
507
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
508
+ #
509
+ # @example Basic example
510
+ # require "google/cloud/support/v2"
511
+ #
512
+ # # Create a client object. The client can be reused for multiple calls.
513
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
514
+ #
515
+ # # Create a request. To set request fields, pass in keyword arguments.
516
+ # request = Google::Cloud::Support::V2::UpdateSupportEventSubscriptionRequest.new
517
+ #
518
+ # # Call the update_support_event_subscription method.
519
+ # result = client.update_support_event_subscription request
520
+ #
521
+ # # The returned object is of type Google::Cloud::Support::V2::SupportEventSubscription.
522
+ # p result
523
+ #
524
+ def update_support_event_subscription request, options = nil
525
+ raise ::ArgumentError, "request must be provided" if request.nil?
526
+
527
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::UpdateSupportEventSubscriptionRequest
528
+
529
+ # Converts hash and nil to an options object
530
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
531
+
532
+ # Customize the options with defaults
533
+ metadata = @config.rpcs.update_support_event_subscription.metadata.to_h
534
+
535
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
536
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
537
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
538
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
539
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
540
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
541
+
542
+ header_params = {}
543
+ if request.support_event_subscription&.name
544
+ header_params["support_event_subscription.name"] = request.support_event_subscription.name
545
+ end
546
+
547
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
548
+ metadata[:"x-goog-request-params"] ||= request_params_header
549
+
550
+ options.apply_defaults timeout: @config.rpcs.update_support_event_subscription.timeout,
551
+ metadata: metadata,
552
+ retry_policy: @config.rpcs.update_support_event_subscription.retry_policy
553
+
554
+ options.apply_defaults timeout: @config.timeout,
555
+ metadata: @config.metadata,
556
+ retry_policy: @config.retry_policy
557
+
558
+ @support_event_subscription_service_stub.call_rpc :update_support_event_subscription, request, options: options do |response, operation|
559
+ yield response, operation if block_given?
560
+ end
561
+ rescue ::GRPC::BadStatus => e
562
+ raise ::Google::Cloud::Error.from_error(e)
563
+ end
564
+
565
+ ##
566
+ # Soft deletes a support event subscription.
567
+ #
568
+ # @overload delete_support_event_subscription(request, options = nil)
569
+ # Pass arguments to `delete_support_event_subscription` via a request object, either of type
570
+ # {::Google::Cloud::Support::V2::DeleteSupportEventSubscriptionRequest} or an equivalent Hash.
571
+ #
572
+ # @param request [::Google::Cloud::Support::V2::DeleteSupportEventSubscriptionRequest, ::Hash]
573
+ # A request object representing the call parameters. Required. To specify no
574
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
575
+ # @param options [::Gapic::CallOptions, ::Hash]
576
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
577
+ #
578
+ # @overload delete_support_event_subscription(name: nil)
579
+ # Pass arguments to `delete_support_event_subscription` via keyword arguments. Note that at
580
+ # least one keyword argument is required. To specify no parameters, or to keep all
581
+ # the default parameter values, pass an empty Hash as a request object (see above).
582
+ #
583
+ # @param name [::String]
584
+ # Required. The name of the support event subscription to delete.
585
+ # Format:
586
+ # organizations/\\{organization_id}/supportEventSubscriptions/\\{subscription_id}
587
+ #
588
+ # @yield [response, operation] Access the result along with the RPC operation
589
+ # @yieldparam response [::Google::Cloud::Support::V2::SupportEventSubscription]
590
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
591
+ #
592
+ # @return [::Google::Cloud::Support::V2::SupportEventSubscription]
593
+ #
594
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
595
+ #
596
+ # @example Basic example
597
+ # require "google/cloud/support/v2"
598
+ #
599
+ # # Create a client object. The client can be reused for multiple calls.
600
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
601
+ #
602
+ # # Create a request. To set request fields, pass in keyword arguments.
603
+ # request = Google::Cloud::Support::V2::DeleteSupportEventSubscriptionRequest.new
604
+ #
605
+ # # Call the delete_support_event_subscription method.
606
+ # result = client.delete_support_event_subscription request
607
+ #
608
+ # # The returned object is of type Google::Cloud::Support::V2::SupportEventSubscription.
609
+ # p result
610
+ #
611
+ def delete_support_event_subscription request, options = nil
612
+ raise ::ArgumentError, "request must be provided" if request.nil?
613
+
614
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::DeleteSupportEventSubscriptionRequest
615
+
616
+ # Converts hash and nil to an options object
617
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
618
+
619
+ # Customize the options with defaults
620
+ metadata = @config.rpcs.delete_support_event_subscription.metadata.to_h
621
+
622
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
623
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
624
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
625
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
626
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
627
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
628
+
629
+ header_params = {}
630
+ if request.name
631
+ header_params["name"] = request.name
632
+ end
633
+
634
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
635
+ metadata[:"x-goog-request-params"] ||= request_params_header
636
+
637
+ options.apply_defaults timeout: @config.rpcs.delete_support_event_subscription.timeout,
638
+ metadata: metadata,
639
+ retry_policy: @config.rpcs.delete_support_event_subscription.retry_policy
640
+
641
+ options.apply_defaults timeout: @config.timeout,
642
+ metadata: @config.metadata,
643
+ retry_policy: @config.retry_policy
644
+
645
+ @support_event_subscription_service_stub.call_rpc :delete_support_event_subscription, request, options: options do |response, operation|
646
+ yield response, operation if block_given?
647
+ end
648
+ rescue ::GRPC::BadStatus => e
649
+ raise ::Google::Cloud::Error.from_error(e)
650
+ end
651
+
652
+ ##
653
+ # Undeletes a support event subscription.
654
+ #
655
+ # @overload undelete_support_event_subscription(request, options = nil)
656
+ # Pass arguments to `undelete_support_event_subscription` via a request object, either of type
657
+ # {::Google::Cloud::Support::V2::UndeleteSupportEventSubscriptionRequest} or an equivalent Hash.
658
+ #
659
+ # @param request [::Google::Cloud::Support::V2::UndeleteSupportEventSubscriptionRequest, ::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 undelete_support_event_subscription(name: nil)
666
+ # Pass arguments to `undelete_support_event_subscription` 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 name [::String]
671
+ # Required. The name of the support event subscription to undelete.
672
+ # Format:
673
+ # organizations/\\{organization_id}/supportEventSubscriptions/\\{subscription_id}
674
+ #
675
+ # @yield [response, operation] Access the result along with the RPC operation
676
+ # @yieldparam response [::Google::Cloud::Support::V2::SupportEventSubscription]
677
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
678
+ #
679
+ # @return [::Google::Cloud::Support::V2::SupportEventSubscription]
680
+ #
681
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
682
+ #
683
+ # @example Basic example
684
+ # require "google/cloud/support/v2"
685
+ #
686
+ # # Create a client object. The client can be reused for multiple calls.
687
+ # client = Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new
688
+ #
689
+ # # Create a request. To set request fields, pass in keyword arguments.
690
+ # request = Google::Cloud::Support::V2::UndeleteSupportEventSubscriptionRequest.new
691
+ #
692
+ # # Call the undelete_support_event_subscription method.
693
+ # result = client.undelete_support_event_subscription request
694
+ #
695
+ # # The returned object is of type Google::Cloud::Support::V2::SupportEventSubscription.
696
+ # p result
697
+ #
698
+ def undelete_support_event_subscription request, options = nil
699
+ raise ::ArgumentError, "request must be provided" if request.nil?
700
+
701
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::UndeleteSupportEventSubscriptionRequest
702
+
703
+ # Converts hash and nil to an options object
704
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
705
+
706
+ # Customize the options with defaults
707
+ metadata = @config.rpcs.undelete_support_event_subscription.metadata.to_h
708
+
709
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
710
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
711
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
712
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
713
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
714
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ header_params = {}
717
+ if request.name
718
+ header_params["name"] = request.name
719
+ end
720
+
721
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
722
+ metadata[:"x-goog-request-params"] ||= request_params_header
723
+
724
+ options.apply_defaults timeout: @config.rpcs.undelete_support_event_subscription.timeout,
725
+ metadata: metadata,
726
+ retry_policy: @config.rpcs.undelete_support_event_subscription.retry_policy
727
+
728
+ options.apply_defaults timeout: @config.timeout,
729
+ metadata: @config.metadata,
730
+ retry_policy: @config.retry_policy
731
+
732
+ @support_event_subscription_service_stub.call_rpc :undelete_support_event_subscription, request, options: options do |response, operation|
733
+ yield response, operation if block_given?
734
+ end
735
+ rescue ::GRPC::BadStatus => e
736
+ raise ::Google::Cloud::Error.from_error(e)
737
+ end
738
+
739
+ ##
740
+ # Configuration class for the SupportEventSubscriptionService API.
741
+ #
742
+ # This class represents the configuration for SupportEventSubscriptionService,
743
+ # providing control over timeouts, retry behavior, logging, transport
744
+ # parameters, and other low-level controls. Certain parameters can also be
745
+ # applied individually to specific RPCs. See
746
+ # {::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client::Configuration::Rpcs}
747
+ # for a list of RPCs that can be configured independently.
748
+ #
749
+ # Configuration can be applied globally to all clients, or to a single client
750
+ # on construction.
751
+ #
752
+ # @example
753
+ #
754
+ # # Modify the global config, setting the timeout for
755
+ # # create_support_event_subscription to 20 seconds,
756
+ # # and all remaining timeouts to 10 seconds.
757
+ # ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.configure do |config|
758
+ # config.timeout = 10.0
759
+ # config.rpcs.create_support_event_subscription.timeout = 20.0
760
+ # end
761
+ #
762
+ # # Apply the above configuration only to a new client.
763
+ # client = ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new do |config|
764
+ # config.timeout = 10.0
765
+ # config.rpcs.create_support_event_subscription.timeout = 20.0
766
+ # end
767
+ #
768
+ # @!attribute [rw] endpoint
769
+ # A custom service endpoint, as a hostname or hostname:port. The default is
770
+ # nil, indicating to use the default endpoint in the current universe domain.
771
+ # @return [::String,nil]
772
+ # @!attribute [rw] credentials
773
+ # Credentials to send with calls. You may provide any of the following types:
774
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
775
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
776
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
777
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
778
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
779
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
780
+ # * (`nil`) indicating no credentials
781
+ #
782
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
783
+ # is deprecated. Providing an unvalidated credential configuration to
784
+ # Google APIs can compromise the security of your systems and data.
785
+ #
786
+ # @example
787
+ #
788
+ # # The recommended way to provide credentials is to use the `make_creds` method
789
+ # # on the appropriate credentials class for your environment.
790
+ #
791
+ # require "googleauth"
792
+ #
793
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
794
+ # json_key_io: ::File.open("/path/to/keyfile.json")
795
+ # )
796
+ #
797
+ # client = ::Google::Cloud::Support::V2::SupportEventSubscriptionService::Client.new do |config|
798
+ # config.credentials = credentials
799
+ # end
800
+ #
801
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
802
+ # external source for authentication to Google Cloud, you must validate it before
803
+ # providing it to a Google API client library. Providing an unvalidated credential
804
+ # configuration to Google APIs can compromise the security of your systems and data.
805
+ # For more information, refer to [Validate credential configurations from external
806
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
807
+ # @return [::Object]
808
+ # @!attribute [rw] scope
809
+ # The OAuth scopes
810
+ # @return [::Array<::String>]
811
+ # @!attribute [rw] lib_name
812
+ # The library name as recorded in instrumentation and logging
813
+ # @return [::String]
814
+ # @!attribute [rw] lib_version
815
+ # The library version as recorded in instrumentation and logging
816
+ # @return [::String]
817
+ # @!attribute [rw] channel_args
818
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
819
+ # `GRPC::Core::Channel` object is provided as the credential.
820
+ # @return [::Hash]
821
+ # @!attribute [rw] interceptors
822
+ # An array of interceptors that are run before calls are executed.
823
+ # @return [::Array<::GRPC::ClientInterceptor>]
824
+ # @!attribute [rw] timeout
825
+ # The call timeout in seconds.
826
+ # @return [::Numeric]
827
+ # @!attribute [rw] metadata
828
+ # Additional gRPC headers to be sent with the call.
829
+ # @return [::Hash{::Symbol=>::String}]
830
+ # @!attribute [rw] retry_policy
831
+ # The retry policy. The value is a hash with the following keys:
832
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
833
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
834
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
835
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
836
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
837
+ # trigger a retry.
838
+ # @return [::Hash]
839
+ # @!attribute [rw] quota_project
840
+ # A separate project against which to charge quota.
841
+ # @return [::String]
842
+ # @!attribute [rw] universe_domain
843
+ # The universe domain within which to make requests. This determines the
844
+ # default endpoint URL. The default value of nil uses the environment
845
+ # universe (usually the default "googleapis.com" universe).
846
+ # @return [::String,nil]
847
+ # @!attribute [rw] logger
848
+ # A custom logger to use for request/response debug logging, or the value
849
+ # `:default` (the default) to construct a default logger, or `nil` to
850
+ # explicitly disable logging.
851
+ # @return [::Logger,:default,nil]
852
+ #
853
+ class Configuration
854
+ extend ::Gapic::Config
855
+
856
+ # @private
857
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
858
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
859
+
860
+ config_attr :endpoint, nil, ::String, nil
861
+ config_attr :credentials, nil do |value|
862
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
863
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
864
+ allowed.any? { |klass| klass === value }
865
+ end
866
+ config_attr :scope, nil, ::String, ::Array, nil
867
+ config_attr :lib_name, nil, ::String, nil
868
+ config_attr :lib_version, nil, ::String, nil
869
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
870
+ config_attr :interceptors, nil, ::Array, nil
871
+ config_attr :timeout, nil, ::Numeric, nil
872
+ config_attr :metadata, nil, ::Hash, nil
873
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
874
+ config_attr :quota_project, nil, ::String, nil
875
+ config_attr :universe_domain, nil, ::String, nil
876
+ config_attr :logger, :default, ::Logger, nil, :default
877
+
878
+ # @private
879
+ def initialize parent_config = nil
880
+ @parent_config = parent_config unless parent_config.nil?
881
+
882
+ yield self if block_given?
883
+ end
884
+
885
+ ##
886
+ # Configurations for individual RPCs
887
+ # @return [Rpcs]
888
+ #
889
+ def rpcs
890
+ @rpcs ||= begin
891
+ parent_rpcs = nil
892
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
893
+ Rpcs.new parent_rpcs
894
+ end
895
+ end
896
+
897
+ ##
898
+ # Configuration for the channel pool
899
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
900
+ #
901
+ def channel_pool
902
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
903
+ end
904
+
905
+ ##
906
+ # Configuration RPC class for the SupportEventSubscriptionService API.
907
+ #
908
+ # Includes fields providing the configuration for each RPC in this service.
909
+ # Each configuration object is of type `Gapic::Config::Method` and includes
910
+ # the following configuration fields:
911
+ #
912
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
913
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
914
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
915
+ # include the following keys:
916
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
917
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
918
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
919
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
920
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
921
+ # trigger a retry.
922
+ #
923
+ class Rpcs
924
+ ##
925
+ # RPC-specific configuration for `create_support_event_subscription`
926
+ # @return [::Gapic::Config::Method]
927
+ #
928
+ attr_reader :create_support_event_subscription
929
+ ##
930
+ # RPC-specific configuration for `get_support_event_subscription`
931
+ # @return [::Gapic::Config::Method]
932
+ #
933
+ attr_reader :get_support_event_subscription
934
+ ##
935
+ # RPC-specific configuration for `list_support_event_subscriptions`
936
+ # @return [::Gapic::Config::Method]
937
+ #
938
+ attr_reader :list_support_event_subscriptions
939
+ ##
940
+ # RPC-specific configuration for `update_support_event_subscription`
941
+ # @return [::Gapic::Config::Method]
942
+ #
943
+ attr_reader :update_support_event_subscription
944
+ ##
945
+ # RPC-specific configuration for `delete_support_event_subscription`
946
+ # @return [::Gapic::Config::Method]
947
+ #
948
+ attr_reader :delete_support_event_subscription
949
+ ##
950
+ # RPC-specific configuration for `undelete_support_event_subscription`
951
+ # @return [::Gapic::Config::Method]
952
+ #
953
+ attr_reader :undelete_support_event_subscription
954
+
955
+ # @private
956
+ def initialize parent_rpcs = nil
957
+ create_support_event_subscription_config = parent_rpcs.create_support_event_subscription if parent_rpcs.respond_to? :create_support_event_subscription
958
+ @create_support_event_subscription = ::Gapic::Config::Method.new create_support_event_subscription_config
959
+ get_support_event_subscription_config = parent_rpcs.get_support_event_subscription if parent_rpcs.respond_to? :get_support_event_subscription
960
+ @get_support_event_subscription = ::Gapic::Config::Method.new get_support_event_subscription_config
961
+ list_support_event_subscriptions_config = parent_rpcs.list_support_event_subscriptions if parent_rpcs.respond_to? :list_support_event_subscriptions
962
+ @list_support_event_subscriptions = ::Gapic::Config::Method.new list_support_event_subscriptions_config
963
+ update_support_event_subscription_config = parent_rpcs.update_support_event_subscription if parent_rpcs.respond_to? :update_support_event_subscription
964
+ @update_support_event_subscription = ::Gapic::Config::Method.new update_support_event_subscription_config
965
+ delete_support_event_subscription_config = parent_rpcs.delete_support_event_subscription if parent_rpcs.respond_to? :delete_support_event_subscription
966
+ @delete_support_event_subscription = ::Gapic::Config::Method.new delete_support_event_subscription_config
967
+ undelete_support_event_subscription_config = parent_rpcs.undelete_support_event_subscription if parent_rpcs.respond_to? :undelete_support_event_subscription
968
+ @undelete_support_event_subscription = ::Gapic::Config::Method.new undelete_support_event_subscription_config
969
+
970
+ yield self if block_given?
971
+ end
972
+ end
973
+ end
974
+ end
975
+ end
976
+ end
977
+ end
978
+ end
979
+ end