google-cloud-eventarc-publishing-v1 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8040e1cfc517fb301e1116add2eacdd925df3a3d9f134a43361003daef599f0e
4
- data.tar.gz: 8d62a6097dca07cba434b72bad8a563dc058b8bb25462e10b4886ee350d694d1
3
+ metadata.gz: b1cdcb2e874e05cf09dd69f84e3604118e44b456b147fad16ef9526bb277502e
4
+ data.tar.gz: 14aea5174d436dc118e1b12a6c36287dee213510301a326d7fdce6b758bf675b
5
5
  SHA512:
6
- metadata.gz: 3a2214d326b6e055956f71466d48c8607a99f93bf8159897d1aec83bad2b61ecdb78824e334ac45c64aa85458bf6178e106c4fc48465752272afe2e84960c2d9
7
- data.tar.gz: 282728e0154972a55223efb4f6fb18c6ddae569e245c27b9e9090242c1fb84dba95f3801246003d052a134538f4b23bb2e54b44c7776c649e3c399af771dc0a8
6
+ metadata.gz: 0a7cccf450d2290badd9d068869945f4d5d033eefa5908d4315bc80a1af2afe450565ccc1896aa1f2e76538d62fe7d970bb94b41541fa859ee6ba61cce75046f
7
+ data.tar.gz: 8156b65ac5ef65f9da12a890606581cdbdc0571da3f7bf73e3bb3e05104edacc43969f31a270f3f36a9e9d87dfdc86973de9e25aa0f04bc55e2d09a2f16ffc47
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -181,7 +181,7 @@ module Google
181
181
  # @param options [::Gapic::CallOptions, ::Hash]
182
182
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
183
183
  #
184
- # @overload publish_channel_connection_events(channel_connection: nil, events: nil)
184
+ # @overload publish_channel_connection_events(channel_connection: nil, events: nil, text_events: nil)
185
185
  # Pass arguments to `publish_channel_connection_events` via keyword arguments. Note that at
186
186
  # least one keyword argument is required. To specify no parameters, or to keep all
187
187
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -191,6 +191,13 @@ module Google
191
191
  # `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
192
192
  # @param events [::Array<::Google::Protobuf::Any, ::Hash>]
193
193
  # The CloudEvents v1.0 events to publish. No other types are allowed.
194
+ # If this field is set, then the `text_events` fields must not be set.
195
+ # @param text_events [::Array<::String>]
196
+ # The text representation of events to publish.
197
+ # CloudEvent v1.0 in JSON format is the only allowed type. Refer to
198
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
199
+ # for specification.
200
+ # If this field is set, then the `events` fields must not be set.
194
201
  #
195
202
  # @yield [response, operation] Access the result along with the RPC operation
196
203
  # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
@@ -269,7 +276,7 @@ module Google
269
276
  # @param options [::Gapic::CallOptions, ::Hash]
270
277
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
271
278
  #
272
- # @overload publish_events(channel: nil, events: nil)
279
+ # @overload publish_events(channel: nil, events: nil, text_events: nil)
273
280
  # Pass arguments to `publish_events` via keyword arguments. Note that at
274
281
  # least one keyword argument is required. To specify no parameters, or to keep all
275
282
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -279,6 +286,13 @@ module Google
279
286
  # `projects/{project}/locations/{location}/channels/{channel-id}`.
280
287
  # @param events [::Array<::Google::Protobuf::Any, ::Hash>]
281
288
  # The CloudEvents v1.0 events to publish. No other types are allowed.
289
+ # If this field is set, then the `text_events` fields must not be set.
290
+ # @param text_events [::Array<::String>]
291
+ # The text representation of events to publish.
292
+ # CloudEvent v1.0 in JSON format is the only allowed type. Refer to
293
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
294
+ # for specification.
295
+ # If this field is set, then the `events` fields must not be set.
282
296
  #
283
297
  # @yield [response, operation] Access the result along with the RPC operation
284
298
  # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
@@ -0,0 +1,458 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/eventarc/publishing/v1/publisher_pb"
21
+ require "google/cloud/eventarc/publishing/v1/publisher/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Eventarc
26
+ module Publishing
27
+ module V1
28
+ module Publisher
29
+ module Rest
30
+ ##
31
+ # REST client for the Publisher service.
32
+ #
33
+ # Eventarc processes events generated by an event provider and delivers them to
34
+ # a subscriber.
35
+ #
36
+ # An event provider is a software-as-a-service (SaaS) system or
37
+ # product that can generate and deliver events through Eventarc.
38
+ #
39
+ # A third-party event provider is an event provider from outside of Google.
40
+ #
41
+ # A partner is a third-party event provider that is integrated with Eventarc.
42
+ #
43
+ # A subscriber is a GCP customer interested in receiving events.
44
+ #
45
+ # Channel is a first-class Eventarc resource that is created and managed
46
+ # by the subscriber in their GCP project. A Channel represents a subscriber's
47
+ # intent to receive events from an event provider. A Channel is associated with
48
+ # exactly one event provider.
49
+ #
50
+ # ChannelConnection is a first-class Eventarc resource that
51
+ # is created and managed by the partner in their GCP project. A
52
+ # ChannelConnection represents a connection between a partner and a
53
+ # subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
54
+ # Channel.
55
+ #
56
+ # Publisher allows an event provider to publish events to Eventarc.
57
+ #
58
+ class Client
59
+ # @private
60
+ attr_reader :publisher_stub
61
+
62
+ ##
63
+ # Configure the Publisher Client class.
64
+ #
65
+ # See {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client::Configuration}
66
+ # for a description of the configuration fields.
67
+ #
68
+ # @example
69
+ #
70
+ # # Modify the configuration for all Publisher clients
71
+ # ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.configure do |config|
72
+ # config.timeout = 10.0
73
+ # end
74
+ #
75
+ # @yield [config] Configure the Client client.
76
+ # @yieldparam config [Client::Configuration]
77
+ #
78
+ # @return [Client::Configuration]
79
+ #
80
+ def self.configure
81
+ @configure ||= begin
82
+ namespace = ["Google", "Cloud", "Eventarc", "Publishing", "V1"]
83
+ parent_config = while namespace.any?
84
+ parent_name = namespace.join "::"
85
+ parent_const = const_get parent_name
86
+ break parent_const.configure if parent_const.respond_to? :configure
87
+ namespace.pop
88
+ end
89
+ default_config = Client::Configuration.new parent_config
90
+
91
+ default_config.rpcs.publish_channel_connection_events.timeout = 60.0
92
+
93
+ default_config
94
+ end
95
+ yield @configure if block_given?
96
+ @configure
97
+ end
98
+
99
+ ##
100
+ # Configure the Publisher Client instance.
101
+ #
102
+ # The configuration is set to the derived mode, meaning that values can be changed,
103
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
104
+ # should be made on {Client.configure}.
105
+ #
106
+ # See {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client::Configuration}
107
+ # for a description of the configuration fields.
108
+ #
109
+ # @yield [config] Configure the Client client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ # @return [Client::Configuration]
113
+ #
114
+ def configure
115
+ yield @config if block_given?
116
+ @config
117
+ end
118
+
119
+ ##
120
+ # Create a new Publisher REST client object.
121
+ #
122
+ # @example
123
+ #
124
+ # # Create a client using the default configuration
125
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
126
+ #
127
+ # # Create a client using a custom configuration
128
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new do |config|
129
+ # config.timeout = 10.0
130
+ # end
131
+ #
132
+ # @yield [config] Configure the Publisher client.
133
+ # @yieldparam config [Client::Configuration]
134
+ #
135
+ def initialize
136
+ # Create the configuration object
137
+ @config = Configuration.new Client.configure
138
+
139
+ # Yield the configuration if needed
140
+ yield @config if block_given?
141
+
142
+ # Create credentials
143
+ credentials = @config.credentials
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
145
+ # but only if the default endpoint does not have a region prefix.
146
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
147
+ !@config.endpoint.split(".").first.include?("-")
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @publisher_stub = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
158
+ end
159
+
160
+ # Service calls
161
+
162
+ ##
163
+ # Publish events to a ChannelConnection in a partner's project.
164
+ #
165
+ # @overload publish_channel_connection_events(request, options = nil)
166
+ # Pass arguments to `publish_channel_connection_events` via a request object, either of type
167
+ # {::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest} or an equivalent Hash.
168
+ #
169
+ # @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, ::Hash]
170
+ # A request object representing the call parameters. Required. To specify no
171
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
172
+ # @param options [::Gapic::CallOptions, ::Hash]
173
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
174
+ #
175
+ # @overload publish_channel_connection_events(channel_connection: nil, events: nil, text_events: nil)
176
+ # Pass arguments to `publish_channel_connection_events` via keyword arguments. Note that at
177
+ # least one keyword argument is required. To specify no parameters, or to keep all
178
+ # the default parameter values, pass an empty Hash as a request object (see above).
179
+ #
180
+ # @param channel_connection [::String]
181
+ # The channel_connection that the events are published from. For example:
182
+ # `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
183
+ # @param events [::Array<::Google::Protobuf::Any, ::Hash>]
184
+ # The CloudEvents v1.0 events to publish. No other types are allowed.
185
+ # If this field is set, then the `text_events` fields must not be set.
186
+ # @param text_events [::Array<::String>]
187
+ # The text representation of events to publish.
188
+ # CloudEvent v1.0 in JSON format is the only allowed type. Refer to
189
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
190
+ # for specification.
191
+ # If this field is set, then the `events` fields must not be set.
192
+ # @yield [result, operation] Access the result along with the TransportOperation object
193
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
194
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
195
+ #
196
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
197
+ #
198
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
199
+ def publish_channel_connection_events request, options = nil
200
+ raise ::ArgumentError, "request must be provided" if request.nil?
201
+
202
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest
203
+
204
+ # Converts hash and nil to an options object
205
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
206
+
207
+ # Customize the options with defaults
208
+ call_metadata = @config.rpcs.publish_channel_connection_events.metadata.to_h
209
+
210
+ # Set x-goog-api-client and x-goog-user-project headers
211
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
212
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
213
+ gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION,
214
+ transports_version_send: [:rest]
215
+
216
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
217
+
218
+ options.apply_defaults timeout: @config.rpcs.publish_channel_connection_events.timeout,
219
+ metadata: call_metadata,
220
+ retry_policy: @config.rpcs.publish_channel_connection_events.retry_policy
221
+
222
+ options.apply_defaults timeout: @config.timeout,
223
+ metadata: @config.metadata,
224
+ retry_policy: @config.retry_policy
225
+
226
+ @publisher_stub.publish_channel_connection_events request, options do |result, operation|
227
+ yield result, operation if block_given?
228
+ return result
229
+ end
230
+ rescue ::Gapic::Rest::Error => e
231
+ raise ::Google::Cloud::Error.from_error(e)
232
+ end
233
+
234
+ ##
235
+ # Publish events to a subscriber's channel.
236
+ #
237
+ # @overload publish_events(request, options = nil)
238
+ # Pass arguments to `publish_events` via a request object, either of type
239
+ # {::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
246
+ #
247
+ # @overload publish_events(channel: nil, events: nil, text_events: nil)
248
+ # Pass arguments to `publish_events` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param channel [::String]
253
+ # The full name of the channel to publish to. For example:
254
+ # `projects/{project}/locations/{location}/channels/{channel-id}`.
255
+ # @param events [::Array<::Google::Protobuf::Any, ::Hash>]
256
+ # The CloudEvents v1.0 events to publish. No other types are allowed.
257
+ # If this field is set, then the `text_events` fields must not be set.
258
+ # @param text_events [::Array<::String>]
259
+ # The text representation of events to publish.
260
+ # CloudEvent v1.0 in JSON format is the only allowed type. Refer to
261
+ # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
262
+ # for specification.
263
+ # If this field is set, then the `events` fields must not be set.
264
+ # @yield [result, operation] Access the result along with the TransportOperation object
265
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
266
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
267
+ #
268
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
269
+ #
270
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
271
+ def publish_events request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.publish_events.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
289
+
290
+ options.apply_defaults timeout: @config.rpcs.publish_events.timeout,
291
+ metadata: call_metadata,
292
+ retry_policy: @config.rpcs.publish_events.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @publisher_stub.publish_events request, options do |result, operation|
299
+ yield result, operation if block_given?
300
+ return result
301
+ end
302
+ rescue ::Gapic::Rest::Error => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Configuration class for the Publisher REST API.
308
+ #
309
+ # This class represents the configuration for Publisher REST,
310
+ # providing control over timeouts, retry behavior, logging, transport
311
+ # parameters, and other low-level controls. Certain parameters can also be
312
+ # applied individually to specific RPCs. See
313
+ # {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client::Configuration::Rpcs}
314
+ # for a list of RPCs that can be configured independently.
315
+ #
316
+ # Configuration can be applied globally to all clients, or to a single client
317
+ # on construction.
318
+ #
319
+ # @example
320
+ #
321
+ # # Modify the global config, setting the timeout for
322
+ # # publish_channel_connection_events to 20 seconds,
323
+ # # and all remaining timeouts to 10 seconds.
324
+ # ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.configure do |config|
325
+ # config.timeout = 10.0
326
+ # config.rpcs.publish_channel_connection_events.timeout = 20.0
327
+ # end
328
+ #
329
+ # # Apply the above configuration only to a new client.
330
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new do |config|
331
+ # config.timeout = 10.0
332
+ # config.rpcs.publish_channel_connection_events.timeout = 20.0
333
+ # end
334
+ #
335
+ # @!attribute [rw] endpoint
336
+ # The hostname or hostname:port of the service endpoint.
337
+ # Defaults to `"eventarcpublishing.googleapis.com"`.
338
+ # @return [::String]
339
+ # @!attribute [rw] credentials
340
+ # Credentials to send with calls. You may provide any of the following types:
341
+ # * (`String`) The path to a service account key file in JSON format
342
+ # * (`Hash`) A service account key as a Hash
343
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
344
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
345
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
346
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
347
+ # * (`nil`) indicating no credentials
348
+ # @return [::Object]
349
+ # @!attribute [rw] scope
350
+ # The OAuth scopes
351
+ # @return [::Array<::String>]
352
+ # @!attribute [rw] lib_name
353
+ # The library name as recorded in instrumentation and logging
354
+ # @return [::String]
355
+ # @!attribute [rw] lib_version
356
+ # The library version as recorded in instrumentation and logging
357
+ # @return [::String]
358
+ # @!attribute [rw] timeout
359
+ # The call timeout in seconds.
360
+ # @return [::Numeric]
361
+ # @!attribute [rw] metadata
362
+ # Additional headers to be sent with the call.
363
+ # @return [::Hash{::Symbol=>::String}]
364
+ # @!attribute [rw] retry_policy
365
+ # The retry policy. The value is a hash with the following keys:
366
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
367
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
368
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
369
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
370
+ # trigger a retry.
371
+ # @return [::Hash]
372
+ # @!attribute [rw] quota_project
373
+ # A separate project against which to charge quota.
374
+ # @return [::String]
375
+ #
376
+ class Configuration
377
+ extend ::Gapic::Config
378
+
379
+ config_attr :endpoint, "eventarcpublishing.googleapis.com", ::String
380
+ config_attr :credentials, nil do |value|
381
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
382
+ allowed.any? { |klass| klass === value }
383
+ end
384
+ config_attr :scope, nil, ::String, ::Array, nil
385
+ config_attr :lib_name, nil, ::String, nil
386
+ config_attr :lib_version, nil, ::String, nil
387
+ config_attr :timeout, nil, ::Numeric, nil
388
+ config_attr :metadata, nil, ::Hash, nil
389
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
390
+ config_attr :quota_project, nil, ::String, nil
391
+
392
+ # @private
393
+ def initialize parent_config = nil
394
+ @parent_config = parent_config unless parent_config.nil?
395
+
396
+ yield self if block_given?
397
+ end
398
+
399
+ ##
400
+ # Configurations for individual RPCs
401
+ # @return [Rpcs]
402
+ #
403
+ def rpcs
404
+ @rpcs ||= begin
405
+ parent_rpcs = nil
406
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
407
+ Rpcs.new parent_rpcs
408
+ end
409
+ end
410
+
411
+ ##
412
+ # Configuration RPC class for the Publisher API.
413
+ #
414
+ # Includes fields providing the configuration for each RPC in this service.
415
+ # Each configuration object is of type `Gapic::Config::Method` and includes
416
+ # the following configuration fields:
417
+ #
418
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
419
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
420
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
421
+ # include the following keys:
422
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
423
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
424
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
425
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
426
+ # trigger a retry.
427
+ #
428
+ class Rpcs
429
+ ##
430
+ # RPC-specific configuration for `publish_channel_connection_events`
431
+ # @return [::Gapic::Config::Method]
432
+ #
433
+ attr_reader :publish_channel_connection_events
434
+ ##
435
+ # RPC-specific configuration for `publish_events`
436
+ # @return [::Gapic::Config::Method]
437
+ #
438
+ attr_reader :publish_events
439
+
440
+ # @private
441
+ def initialize parent_rpcs = nil
442
+ publish_channel_connection_events_config = parent_rpcs.publish_channel_connection_events if parent_rpcs.respond_to? :publish_channel_connection_events
443
+ @publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
444
+ publish_events_config = parent_rpcs.publish_events if parent_rpcs.respond_to? :publish_events
445
+ @publish_events = ::Gapic::Config::Method.new publish_events_config
446
+
447
+ yield self if block_given?
448
+ end
449
+ end
450
+ end
451
+ end
452
+ end
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end