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,1077 @@
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
+
22
+ module Google
23
+ module Apps
24
+ module Events
25
+ module Subscriptions
26
+ module V1beta
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::V1beta::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::V1beta::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", "V1beta"]
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::V1beta::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::V1beta::SubscriptionsService::Client.new
134
+ #
135
+ # # Create a client using a custom configuration
136
+ # client = ::Google::Apps::Events::Subscriptions::V1beta::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/v1beta/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::V1beta::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
+ logger: @config.logger
188
+ )
189
+
190
+ @subscriptions_service_stub.stub_logger&.info do |entry|
191
+ entry.set_system_name
192
+ entry.set_service
193
+ entry.message = "Created client for #{entry.service}"
194
+ entry.set_credentials_fields credentials
195
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
196
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
197
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
198
+ end
199
+ end
200
+
201
+ ##
202
+ # Get the associated client for long-running operations.
203
+ #
204
+ # @return [::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Operations]
205
+ #
206
+ attr_reader :operations_client
207
+
208
+ ##
209
+ # The logger used for request/response debug logging.
210
+ #
211
+ # @return [Logger]
212
+ #
213
+ def logger
214
+ @subscriptions_service_stub.logger
215
+ end
216
+
217
+ # Service calls
218
+
219
+ ##
220
+ # Creates a Google Workspace subscription. To learn how to use this
221
+ # method, see [Create a Google Workspace
222
+ # subscription](https://developers.google.com/workspace/events/guides/create-subscription).
223
+ #
224
+ # @overload create_subscription(request, options = nil)
225
+ # Pass arguments to `create_subscription` via a request object, either of type
226
+ # {::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest} or an equivalent Hash.
227
+ #
228
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest, ::Hash]
229
+ # A request object representing the call parameters. Required. To specify no
230
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
231
+ # @param options [::Gapic::CallOptions, ::Hash]
232
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
233
+ #
234
+ # @overload create_subscription(subscription: nil, validate_only: nil)
235
+ # Pass arguments to `create_subscription` via keyword arguments. Note that at
236
+ # least one keyword argument is required. To specify no parameters, or to keep all
237
+ # the default parameter values, pass an empty Hash as a request object (see above).
238
+ #
239
+ # @param subscription [::Google::Apps::Events::Subscriptions::V1beta::Subscription, ::Hash]
240
+ # Required. The subscription resource to create.
241
+ # @param validate_only [::Boolean]
242
+ # Optional. If set to `true`, validates and previews the request, but doesn't
243
+ # create the subscription.
244
+ #
245
+ # @yield [response, operation] Access the result along with the RPC operation
246
+ # @yieldparam response [::Gapic::Operation]
247
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
248
+ #
249
+ # @return [::Gapic::Operation]
250
+ #
251
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
252
+ #
253
+ # @example Basic example
254
+ # require "google/apps/events/subscriptions/v1beta"
255
+ #
256
+ # # Create a client object. The client can be reused for multiple calls.
257
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
258
+ #
259
+ # # Create a request. To set request fields, pass in keyword arguments.
260
+ # request = Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest.new
261
+ #
262
+ # # Call the create_subscription method.
263
+ # result = client.create_subscription request
264
+ #
265
+ # # The returned object is of type Gapic::Operation. You can use it to
266
+ # # check the status of an operation, cancel it, or wait for results.
267
+ # # Here is how to wait for a response.
268
+ # result.wait_until_done! timeout: 60
269
+ # if result.response?
270
+ # p result.response
271
+ # else
272
+ # puts "No response received."
273
+ # end
274
+ #
275
+ def create_subscription request, options = nil
276
+ raise ::ArgumentError, "request must be provided" if request.nil?
277
+
278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::CreateSubscriptionRequest
279
+
280
+ # Converts hash and nil to an options object
281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
282
+
283
+ # Customize the options with defaults
284
+ metadata = @config.rpcs.create_subscription.metadata.to_h
285
+
286
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
287
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
289
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
290
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
291
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
292
+
293
+ options.apply_defaults timeout: @config.rpcs.create_subscription.timeout,
294
+ metadata: metadata,
295
+ retry_policy: @config.rpcs.create_subscription.retry_policy
296
+
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata,
299
+ retry_policy: @config.retry_policy
300
+
301
+ @subscriptions_service_stub.call_rpc :create_subscription, request, options: options do |response, operation|
302
+ response = ::Gapic::Operation.new response, @operations_client, options: options
303
+ yield response, operation if block_given?
304
+ throw :response, response
305
+ end
306
+ rescue ::GRPC::BadStatus => e
307
+ raise ::Google::Cloud::Error.from_error(e)
308
+ end
309
+
310
+ ##
311
+ # Deletes a Google Workspace subscription.
312
+ # To learn how to use this method, see [Delete a Google Workspace
313
+ # subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
314
+ #
315
+ # @overload delete_subscription(request, options = nil)
316
+ # Pass arguments to `delete_subscription` via a request object, either of type
317
+ # {::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
324
+ #
325
+ # @overload delete_subscription(name: nil, validate_only: nil, allow_missing: nil, etag: nil)
326
+ # Pass arguments to `delete_subscription` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param name [::String]
331
+ # Required. Resource name of the subscription to delete.
332
+ #
333
+ # Format: `subscriptions/{subscription}`
334
+ # @param validate_only [::Boolean]
335
+ # Optional. If set to `true`, validates and previews the request, but doesn't
336
+ # delete the subscription.
337
+ # @param allow_missing [::Boolean]
338
+ # Optional. If set to `true` and the subscription isn't found, the request
339
+ # succeeds but doesn't delete the subscription.
340
+ # @param etag [::String]
341
+ # Optional. Etag of the subscription.
342
+ #
343
+ # If present, it must match with the server's etag. Otherwise, request
344
+ # fails with the status `ABORTED`.
345
+ #
346
+ # @yield [response, operation] Access the result along with the RPC operation
347
+ # @yieldparam response [::Gapic::Operation]
348
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
349
+ #
350
+ # @return [::Gapic::Operation]
351
+ #
352
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
353
+ #
354
+ # @example Basic example
355
+ # require "google/apps/events/subscriptions/v1beta"
356
+ #
357
+ # # Create a client object. The client can be reused for multiple calls.
358
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
359
+ #
360
+ # # Create a request. To set request fields, pass in keyword arguments.
361
+ # request = Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest.new
362
+ #
363
+ # # Call the delete_subscription method.
364
+ # result = client.delete_subscription request
365
+ #
366
+ # # The returned object is of type Gapic::Operation. You can use it to
367
+ # # check the status of an operation, cancel it, or wait for results.
368
+ # # Here is how to wait for a response.
369
+ # result.wait_until_done! timeout: 60
370
+ # if result.response?
371
+ # p result.response
372
+ # else
373
+ # puts "No response received."
374
+ # end
375
+ #
376
+ def delete_subscription request, options = nil
377
+ raise ::ArgumentError, "request must be provided" if request.nil?
378
+
379
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::DeleteSubscriptionRequest
380
+
381
+ # Converts hash and nil to an options object
382
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
383
+
384
+ # Customize the options with defaults
385
+ metadata = @config.rpcs.delete_subscription.metadata.to_h
386
+
387
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
388
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
389
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
390
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
391
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
392
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
393
+
394
+ header_params = {}
395
+ if request.name
396
+ header_params["name"] = request.name
397
+ end
398
+
399
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
400
+ metadata[:"x-goog-request-params"] ||= request_params_header
401
+
402
+ options.apply_defaults timeout: @config.rpcs.delete_subscription.timeout,
403
+ metadata: metadata,
404
+ retry_policy: @config.rpcs.delete_subscription.retry_policy
405
+
406
+ options.apply_defaults timeout: @config.timeout,
407
+ metadata: @config.metadata,
408
+ retry_policy: @config.retry_policy
409
+
410
+ @subscriptions_service_stub.call_rpc :delete_subscription, request, options: options do |response, operation|
411
+ response = ::Gapic::Operation.new response, @operations_client, options: options
412
+ yield response, operation if block_given?
413
+ throw :response, response
414
+ end
415
+ rescue ::GRPC::BadStatus => e
416
+ raise ::Google::Cloud::Error.from_error(e)
417
+ end
418
+
419
+ ##
420
+ # Gets details about a Google Workspace subscription. To learn how to use
421
+ # this method, see [Get details about a Google Workspace
422
+ # subscription](https://developers.google.com/workspace/events/guides/get-subscription).
423
+ #
424
+ # @overload get_subscription(request, options = nil)
425
+ # Pass arguments to `get_subscription` via a request object, either of type
426
+ # {::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest} or an equivalent Hash.
427
+ #
428
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest, ::Hash]
429
+ # A request object representing the call parameters. Required. To specify no
430
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
431
+ # @param options [::Gapic::CallOptions, ::Hash]
432
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
433
+ #
434
+ # @overload get_subscription(name: nil)
435
+ # Pass arguments to `get_subscription` via keyword arguments. Note that at
436
+ # least one keyword argument is required. To specify no parameters, or to keep all
437
+ # the default parameter values, pass an empty Hash as a request object (see above).
438
+ #
439
+ # @param name [::String]
440
+ # Required. Resource name of the subscription.
441
+ #
442
+ # Format: `subscriptions/{subscription}`
443
+ #
444
+ # @yield [response, operation] Access the result along with the RPC operation
445
+ # @yieldparam response [::Google::Apps::Events::Subscriptions::V1beta::Subscription]
446
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
447
+ #
448
+ # @return [::Google::Apps::Events::Subscriptions::V1beta::Subscription]
449
+ #
450
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
451
+ #
452
+ # @example Basic example
453
+ # require "google/apps/events/subscriptions/v1beta"
454
+ #
455
+ # # Create a client object. The client can be reused for multiple calls.
456
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
457
+ #
458
+ # # Create a request. To set request fields, pass in keyword arguments.
459
+ # request = Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest.new
460
+ #
461
+ # # Call the get_subscription method.
462
+ # result = client.get_subscription request
463
+ #
464
+ # # The returned object is of type Google::Apps::Events::Subscriptions::V1beta::Subscription.
465
+ # p result
466
+ #
467
+ def get_subscription request, options = nil
468
+ raise ::ArgumentError, "request must be provided" if request.nil?
469
+
470
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::GetSubscriptionRequest
471
+
472
+ # Converts hash and nil to an options object
473
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
474
+
475
+ # Customize the options with defaults
476
+ metadata = @config.rpcs.get_subscription.metadata.to_h
477
+
478
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
479
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
480
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
481
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
482
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
483
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
484
+
485
+ header_params = {}
486
+ if request.name
487
+ header_params["name"] = request.name
488
+ end
489
+
490
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
491
+ metadata[:"x-goog-request-params"] ||= request_params_header
492
+
493
+ options.apply_defaults timeout: @config.rpcs.get_subscription.timeout,
494
+ metadata: metadata,
495
+ retry_policy: @config.rpcs.get_subscription.retry_policy
496
+
497
+ options.apply_defaults timeout: @config.timeout,
498
+ metadata: @config.metadata,
499
+ retry_policy: @config.retry_policy
500
+
501
+ @subscriptions_service_stub.call_rpc :get_subscription, request, options: options do |response, operation|
502
+ yield response, operation if block_given?
503
+ end
504
+ rescue ::GRPC::BadStatus => e
505
+ raise ::Google::Cloud::Error.from_error(e)
506
+ end
507
+
508
+ ##
509
+ # Lists Google Workspace subscriptions. To learn how to use this method, see
510
+ # [List Google Workspace
511
+ # subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
512
+ #
513
+ # @overload list_subscriptions(request, options = nil)
514
+ # Pass arguments to `list_subscriptions` via a request object, either of type
515
+ # {::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest} or an equivalent Hash.
516
+ #
517
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest, ::Hash]
518
+ # A request object representing the call parameters. Required. To specify no
519
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
520
+ # @param options [::Gapic::CallOptions, ::Hash]
521
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
522
+ #
523
+ # @overload list_subscriptions(page_size: nil, page_token: nil, filter: nil)
524
+ # Pass arguments to `list_subscriptions` via keyword arguments. Note that at
525
+ # least one keyword argument is required. To specify no parameters, or to keep all
526
+ # the default parameter values, pass an empty Hash as a request object (see above).
527
+ #
528
+ # @param page_size [::Integer]
529
+ # Optional. The maximum number of subscriptions to return. The service might
530
+ # return fewer than this value.
531
+ #
532
+ # If unspecified or set to `0`, up to 50 subscriptions are returned.
533
+ #
534
+ # The maximum value is 100. If you specify a value more than 100, the system
535
+ # only returns 100 subscriptions.
536
+ # @param page_token [::String]
537
+ # Optional. A page token, received from a previous list subscriptions call.
538
+ # Provide this parameter to retrieve the subsequent page.
539
+ #
540
+ # When paginating, the filter value should match the call that provided the
541
+ # page token. Passing a different value might lead to unexpected results.
542
+ # @param filter [::String]
543
+ # Required. A query filter.
544
+ #
545
+ # You can filter subscriptions by event type (`event_types`)
546
+ # and target resource (`target_resource`).
547
+ #
548
+ # You must specify at least one event type in your query. To filter for
549
+ # multiple event types, use the `OR` operator.
550
+ #
551
+ # To filter by both event type and target resource, use the `AND` operator
552
+ # and specify the full resource name, such as
553
+ # `//chat.googleapis.com/spaces/{space}`.
554
+ #
555
+ # For example, the following queries are valid:
556
+ #
557
+ # ```
558
+ # event_types:"google.workspace.chat.membership.v1.updated" OR
559
+ # event_types:"google.workspace.chat.message.v1.created"
560
+ #
561
+ # event_types:"google.workspace.chat.message.v1.created" AND
562
+ # target_resource="//chat.googleapis.com/spaces/\\{space}"
563
+ #
564
+ # ( event_types:"google.workspace.chat.membership.v1.updated" OR
565
+ # event_types:"google.workspace.chat.message.v1.created" ) AND
566
+ # target_resource="//chat.googleapis.com/spaces/\\{space}"
567
+ # ```
568
+ #
569
+ # The server rejects invalid queries with an `INVALID_ARGUMENT`
570
+ # error.
571
+ #
572
+ # @yield [response, operation] Access the result along with the RPC operation
573
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1beta::Subscription>]
574
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
575
+ #
576
+ # @return [::Gapic::PagedEnumerable<::Google::Apps::Events::Subscriptions::V1beta::Subscription>]
577
+ #
578
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
579
+ #
580
+ # @example Basic example
581
+ # require "google/apps/events/subscriptions/v1beta"
582
+ #
583
+ # # Create a client object. The client can be reused for multiple calls.
584
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
585
+ #
586
+ # # Create a request. To set request fields, pass in keyword arguments.
587
+ # request = Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest.new
588
+ #
589
+ # # Call the list_subscriptions method.
590
+ # result = client.list_subscriptions request
591
+ #
592
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
593
+ # # over elements, and API calls will be issued to fetch pages as needed.
594
+ # result.each do |item|
595
+ # # Each element is of type ::Google::Apps::Events::Subscriptions::V1beta::Subscription.
596
+ # p item
597
+ # end
598
+ #
599
+ def list_subscriptions request, options = nil
600
+ raise ::ArgumentError, "request must be provided" if request.nil?
601
+
602
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::ListSubscriptionsRequest
603
+
604
+ # Converts hash and nil to an options object
605
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
606
+
607
+ # Customize the options with defaults
608
+ metadata = @config.rpcs.list_subscriptions.metadata.to_h
609
+
610
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
611
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
612
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
613
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
614
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
615
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
616
+
617
+ options.apply_defaults timeout: @config.rpcs.list_subscriptions.timeout,
618
+ metadata: metadata,
619
+ retry_policy: @config.rpcs.list_subscriptions.retry_policy
620
+
621
+ options.apply_defaults timeout: @config.timeout,
622
+ metadata: @config.metadata,
623
+ retry_policy: @config.retry_policy
624
+
625
+ @subscriptions_service_stub.call_rpc :list_subscriptions, request, options: options do |response, operation|
626
+ response = ::Gapic::PagedEnumerable.new @subscriptions_service_stub, :list_subscriptions, request, response, operation, options
627
+ yield response, operation if block_given?
628
+ throw :response, response
629
+ end
630
+ rescue ::GRPC::BadStatus => e
631
+ raise ::Google::Cloud::Error.from_error(e)
632
+ end
633
+
634
+ ##
635
+ # Updates or renews a Google Workspace subscription. To learn how to use this
636
+ # method, see [Update or renew a Google Workspace
637
+ # subscription](https://developers.google.com/workspace/events/guides/update-subscription).
638
+ #
639
+ # @overload update_subscription(request, options = nil)
640
+ # Pass arguments to `update_subscription` via a request object, either of type
641
+ # {::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest} or an equivalent Hash.
642
+ #
643
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest, ::Hash]
644
+ # A request object representing the call parameters. Required. To specify no
645
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
646
+ # @param options [::Gapic::CallOptions, ::Hash]
647
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
648
+ #
649
+ # @overload update_subscription(subscription: nil, update_mask: nil, validate_only: nil)
650
+ # Pass arguments to `update_subscription` via keyword arguments. Note that at
651
+ # least one keyword argument is required. To specify no parameters, or to keep all
652
+ # the default parameter values, pass an empty Hash as a request object (see above).
653
+ #
654
+ # @param subscription [::Google::Apps::Events::Subscriptions::V1beta::Subscription, ::Hash]
655
+ # Required. The subscription to update.
656
+ #
657
+ # The subscription's `name` field is used to identify the subscription to
658
+ # update.
659
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
660
+ # Optional. The field to update. If omitted, updates any fields included in
661
+ # the request.
662
+ #
663
+ # You can update one of the following fields in a subscription:
664
+ #
665
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#expire_time `expire_time`}: The timestamp when the
666
+ # subscription expires.
667
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#ttl `ttl`}: The
668
+ # time-to-live (TTL) or duration of the
669
+ # subscription.
670
+ # * {::Google::Apps::Events::Subscriptions::V1beta::Subscription#event_types `event_types`}: The list of event types to
671
+ # receive about the target resource.
672
+ #
673
+ # To fully replace the subscription (the equivalent of `PUT`), use `*`. Any
674
+ # omitted fields are updated with empty values.
675
+ # @param validate_only [::Boolean]
676
+ # Optional. If set to `true`, validates and previews the request, but doesn't
677
+ # update the subscription.
678
+ #
679
+ # @yield [response, operation] Access the result along with the RPC operation
680
+ # @yieldparam response [::Gapic::Operation]
681
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
682
+ #
683
+ # @return [::Gapic::Operation]
684
+ #
685
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
686
+ #
687
+ # @example Basic example
688
+ # require "google/apps/events/subscriptions/v1beta"
689
+ #
690
+ # # Create a client object. The client can be reused for multiple calls.
691
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
692
+ #
693
+ # # Create a request. To set request fields, pass in keyword arguments.
694
+ # request = Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest.new
695
+ #
696
+ # # Call the update_subscription method.
697
+ # result = client.update_subscription request
698
+ #
699
+ # # The returned object is of type Gapic::Operation. You can use it to
700
+ # # check the status of an operation, cancel it, or wait for results.
701
+ # # Here is how to wait for a response.
702
+ # result.wait_until_done! timeout: 60
703
+ # if result.response?
704
+ # p result.response
705
+ # else
706
+ # puts "No response received."
707
+ # end
708
+ #
709
+ def update_subscription request, options = nil
710
+ raise ::ArgumentError, "request must be provided" if request.nil?
711
+
712
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::UpdateSubscriptionRequest
713
+
714
+ # Converts hash and nil to an options object
715
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
716
+
717
+ # Customize the options with defaults
718
+ metadata = @config.rpcs.update_subscription.metadata.to_h
719
+
720
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
721
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
722
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
723
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
724
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
725
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
726
+
727
+ header_params = {}
728
+ if request.subscription&.name
729
+ header_params["subscription.name"] = request.subscription.name
730
+ end
731
+
732
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
733
+ metadata[:"x-goog-request-params"] ||= request_params_header
734
+
735
+ options.apply_defaults timeout: @config.rpcs.update_subscription.timeout,
736
+ metadata: metadata,
737
+ retry_policy: @config.rpcs.update_subscription.retry_policy
738
+
739
+ options.apply_defaults timeout: @config.timeout,
740
+ metadata: @config.metadata,
741
+ retry_policy: @config.retry_policy
742
+
743
+ @subscriptions_service_stub.call_rpc :update_subscription, request, options: options do |response, operation|
744
+ response = ::Gapic::Operation.new response, @operations_client, options: options
745
+ yield response, operation if block_given?
746
+ throw :response, response
747
+ end
748
+ rescue ::GRPC::BadStatus => e
749
+ raise ::Google::Cloud::Error.from_error(e)
750
+ end
751
+
752
+ ##
753
+ # Reactivates a suspended Google Workspace subscription.
754
+ #
755
+ # This method resets your subscription's `State` field to `ACTIVE`. Before
756
+ # you use this method, you must fix the error that suspended the
757
+ # subscription. This method will ignore or reject any subscription that
758
+ # isn't currently in a suspended state. To learn how to use this method, see
759
+ # [Reactivate a Google Workspace
760
+ # subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
761
+ #
762
+ # @overload reactivate_subscription(request, options = nil)
763
+ # Pass arguments to `reactivate_subscription` via a request object, either of type
764
+ # {::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest} or an equivalent Hash.
765
+ #
766
+ # @param request [::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest, ::Hash]
767
+ # A request object representing the call parameters. Required. To specify no
768
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
769
+ # @param options [::Gapic::CallOptions, ::Hash]
770
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
771
+ #
772
+ # @overload reactivate_subscription(name: nil)
773
+ # Pass arguments to `reactivate_subscription` via keyword arguments. Note that at
774
+ # least one keyword argument is required. To specify no parameters, or to keep all
775
+ # the default parameter values, pass an empty Hash as a request object (see above).
776
+ #
777
+ # @param name [::String]
778
+ # Required. Resource name of the subscription.
779
+ #
780
+ # Format: `subscriptions/{subscription}`
781
+ #
782
+ # @yield [response, operation] Access the result along with the RPC operation
783
+ # @yieldparam response [::Gapic::Operation]
784
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
785
+ #
786
+ # @return [::Gapic::Operation]
787
+ #
788
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
789
+ #
790
+ # @example Basic example
791
+ # require "google/apps/events/subscriptions/v1beta"
792
+ #
793
+ # # Create a client object. The client can be reused for multiple calls.
794
+ # client = Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new
795
+ #
796
+ # # Create a request. To set request fields, pass in keyword arguments.
797
+ # request = Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest.new
798
+ #
799
+ # # Call the reactivate_subscription method.
800
+ # result = client.reactivate_subscription request
801
+ #
802
+ # # The returned object is of type Gapic::Operation. You can use it to
803
+ # # check the status of an operation, cancel it, or wait for results.
804
+ # # Here is how to wait for a response.
805
+ # result.wait_until_done! timeout: 60
806
+ # if result.response?
807
+ # p result.response
808
+ # else
809
+ # puts "No response received."
810
+ # end
811
+ #
812
+ def reactivate_subscription request, options = nil
813
+ raise ::ArgumentError, "request must be provided" if request.nil?
814
+
815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Events::Subscriptions::V1beta::ReactivateSubscriptionRequest
816
+
817
+ # Converts hash and nil to an options object
818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
819
+
820
+ # Customize the options with defaults
821
+ metadata = @config.rpcs.reactivate_subscription.metadata.to_h
822
+
823
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
824
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
826
+ gapic_version: ::Google::Apps::Events::Subscriptions::V1beta::VERSION
827
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
828
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
829
+
830
+ header_params = {}
831
+ if request.name
832
+ header_params["name"] = request.name
833
+ end
834
+
835
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
836
+ metadata[:"x-goog-request-params"] ||= request_params_header
837
+
838
+ options.apply_defaults timeout: @config.rpcs.reactivate_subscription.timeout,
839
+ metadata: metadata,
840
+ retry_policy: @config.rpcs.reactivate_subscription.retry_policy
841
+
842
+ options.apply_defaults timeout: @config.timeout,
843
+ metadata: @config.metadata,
844
+ retry_policy: @config.retry_policy
845
+
846
+ @subscriptions_service_stub.call_rpc :reactivate_subscription, request, options: options do |response, operation|
847
+ response = ::Gapic::Operation.new response, @operations_client, options: options
848
+ yield response, operation if block_given?
849
+ throw :response, response
850
+ end
851
+ rescue ::GRPC::BadStatus => e
852
+ raise ::Google::Cloud::Error.from_error(e)
853
+ end
854
+
855
+ ##
856
+ # Configuration class for the SubscriptionsService API.
857
+ #
858
+ # This class represents the configuration for SubscriptionsService,
859
+ # providing control over timeouts, retry behavior, logging, transport
860
+ # parameters, and other low-level controls. Certain parameters can also be
861
+ # applied individually to specific RPCs. See
862
+ # {::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client::Configuration::Rpcs}
863
+ # for a list of RPCs that can be configured independently.
864
+ #
865
+ # Configuration can be applied globally to all clients, or to a single client
866
+ # on construction.
867
+ #
868
+ # @example
869
+ #
870
+ # # Modify the global config, setting the timeout for
871
+ # # create_subscription to 20 seconds,
872
+ # # and all remaining timeouts to 10 seconds.
873
+ # ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.configure do |config|
874
+ # config.timeout = 10.0
875
+ # config.rpcs.create_subscription.timeout = 20.0
876
+ # end
877
+ #
878
+ # # Apply the above configuration only to a new client.
879
+ # client = ::Google::Apps::Events::Subscriptions::V1beta::SubscriptionsService::Client.new do |config|
880
+ # config.timeout = 10.0
881
+ # config.rpcs.create_subscription.timeout = 20.0
882
+ # end
883
+ #
884
+ # @!attribute [rw] endpoint
885
+ # A custom service endpoint, as a hostname or hostname:port. The default is
886
+ # nil, indicating to use the default endpoint in the current universe domain.
887
+ # @return [::String,nil]
888
+ # @!attribute [rw] credentials
889
+ # Credentials to send with calls. You may provide any of the following types:
890
+ # * (`String`) The path to a service account key file in JSON format
891
+ # * (`Hash`) A service account key as a Hash
892
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
893
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
894
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
895
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
896
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
897
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
898
+ # * (`nil`) indicating no credentials
899
+ #
900
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
901
+ # external source for authentication to Google Cloud, you must validate it before
902
+ # providing it to a Google API client library. Providing an unvalidated credential
903
+ # configuration to Google APIs can compromise the security of your systems and data.
904
+ # For more information, refer to [Validate credential configurations from external
905
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
906
+ # @return [::Object]
907
+ # @!attribute [rw] scope
908
+ # The OAuth scopes
909
+ # @return [::Array<::String>]
910
+ # @!attribute [rw] lib_name
911
+ # The library name as recorded in instrumentation and logging
912
+ # @return [::String]
913
+ # @!attribute [rw] lib_version
914
+ # The library version as recorded in instrumentation and logging
915
+ # @return [::String]
916
+ # @!attribute [rw] channel_args
917
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
918
+ # `GRPC::Core::Channel` object is provided as the credential.
919
+ # @return [::Hash]
920
+ # @!attribute [rw] interceptors
921
+ # An array of interceptors that are run before calls are executed.
922
+ # @return [::Array<::GRPC::ClientInterceptor>]
923
+ # @!attribute [rw] timeout
924
+ # The call timeout in seconds.
925
+ # @return [::Numeric]
926
+ # @!attribute [rw] metadata
927
+ # Additional gRPC headers to be sent with the call.
928
+ # @return [::Hash{::Symbol=>::String}]
929
+ # @!attribute [rw] retry_policy
930
+ # The retry policy. The value is a hash with the following keys:
931
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
932
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
933
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
934
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
935
+ # trigger a retry.
936
+ # @return [::Hash]
937
+ # @!attribute [rw] quota_project
938
+ # A separate project against which to charge quota.
939
+ # @return [::String]
940
+ # @!attribute [rw] universe_domain
941
+ # The universe domain within which to make requests. This determines the
942
+ # default endpoint URL. The default value of nil uses the environment
943
+ # universe (usually the default "googleapis.com" universe).
944
+ # @return [::String,nil]
945
+ # @!attribute [rw] logger
946
+ # A custom logger to use for request/response debug logging, or the value
947
+ # `:default` (the default) to construct a default logger, or `nil` to
948
+ # explicitly disable logging.
949
+ # @return [::Logger,:default,nil]
950
+ #
951
+ class Configuration
952
+ extend ::Gapic::Config
953
+
954
+ # @private
955
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
956
+ DEFAULT_ENDPOINT = "workspaceevents.googleapis.com"
957
+
958
+ config_attr :endpoint, nil, ::String, nil
959
+ config_attr :credentials, nil do |value|
960
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
961
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
962
+ allowed.any? { |klass| klass === value }
963
+ end
964
+ config_attr :scope, nil, ::String, ::Array, nil
965
+ config_attr :lib_name, nil, ::String, nil
966
+ config_attr :lib_version, nil, ::String, nil
967
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
968
+ config_attr :interceptors, nil, ::Array, nil
969
+ config_attr :timeout, nil, ::Numeric, nil
970
+ config_attr :metadata, nil, ::Hash, nil
971
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
972
+ config_attr :quota_project, nil, ::String, nil
973
+ config_attr :universe_domain, nil, ::String, nil
974
+ config_attr :logger, :default, ::Logger, nil, :default
975
+
976
+ # @private
977
+ def initialize parent_config = nil
978
+ @parent_config = parent_config unless parent_config.nil?
979
+
980
+ yield self if block_given?
981
+ end
982
+
983
+ ##
984
+ # Configurations for individual RPCs
985
+ # @return [Rpcs]
986
+ #
987
+ def rpcs
988
+ @rpcs ||= begin
989
+ parent_rpcs = nil
990
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
991
+ Rpcs.new parent_rpcs
992
+ end
993
+ end
994
+
995
+ ##
996
+ # Configuration for the channel pool
997
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
998
+ #
999
+ def channel_pool
1000
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1001
+ end
1002
+
1003
+ ##
1004
+ # Configuration RPC class for the SubscriptionsService API.
1005
+ #
1006
+ # Includes fields providing the configuration for each RPC in this service.
1007
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1008
+ # the following configuration fields:
1009
+ #
1010
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1011
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1012
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1013
+ # include the following keys:
1014
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1015
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1016
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1017
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1018
+ # trigger a retry.
1019
+ #
1020
+ class Rpcs
1021
+ ##
1022
+ # RPC-specific configuration for `create_subscription`
1023
+ # @return [::Gapic::Config::Method]
1024
+ #
1025
+ attr_reader :create_subscription
1026
+ ##
1027
+ # RPC-specific configuration for `delete_subscription`
1028
+ # @return [::Gapic::Config::Method]
1029
+ #
1030
+ attr_reader :delete_subscription
1031
+ ##
1032
+ # RPC-specific configuration for `get_subscription`
1033
+ # @return [::Gapic::Config::Method]
1034
+ #
1035
+ attr_reader :get_subscription
1036
+ ##
1037
+ # RPC-specific configuration for `list_subscriptions`
1038
+ # @return [::Gapic::Config::Method]
1039
+ #
1040
+ attr_reader :list_subscriptions
1041
+ ##
1042
+ # RPC-specific configuration for `update_subscription`
1043
+ # @return [::Gapic::Config::Method]
1044
+ #
1045
+ attr_reader :update_subscription
1046
+ ##
1047
+ # RPC-specific configuration for `reactivate_subscription`
1048
+ # @return [::Gapic::Config::Method]
1049
+ #
1050
+ attr_reader :reactivate_subscription
1051
+
1052
+ # @private
1053
+ def initialize parent_rpcs = nil
1054
+ create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription
1055
+ @create_subscription = ::Gapic::Config::Method.new create_subscription_config
1056
+ delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription
1057
+ @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config
1058
+ get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription
1059
+ @get_subscription = ::Gapic::Config::Method.new get_subscription_config
1060
+ list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions
1061
+ @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config
1062
+ update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription
1063
+ @update_subscription = ::Gapic::Config::Method.new update_subscription_config
1064
+ reactivate_subscription_config = parent_rpcs.reactivate_subscription if parent_rpcs.respond_to? :reactivate_subscription
1065
+ @reactivate_subscription = ::Gapic::Config::Method.new reactivate_subscription_config
1066
+
1067
+ yield self if block_given?
1068
+ end
1069
+ end
1070
+ end
1071
+ end
1072
+ end
1073
+ end
1074
+ end
1075
+ end
1076
+ end
1077
+ end