google-apps-events-subscriptions-v1 0.a → 0.1.1

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