google-cloud-eventarc-publishing-v1 0.4.0 → 0.6.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: d9d6bd0508e60a6e8d295566ceef014f8fe2a25b08484eedb7a181f7b27bd279
4
- data.tar.gz: c7b3ebbb13044b136fdaca92befefc560be34b3dd30601d8d4b257260dea852d
3
+ metadata.gz: 839ca2a8a5763696148958cbc59dc0373c5bf121bc4388829c9310751825ba36
4
+ data.tar.gz: 061cd51100c3b1229ab56f41ce41132b8da7e1b174a28e7ce333c55899864b13
5
5
  SHA512:
6
- metadata.gz: 62179721c954abd92b513d8140251d07ed2ab9dad56fe65c420d944d5e84860d541a67a47660506785dfd0d6b7a25302672493b0afc67e8f1c3b7a6c0ca5470d
7
- data.tar.gz: 6db2934add4710ec8e86b90eeee241e10f1fdec18e353042ea495ba6b0ddd75b29fa20805f6a5cb327ca330f14436e8dce3958957c87e8e10fce7eda0442d937
6
+ metadata.gz: 1bdbb2f180720b42efddc9e6cdf040bd021457f25a4ac54e5fcba141c195cae2bdf4d26acc52f4f4e092331ed6a8b5bd368949edc4f4336064a66ce178737236
7
+ data.tar.gz: 4ac2c185b8d22c6047fca5b4cfb960093121f1f8fee7ac179a711a72f9ac0dafe96a1dc898a8808971ca939dc3fc20c42eeb3e0c80aaf4b7a19fc599dc61c15c
data/README.md CHANGED
@@ -46,8 +46,8 @@ 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,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
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
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/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.
53
53
 
@@ -147,7 +147,7 @@ module Google
147
147
  credentials = @config.credentials
148
148
  # Use self-signed JWT if the endpoint is unchanged from default,
149
149
  # but only if the default endpoint does not have a region prefix.
150
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
150
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
151
  !@config.endpoint.split(".").first.include?("-")
152
152
  credentials ||= Credentials.default scope: @config.scope,
153
153
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -396,9 +396,9 @@ module Google
396
396
  # * (`String`) The path to a service account key file in JSON format
397
397
  # * (`Hash`) A service account key as a Hash
398
398
  # * (`Google::Auth::Credentials`) A googleauth credentials object
399
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
399
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
400
400
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
401
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
401
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
402
402
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
403
403
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
404
404
  # * (`nil`) indicating no credentials
@@ -440,7 +440,9 @@ module Google
440
440
  class Configuration
441
441
  extend ::Gapic::Config
442
442
 
443
- config_attr :endpoint, "eventarcpublishing.googleapis.com", ::String
443
+ DEFAULT_ENDPOINT = "eventarcpublishing.googleapis.com"
444
+
445
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
444
446
  config_attr :credentials, nil do |value|
445
447
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
446
448
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -0,0 +1,460 @@
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 == Configuration::DEFAULT_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://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
345
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
346
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
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
+ DEFAULT_ENDPOINT = "eventarcpublishing.googleapis.com"
380
+
381
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
382
+ config_attr :credentials, nil do |value|
383
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
384
+ allowed.any? { |klass| klass === value }
385
+ end
386
+ config_attr :scope, nil, ::String, ::Array, nil
387
+ config_attr :lib_name, nil, ::String, nil
388
+ config_attr :lib_version, nil, ::String, nil
389
+ config_attr :timeout, nil, ::Numeric, nil
390
+ config_attr :metadata, nil, ::Hash, nil
391
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
392
+ config_attr :quota_project, nil, ::String, nil
393
+
394
+ # @private
395
+ def initialize parent_config = nil
396
+ @parent_config = parent_config unless parent_config.nil?
397
+
398
+ yield self if block_given?
399
+ end
400
+
401
+ ##
402
+ # Configurations for individual RPCs
403
+ # @return [Rpcs]
404
+ #
405
+ def rpcs
406
+ @rpcs ||= begin
407
+ parent_rpcs = nil
408
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
409
+ Rpcs.new parent_rpcs
410
+ end
411
+ end
412
+
413
+ ##
414
+ # Configuration RPC class for the Publisher API.
415
+ #
416
+ # Includes fields providing the configuration for each RPC in this service.
417
+ # Each configuration object is of type `Gapic::Config::Method` and includes
418
+ # the following configuration fields:
419
+ #
420
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
421
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
422
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
423
+ # include the following keys:
424
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
425
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
426
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
427
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
428
+ # trigger a retry.
429
+ #
430
+ class Rpcs
431
+ ##
432
+ # RPC-specific configuration for `publish_channel_connection_events`
433
+ # @return [::Gapic::Config::Method]
434
+ #
435
+ attr_reader :publish_channel_connection_events
436
+ ##
437
+ # RPC-specific configuration for `publish_events`
438
+ # @return [::Gapic::Config::Method]
439
+ #
440
+ attr_reader :publish_events
441
+
442
+ # @private
443
+ def initialize parent_rpcs = nil
444
+ publish_channel_connection_events_config = parent_rpcs.publish_channel_connection_events if parent_rpcs.respond_to? :publish_channel_connection_events
445
+ @publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
446
+ publish_events_config = parent_rpcs.publish_events if parent_rpcs.respond_to? :publish_events
447
+ @publish_events = ::Gapic::Config::Method.new publish_events_config
448
+
449
+ yield self if block_given?
450
+ end
451
+ end
452
+ end
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
460
+ end