google-apps-events-subscriptions-v1beta 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/apps/events/subscriptions/v1beta/rest.rb +39 -0
  6. data/lib/google/apps/events/subscriptions/v1beta/subscription_resource_pb.rb +59 -0
  7. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/client.rb +1077 -0
  8. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/credentials.rb +63 -0
  9. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/operations.rb +815 -0
  10. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/paths.rb +80 -0
  11. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/rest/client.rb +1025 -0
  12. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/rest/operations.rb +916 -0
  13. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/rest/service_stub.rb +448 -0
  14. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service/rest.rb +55 -0
  15. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service.rb +58 -0
  16. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service_pb.rb +65 -0
  17. data/lib/google/apps/events/subscriptions/v1beta/subscriptions_service_services_pb.rb +75 -0
  18. data/lib/google/apps/events/subscriptions/v1beta/version.rb +7 -2
  19. data/lib/google/apps/events/subscriptions/v1beta.rb +47 -0
  20. data/lib/google-apps-events-subscriptions-v1beta.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +473 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/field_info.rb +88 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +227 -0
  27. data/proto_docs/google/apps/events/subscriptions/v1beta/subscription_resource.rb +257 -0
  28. data/proto_docs/google/apps/events/subscriptions/v1beta/subscriptions_service.rb +217 -0
  29. data/proto_docs/google/longrunning/operations.rb +173 -0
  30. data/proto_docs/google/protobuf/any.rb +145 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/rpc/status.rb +48 -0
  36. metadata +70 -9
@@ -0,0 +1,1025 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/apps/events/subscriptions/v1beta/subscriptions_service_pb"
21
+ require "google/apps/events/subscriptions/v1beta/subscriptions_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Apps
25
+ module Events
26
+ module Subscriptions
27
+ module V1beta
28
+ module SubscriptionsService
29
+ module Rest
30
+ ##
31
+ # REST client for the SubscriptionsService service.
32
+ #
33
+ # A service that manages subscriptions to Google Workspace events.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "workspaceevents.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :subscriptions_service_stub
46
+
47
+ ##
48
+ # Configure the SubscriptionsService Client class.
49
+ #
50
+ # See {::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all SubscriptionsService clients
56
+ # ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Apps", "Events", "Subscriptions", "V1beta"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.rpcs.create_subscription.timeout = 60.0
77
+
78
+ default_config.rpcs.delete_subscription.timeout = 60.0
79
+
80
+ default_config.rpcs.get_subscription.timeout = 60.0
81
+ default_config.rpcs.get_subscription.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.list_subscriptions.timeout = 60.0
86
+ default_config.rpcs.list_subscriptions.retry_policy = {
87
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
88
+ }
89
+
90
+ default_config.rpcs.update_subscription.timeout = 60.0
91
+
92
+ default_config.rpcs.reactivate_subscription.timeout = 60.0
93
+
94
+ default_config
95
+ end
96
+ yield @configure if block_given?
97
+ @configure
98
+ end
99
+
100
+ ##
101
+ # Configure the SubscriptionsService Client instance.
102
+ #
103
+ # The configuration is set to the derived mode, meaning that values can be changed,
104
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
105
+ # should be made on {Client.configure}.
106
+ #
107
+ # See {::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client::Configuration}
108
+ # for a description of the configuration fields.
109
+ #
110
+ # @yield [config] Configure the Client client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ # @return [Client::Configuration]
114
+ #
115
+ def configure
116
+ yield @config if block_given?
117
+ @config
118
+ end
119
+
120
+ ##
121
+ # The effective universe domain
122
+ #
123
+ # @return [String]
124
+ #
125
+ def universe_domain
126
+ @subscriptions_service_stub.universe_domain
127
+ end
128
+
129
+ ##
130
+ # Create a new SubscriptionsService REST client object.
131
+ #
132
+ # @example
133
+ #
134
+ # # Create a client using the default configuration
135
+ # client = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
136
+ #
137
+ # # Create a client using a custom configuration
138
+ # client = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new do |config|
139
+ # config.timeout = 10.0
140
+ # end
141
+ #
142
+ # @yield [config] Configure the SubscriptionsService client.
143
+ # @yieldparam config [Client::Configuration]
144
+ #
145
+ def initialize
146
+ # Create the configuration object
147
+ @config = Configuration.new Client.configure
148
+
149
+ # Yield the configuration if needed
150
+ yield @config if block_given?
151
+
152
+ # Create credentials
153
+ credentials = @config.credentials
154
+ # Use self-signed JWT if the endpoint is unchanged from default,
155
+ # but only if the default endpoint does not have a region prefix.
156
+ enable_self_signed_jwt = @config.endpoint.nil? ||
157
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
158
+ !@config.endpoint.split(".").first.include?("-"))
159
+ credentials ||= Credentials.default scope: @config.scope,
160
+ enable_self_signed_jwt: enable_self_signed_jwt
161
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
162
+ credentials = Credentials.new credentials, scope: @config.scope
163
+ end
164
+
165
+ @quota_project_id = @config.quota_project
166
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
167
+
168
+ @operations_client = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Operations.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @config.endpoint
172
+ config.universe_domain = @config.universe_domain
173
+ end
174
+
175
+ @subscriptions_service_stub = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::ServiceStub.new(
176
+ endpoint: @config.endpoint,
177
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
178
+ universe_domain: @config.universe_domain,
179
+ credentials: credentials,
180
+ logger: @config.logger
181
+ )
182
+
183
+ @subscriptions_service_stub.logger(stub: true)&.info do |entry|
184
+ entry.set_system_name
185
+ entry.set_service
186
+ entry.message = "Created client for #{entry.service}"
187
+ entry.set_credentials_fields credentials
188
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
189
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
190
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
191
+ end
192
+ end
193
+
194
+ ##
195
+ # Get the associated client for long-running operations.
196
+ #
197
+ # @return [::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Operations]
198
+ #
199
+ attr_reader :operations_client
200
+
201
+ ##
202
+ # The logger used for request/response debug logging.
203
+ #
204
+ # @return [Logger]
205
+ #
206
+ def logger
207
+ @subscriptions_service_stub.logger
208
+ end
209
+
210
+ # Service calls
211
+
212
+ ##
213
+ # Creates a Google Workspace subscription. To learn how to use this
214
+ # method, see [Create a Google Workspace
215
+ # subscription](https://developers.google.com/workspace/events/guides/create-subscription).
216
+ #
217
+ # @overload create_subscription(request, options = nil)
218
+ # Pass arguments to `create_subscription` via a request object, either of type
219
+ # {::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest} or an equivalent Hash.
220
+ #
221
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest, ::Hash]
222
+ # A request object representing the call parameters. Required. To specify no
223
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
224
+ # @param options [::Gapic::CallOptions, ::Hash]
225
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
226
+ #
227
+ # @overload create_subscription(subscription: nil, validate_only: nil)
228
+ # Pass arguments to `create_subscription` via keyword arguments. Note that at
229
+ # least one keyword argument is required. To specify no parameters, or to keep all
230
+ # the default parameter values, pass an empty Hash as a request object (see above).
231
+ #
232
+ # @param subscription [::Google::Apps::Events::Subscriptions::V1beta::Subscription, ::Hash]
233
+ # Required. The subscription resource to create.
234
+ # @param validate_only [::Boolean]
235
+ # Optional. If set to `true`, validates and previews the request, but doesn't
236
+ # create the subscription.
237
+ # @yield [result, operation] Access the result along with the TransportOperation object
238
+ # @yieldparam result [::Gapic::Operation]
239
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
240
+ #
241
+ # @return [::Gapic::Operation]
242
+ #
243
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
244
+ #
245
+ # @example Basic example
246
+ # require "google/apps/events/subscriptions/v1beta"
247
+ #
248
+ # # Create a client object. The client can be reused for multiple calls.
249
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
250
+ #
251
+ # # Create a request. To set request fields, pass in keyword arguments.
252
+ # request = Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest.new
253
+ #
254
+ # # Call the create_subscription method.
255
+ # result = client.create_subscription request
256
+ #
257
+ # # The returned object is of type Gapic::Operation. You can use it to
258
+ # # check the status of an operation, cancel it, or wait for results.
259
+ # # Here is how to wait for a response.
260
+ # result.wait_until_done! timeout: 60
261
+ # if result.response?
262
+ # p result.response
263
+ # else
264
+ # puts "No response received."
265
+ # end
266
+ #
267
+ def create_subscription request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ call_metadata = @config.rpcs.create_subscription.metadata.to_h
277
+
278
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
282
+ transports_version_send: [:rest]
283
+
284
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
285
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
286
+
287
+ options.apply_defaults timeout: @config.rpcs.create_subscription.timeout,
288
+ metadata: call_metadata,
289
+ retry_policy: @config.rpcs.create_subscription.retry_policy
290
+
291
+ options.apply_defaults timeout: @config.timeout,
292
+ metadata: @config.metadata,
293
+ retry_policy: @config.retry_policy
294
+
295
+ @subscriptions_service_stub.create_subscription request, options do |result, operation|
296
+ result = ::Gapic::Operation.new result, @operations_client, options: options
297
+ yield result, operation if block_given?
298
+ throw :response, result
299
+ end
300
+ rescue ::Gapic::Rest::Error => e
301
+ raise ::Google::Cloud::Error.from_error(e)
302
+ end
303
+
304
+ ##
305
+ # Deletes a Google Workspace subscription.
306
+ # To learn how to use this method, see [Delete a Google Workspace
307
+ # subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
308
+ #
309
+ # @overload delete_subscription(request, options = nil)
310
+ # Pass arguments to `delete_subscription` via a request object, either of type
311
+ # {::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
318
+ #
319
+ # @overload delete_subscription(name: nil, validate_only: nil, allow_missing: nil, etag: nil)
320
+ # Pass arguments to `delete_subscription` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param name [::String]
325
+ # Required. Resource name of the subscription to delete.
326
+ #
327
+ # Format: `subscriptions/{subscription}`
328
+ # @param validate_only [::Boolean]
329
+ # Optional. If set to `true`, validates and previews the request, but doesn't
330
+ # delete the subscription.
331
+ # @param allow_missing [::Boolean]
332
+ # Optional. If set to `true` and the subscription isn't found, the request
333
+ # succeeds but doesn't delete the subscription.
334
+ # @param etag [::String]
335
+ # Optional. Etag of the subscription.
336
+ #
337
+ # If present, it must match with the server's etag. Otherwise, request
338
+ # fails with the status `ABORTED`.
339
+ # @yield [result, operation] Access the result along with the TransportOperation object
340
+ # @yieldparam result [::Gapic::Operation]
341
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
342
+ #
343
+ # @return [::Gapic::Operation]
344
+ #
345
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
346
+ #
347
+ # @example Basic example
348
+ # require "google/apps/events/subscriptions/v1beta"
349
+ #
350
+ # # Create a client object. The client can be reused for multiple calls.
351
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
352
+ #
353
+ # # Create a request. To set request fields, pass in keyword arguments.
354
+ # request = Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest.new
355
+ #
356
+ # # Call the delete_subscription method.
357
+ # result = client.delete_subscription request
358
+ #
359
+ # # The returned object is of type Gapic::Operation. You can use it to
360
+ # # check the status of an operation, cancel it, or wait for results.
361
+ # # Here is how to wait for a response.
362
+ # result.wait_until_done! timeout: 60
363
+ # if result.response?
364
+ # p result.response
365
+ # else
366
+ # puts "No response received."
367
+ # end
368
+ #
369
+ def delete_subscription request, options = nil
370
+ raise ::ArgumentError, "request must be provided" if request.nil?
371
+
372
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest
373
+
374
+ # Converts hash and nil to an options object
375
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
376
+
377
+ # Customize the options with defaults
378
+ call_metadata = @config.rpcs.delete_subscription.metadata.to_h
379
+
380
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
381
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
382
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
383
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
384
+ transports_version_send: [:rest]
385
+
386
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
387
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
388
+
389
+ options.apply_defaults timeout: @config.rpcs.delete_subscription.timeout,
390
+ metadata: call_metadata,
391
+ retry_policy: @config.rpcs.delete_subscription.retry_policy
392
+
393
+ options.apply_defaults timeout: @config.timeout,
394
+ metadata: @config.metadata,
395
+ retry_policy: @config.retry_policy
396
+
397
+ @subscriptions_service_stub.delete_subscription request, options do |result, operation|
398
+ result = ::Gapic::Operation.new result, @operations_client, options: options
399
+ yield result, operation if block_given?
400
+ throw :response, result
401
+ end
402
+ rescue ::Gapic::Rest::Error => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Gets details about a Google Workspace subscription. To learn how to use
408
+ # this method, see [Get details about a Google Workspace
409
+ # subscription](https://developers.google.com/workspace/events/guides/get-subscription).
410
+ #
411
+ # @overload get_subscription(request, options = nil)
412
+ # Pass arguments to `get_subscription` via a request object, either of type
413
+ # {::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest} or an equivalent Hash.
414
+ #
415
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest, ::Hash]
416
+ # A request object representing the call parameters. Required. To specify no
417
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
418
+ # @param options [::Gapic::CallOptions, ::Hash]
419
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
420
+ #
421
+ # @overload get_subscription(name: nil)
422
+ # Pass arguments to `get_subscription` via keyword arguments. Note that at
423
+ # least one keyword argument is required. To specify no parameters, or to keep all
424
+ # the default parameter values, pass an empty Hash as a request object (see above).
425
+ #
426
+ # @param name [::String]
427
+ # Required. Resource name of the subscription.
428
+ #
429
+ # Format: `subscriptions/{subscription}`
430
+ # @yield [result, operation] Access the result along with the TransportOperation object
431
+ # @yieldparam result [::Google::Apps::Events::Subscriptions::V1beta::Subscription]
432
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
433
+ #
434
+ # @return [::Google::Apps::Events::Subscriptions::V1beta::Subscription]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/apps/events/subscriptions/v1beta"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest.new
446
+ #
447
+ # # Call the get_subscription method.
448
+ # result = client.get_subscription request
449
+ #
450
+ # # The returned object is of type Google::Apps::Events::Subscriptions::V1beta::Subscription.
451
+ # p result
452
+ #
453
+ def get_subscription request, options = nil
454
+ raise ::ArgumentError, "request must be provided" if request.nil?
455
+
456
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest
457
+
458
+ # Converts hash and nil to an options object
459
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
+
461
+ # Customize the options with defaults
462
+ call_metadata = @config.rpcs.get_subscription.metadata.to_h
463
+
464
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
465
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
467
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
468
+ transports_version_send: [:rest]
469
+
470
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
471
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
472
+
473
+ options.apply_defaults timeout: @config.rpcs.get_subscription.timeout,
474
+ metadata: call_metadata,
475
+ retry_policy: @config.rpcs.get_subscription.retry_policy
476
+
477
+ options.apply_defaults timeout: @config.timeout,
478
+ metadata: @config.metadata,
479
+ retry_policy: @config.retry_policy
480
+
481
+ @subscriptions_service_stub.get_subscription request, options do |result, operation|
482
+ yield result, operation if block_given?
483
+ end
484
+ rescue ::Gapic::Rest::Error => e
485
+ raise ::Google::Cloud::Error.from_error(e)
486
+ end
487
+
488
+ ##
489
+ # Lists Google Workspace subscriptions. To learn how to use this method, see
490
+ # [List Google Workspace
491
+ # subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
492
+ #
493
+ # @overload list_subscriptions(request, options = nil)
494
+ # Pass arguments to `list_subscriptions` via a request object, either of type
495
+ # {::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest} or an equivalent Hash.
496
+ #
497
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest, ::Hash]
498
+ # A request object representing the call parameters. Required. To specify no
499
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
500
+ # @param options [::Gapic::CallOptions, ::Hash]
501
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
502
+ #
503
+ # @overload list_subscriptions(page_size: nil, page_token: nil, filter: nil)
504
+ # Pass arguments to `list_subscriptions` via keyword arguments. Note that at
505
+ # least one keyword argument is required. To specify no parameters, or to keep all
506
+ # the default parameter values, pass an empty Hash as a request object (see above).
507
+ #
508
+ # @param page_size [::Integer]
509
+ # Optional. The maximum number of subscriptions to return. The service might
510
+ # return fewer than this value.
511
+ #
512
+ # If unspecified or set to `0`, up to 50 subscriptions are returned.
513
+ #
514
+ # The maximum value is 100. If you specify a value more than 100, the system
515
+ # only returns 100 subscriptions.
516
+ # @param page_token [::String]
517
+ # Optional. A page token, received from a previous list subscriptions call.
518
+ # Provide this parameter to retrieve the subsequent page.
519
+ #
520
+ # When paginating, the filter value should match the call that provided the
521
+ # page token. Passing a different value might lead to unexpected results.
522
+ # @param filter [::String]
523
+ # Required. A query filter.
524
+ #
525
+ # You can filter subscriptions by event type (`event_types`)
526
+ # and target resource (`target_resource`).
527
+ #
528
+ # You must specify at least one event type in your query. To filter for
529
+ # multiple event types, use the `OR` operator.
530
+ #
531
+ # To filter by both event type and target resource, use the `AND` operator
532
+ # and specify the full resource name, such as
533
+ # `//chat.googleapis.com/spaces/{space}`.
534
+ #
535
+ # For example, the following queries are valid:
536
+ #
537
+ # ```
538
+ # event_types:"google.workspace.chat.membership.v1.updated" OR
539
+ # event_types:"google.workspace.chat.message.v1.created"
540
+ #
541
+ # event_types:"google.workspace.chat.message.v1.created" AND
542
+ # target_resource="//chat.googleapis.com/spaces/\\{space}"
543
+ #
544
+ # ( event_types:"google.workspace.chat.membership.v1.updated" OR
545
+ # event_types:"google.workspace.chat.message.v1.created" ) AND
546
+ # target_resource="//chat.googleapis.com/spaces/\\{space}"
547
+ # ```
548
+ #
549
+ # The server rejects invalid queries with an `INVALID_ARGUMENT`
550
+ # error.
551
+ # @yield [result, operation] Access the result along with the TransportOperation object
552
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1beta::Subscription>]
553
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
554
+ #
555
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1beta::Subscription>]
556
+ #
557
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
558
+ #
559
+ # @example Basic example
560
+ # require "google/apps/events/subscriptions/v1beta"
561
+ #
562
+ # # Create a client object. The client can be reused for multiple calls.
563
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
564
+ #
565
+ # # Create a request. To set request fields, pass in keyword arguments.
566
+ # request = Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest.new
567
+ #
568
+ # # Call the list_subscriptions method.
569
+ # result = client.list_subscriptions request
570
+ #
571
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
572
+ # # over elements, and API calls will be issued to fetch pages as needed.
573
+ # result.each do |item|
574
+ # # Each element is of type ::Google::Apps::Events::Subscriptions::V1beta::Subscription.
575
+ # p item
576
+ # end
577
+ #
578
+ def list_subscriptions request, options = nil
579
+ raise ::ArgumentError, "request must be provided" if request.nil?
580
+
581
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest
582
+
583
+ # Converts hash and nil to an options object
584
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
585
+
586
+ # Customize the options with defaults
587
+ call_metadata = @config.rpcs.list_subscriptions.metadata.to_h
588
+
589
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
590
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
591
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
592
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
593
+ transports_version_send: [:rest]
594
+
595
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
596
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
597
+
598
+ options.apply_defaults timeout: @config.rpcs.list_subscriptions.timeout,
599
+ metadata: call_metadata,
600
+ retry_policy: @config.rpcs.list_subscriptions.retry_policy
601
+
602
+ options.apply_defaults timeout: @config.timeout,
603
+ metadata: @config.metadata,
604
+ retry_policy: @config.retry_policy
605
+
606
+ @subscriptions_service_stub.list_subscriptions request, options do |result, operation|
607
+ result = ::Gapic::Rest::PagedEnumerable.new @subscriptions_service_stub, :list_subscriptions, "subscriptions", request, result, options
608
+ yield result, operation if block_given?
609
+ throw :response, result
610
+ end
611
+ rescue ::Gapic::Rest::Error => e
612
+ raise ::Google::Cloud::Error.from_error(e)
613
+ end
614
+
615
+ ##
616
+ # Updates or renews a Google Workspace subscription. To learn how to use this
617
+ # method, see [Update or renew a Google Workspace
618
+ # subscription](https://developers.google.com/workspace/events/guides/update-subscription).
619
+ #
620
+ # @overload update_subscription(request, options = nil)
621
+ # Pass arguments to `update_subscription` via a request object, either of type
622
+ # {::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest} or an equivalent Hash.
623
+ #
624
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest, ::Hash]
625
+ # A request object representing the call parameters. Required. To specify no
626
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
627
+ # @param options [::Gapic::CallOptions, ::Hash]
628
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
629
+ #
630
+ # @overload update_subscription(subscription: nil, update_mask: nil, validate_only: nil)
631
+ # Pass arguments to `update_subscription` via keyword arguments. Note that at
632
+ # least one keyword argument is required. To specify no parameters, or to keep all
633
+ # the default parameter values, pass an empty Hash as a request object (see above).
634
+ #
635
+ # @param subscription [::Google::Apps::Events::Subscriptions::V1beta::Subscription, ::Hash]
636
+ # Required. The subscription to update.
637
+ #
638
+ # The subscription's `name` field is used to identify the subscription to
639
+ # update.
640
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
641
+ # Optional. The field to update. If omitted, updates any fields included in
642
+ # the request.
643
+ #
644
+ # You can update one of the following fields in a subscription:
645
+ #
646
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#expire_time `expire_time`}: The timestamp when the
647
+ # subscription expires.
648
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#ttl `ttl`}: The
649
+ # time-to-live (TTL) or duration of the
650
+ # subscription.
651
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#event_types `event_types`}: The list of event types to
652
+ # receive about the target resource.
653
+ #
654
+ # To fully replace the subscription (the equivalent of `PUT`), use `*`. Any
655
+ # omitted fields are updated with empty values.
656
+ # @param validate_only [::Boolean]
657
+ # Optional. If set to `true`, validates and previews the request, but doesn't
658
+ # update the subscription.
659
+ # @yield [result, operation] Access the result along with the TransportOperation object
660
+ # @yieldparam result [::Gapic::Operation]
661
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
662
+ #
663
+ # @return [::Gapic::Operation]
664
+ #
665
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
666
+ #
667
+ # @example Basic example
668
+ # require "google/apps/events/subscriptions/v1beta"
669
+ #
670
+ # # Create a client object. The client can be reused for multiple calls.
671
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
672
+ #
673
+ # # Create a request. To set request fields, pass in keyword arguments.
674
+ # request = Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest.new
675
+ #
676
+ # # Call the update_subscription method.
677
+ # result = client.update_subscription request
678
+ #
679
+ # # The returned object is of type Gapic::Operation. You can use it to
680
+ # # check the status of an operation, cancel it, or wait for results.
681
+ # # Here is how to wait for a response.
682
+ # result.wait_until_done! timeout: 60
683
+ # if result.response?
684
+ # p result.response
685
+ # else
686
+ # puts "No response received."
687
+ # end
688
+ #
689
+ def update_subscription request, options = nil
690
+ raise ::ArgumentError, "request must be provided" if request.nil?
691
+
692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest
693
+
694
+ # Converts hash and nil to an options object
695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
696
+
697
+ # Customize the options with defaults
698
+ call_metadata = @config.rpcs.update_subscription.metadata.to_h
699
+
700
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
701
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
703
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
704
+ transports_version_send: [:rest]
705
+
706
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
707
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
708
+
709
+ options.apply_defaults timeout: @config.rpcs.update_subscription.timeout,
710
+ metadata: call_metadata,
711
+ retry_policy: @config.rpcs.update_subscription.retry_policy
712
+
713
+ options.apply_defaults timeout: @config.timeout,
714
+ metadata: @config.metadata,
715
+ retry_policy: @config.retry_policy
716
+
717
+ @subscriptions_service_stub.update_subscription request, options do |result, operation|
718
+ result = ::Gapic::Operation.new result, @operations_client, options: options
719
+ yield result, operation if block_given?
720
+ throw :response, result
721
+ end
722
+ rescue ::Gapic::Rest::Error => e
723
+ raise ::Google::Cloud::Error.from_error(e)
724
+ end
725
+
726
+ ##
727
+ # Reactivates a suspended Google Workspace subscription.
728
+ #
729
+ # This method resets your subscription's `State` field to `ACTIVE`. Before
730
+ # you use this method, you must fix the error that suspended the
731
+ # subscription. This method will ignore or reject any subscription that
732
+ # isn't currently in a suspended state. To learn how to use this method, see
733
+ # [Reactivate a Google Workspace
734
+ # subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
735
+ #
736
+ # @overload reactivate_subscription(request, options = nil)
737
+ # Pass arguments to `reactivate_subscription` via a request object, either of type
738
+ # {::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest} or an equivalent Hash.
739
+ #
740
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest, ::Hash]
741
+ # A request object representing the call parameters. Required. To specify no
742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
743
+ # @param options [::Gapic::CallOptions, ::Hash]
744
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
745
+ #
746
+ # @overload reactivate_subscription(name: nil)
747
+ # Pass arguments to `reactivate_subscription` via keyword arguments. Note that at
748
+ # least one keyword argument is required. To specify no parameters, or to keep all
749
+ # the default parameter values, pass an empty Hash as a request object (see above).
750
+ #
751
+ # @param name [::String]
752
+ # Required. Resource name of the subscription.
753
+ #
754
+ # Format: `subscriptions/{subscription}`
755
+ # @yield [result, operation] Access the result along with the TransportOperation object
756
+ # @yieldparam result [::Gapic::Operation]
757
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
758
+ #
759
+ # @return [::Gapic::Operation]
760
+ #
761
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
762
+ #
763
+ # @example Basic example
764
+ # require "google/apps/events/subscriptions/v1beta"
765
+ #
766
+ # # Create a client object. The client can be reused for multiple calls.
767
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new
768
+ #
769
+ # # Create a request. To set request fields, pass in keyword arguments.
770
+ # request = Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest.new
771
+ #
772
+ # # Call the reactivate_subscription method.
773
+ # result = client.reactivate_subscription request
774
+ #
775
+ # # The returned object is of type Gapic::Operation. You can use it to
776
+ # # check the status of an operation, cancel it, or wait for results.
777
+ # # Here is how to wait for a response.
778
+ # result.wait_until_done! timeout: 60
779
+ # if result.response?
780
+ # p result.response
781
+ # else
782
+ # puts "No response received."
783
+ # end
784
+ #
785
+ def reactivate_subscription request, options = nil
786
+ raise ::ArgumentError, "request must be provided" if request.nil?
787
+
788
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest
789
+
790
+ # Converts hash and nil to an options object
791
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
792
+
793
+ # Customize the options with defaults
794
+ call_metadata = @config.rpcs.reactivate_subscription.metadata.to_h
795
+
796
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
797
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
798
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
799
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION,
800
+ transports_version_send: [:rest]
801
+
802
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
803
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
+
805
+ options.apply_defaults timeout: @config.rpcs.reactivate_subscription.timeout,
806
+ metadata: call_metadata,
807
+ retry_policy: @config.rpcs.reactivate_subscription.retry_policy
808
+
809
+ options.apply_defaults timeout: @config.timeout,
810
+ metadata: @config.metadata,
811
+ retry_policy: @config.retry_policy
812
+
813
+ @subscriptions_service_stub.reactivate_subscription request, options do |result, operation|
814
+ result = ::Gapic::Operation.new result, @operations_client, options: options
815
+ yield result, operation if block_given?
816
+ throw :response, result
817
+ end
818
+ rescue ::Gapic::Rest::Error => e
819
+ raise ::Google::Cloud::Error.from_error(e)
820
+ end
821
+
822
+ ##
823
+ # Configuration class for the SubscriptionsService REST API.
824
+ #
825
+ # This class represents the configuration for SubscriptionsService REST,
826
+ # providing control over timeouts, retry behavior, logging, transport
827
+ # parameters, and other low-level controls. Certain parameters can also be
828
+ # applied individually to specific RPCs. See
829
+ # {::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client::Configuration::Rpcs}
830
+ # for a list of RPCs that can be configured independently.
831
+ #
832
+ # Configuration can be applied globally to all clients, or to a single client
833
+ # on construction.
834
+ #
835
+ # @example
836
+ #
837
+ # # Modify the global config, setting the timeout for
838
+ # # create_subscription to 20 seconds,
839
+ # # and all remaining timeouts to 10 seconds.
840
+ # ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.configure do |config|
841
+ # config.timeout = 10.0
842
+ # config.rpcs.create_subscription.timeout = 20.0
843
+ # end
844
+ #
845
+ # # Apply the above configuration only to a new client.
846
+ # client = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Rest::Client.new do |config|
847
+ # config.timeout = 10.0
848
+ # config.rpcs.create_subscription.timeout = 20.0
849
+ # end
850
+ #
851
+ # @!attribute [rw] endpoint
852
+ # A custom service endpoint, as a hostname or hostname:port. The default is
853
+ # nil, indicating to use the default endpoint in the current universe domain.
854
+ # @return [::String,nil]
855
+ # @!attribute [rw] credentials
856
+ # Credentials to send with calls. You may provide any of the following types:
857
+ # * (`String`) The path to a service account key file in JSON format
858
+ # * (`Hash`) A service account key as a Hash
859
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
860
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
861
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
862
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
863
+ # * (`nil`) indicating no credentials
864
+ #
865
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
866
+ # external source for authentication to Google Cloud, you must validate it before
867
+ # providing it to a Google API client library. Providing an unvalidated credential
868
+ # configuration to Google APIs can compromise the security of your systems and data.
869
+ # For more information, refer to [Validate credential configurations from external
870
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
871
+ # @return [::Object]
872
+ # @!attribute [rw] scope
873
+ # The OAuth scopes
874
+ # @return [::Array<::String>]
875
+ # @!attribute [rw] lib_name
876
+ # The library name as recorded in instrumentation and logging
877
+ # @return [::String]
878
+ # @!attribute [rw] lib_version
879
+ # The library version as recorded in instrumentation and logging
880
+ # @return [::String]
881
+ # @!attribute [rw] timeout
882
+ # The call timeout in seconds.
883
+ # @return [::Numeric]
884
+ # @!attribute [rw] metadata
885
+ # Additional headers to be sent with the call.
886
+ # @return [::Hash{::Symbol=>::String}]
887
+ # @!attribute [rw] retry_policy
888
+ # The retry policy. The value is a hash with the following keys:
889
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
890
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
891
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
892
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
893
+ # trigger a retry.
894
+ # @return [::Hash]
895
+ # @!attribute [rw] quota_project
896
+ # A separate project against which to charge quota.
897
+ # @return [::String]
898
+ # @!attribute [rw] universe_domain
899
+ # The universe domain within which to make requests. This determines the
900
+ # default endpoint URL. The default value of nil uses the environment
901
+ # universe (usually the default "googleapis.com" universe).
902
+ # @return [::String,nil]
903
+ # @!attribute [rw] logger
904
+ # A custom logger to use for request/response debug logging, or the value
905
+ # `:default` (the default) to construct a default logger, or `nil` to
906
+ # explicitly disable logging.
907
+ # @return [::Logger,:default,nil]
908
+ #
909
+ class Configuration
910
+ extend ::Gapic::Config
911
+
912
+ # @private
913
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
914
+ DEFAULT_ENDPOINT = "workspaceevents.googleapis.com"
915
+
916
+ config_attr :endpoint, nil, ::String, nil
917
+ config_attr :credentials, nil do |value|
918
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
919
+ allowed.any? { |klass| klass === value }
920
+ end
921
+ config_attr :scope, nil, ::String, ::Array, nil
922
+ config_attr :lib_name, nil, ::String, nil
923
+ config_attr :lib_version, nil, ::String, nil
924
+ config_attr :timeout, nil, ::Numeric, nil
925
+ config_attr :metadata, nil, ::Hash, nil
926
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
927
+ config_attr :quota_project, nil, ::String, nil
928
+ config_attr :universe_domain, nil, ::String, nil
929
+ config_attr :logger, :default, ::Logger, nil, :default
930
+
931
+ # @private
932
+ def initialize parent_config = nil
933
+ @parent_config = parent_config unless parent_config.nil?
934
+
935
+ yield self if block_given?
936
+ end
937
+
938
+ ##
939
+ # Configurations for individual RPCs
940
+ # @return [Rpcs]
941
+ #
942
+ def rpcs
943
+ @rpcs ||= begin
944
+ parent_rpcs = nil
945
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
946
+ Rpcs.new parent_rpcs
947
+ end
948
+ end
949
+
950
+ ##
951
+ # Configuration RPC class for the SubscriptionsService API.
952
+ #
953
+ # Includes fields providing the configuration for each RPC in this service.
954
+ # Each configuration object is of type `Gapic::Config::Method` and includes
955
+ # the following configuration fields:
956
+ #
957
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
958
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
959
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
960
+ # include the following keys:
961
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
962
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
963
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
964
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
965
+ # trigger a retry.
966
+ #
967
+ class Rpcs
968
+ ##
969
+ # RPC-specific configuration for `create_subscription`
970
+ # @return [::Gapic::Config::Method]
971
+ #
972
+ attr_reader :create_subscription
973
+ ##
974
+ # RPC-specific configuration for `delete_subscription`
975
+ # @return [::Gapic::Config::Method]
976
+ #
977
+ attr_reader :delete_subscription
978
+ ##
979
+ # RPC-specific configuration for `get_subscription`
980
+ # @return [::Gapic::Config::Method]
981
+ #
982
+ attr_reader :get_subscription
983
+ ##
984
+ # RPC-specific configuration for `list_subscriptions`
985
+ # @return [::Gapic::Config::Method]
986
+ #
987
+ attr_reader :list_subscriptions
988
+ ##
989
+ # RPC-specific configuration for `update_subscription`
990
+ # @return [::Gapic::Config::Method]
991
+ #
992
+ attr_reader :update_subscription
993
+ ##
994
+ # RPC-specific configuration for `reactivate_subscription`
995
+ # @return [::Gapic::Config::Method]
996
+ #
997
+ attr_reader :reactivate_subscription
998
+
999
+ # @private
1000
+ def initialize parent_rpcs = nil
1001
+ create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription
1002
+ @create_subscription = ::Gapic::Config::Method.new create_subscription_config
1003
+ delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription
1004
+ @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config
1005
+ get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription
1006
+ @get_subscription = ::Gapic::Config::Method.new get_subscription_config
1007
+ list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions
1008
+ @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config
1009
+ update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription
1010
+ @update_subscription = ::Gapic::Config::Method.new update_subscription_config
1011
+ reactivate_subscription_config = parent_rpcs.reactivate_subscription if parent_rpcs.respond_to? :reactivate_subscription
1012
+ @reactivate_subscription = ::Gapic::Config::Method.new reactivate_subscription_config
1013
+
1014
+ yield self if block_given?
1015
+ end
1016
+ end
1017
+ end
1018
+ end
1019
+ end
1020
+ end
1021
+ end
1022
+ end
1023
+ end
1024
+ end
1025
+ end