google-cloud-eventarc-publishing-v1 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/eventarc/publishing/v1/publisher/client.rb +95 -0
- data/lib/google/cloud/eventarc/publishing/v1/publisher_pb.rb +9 -1
- data/lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb +2 -0
- data/lib/google/cloud/eventarc/publishing/v1/version.rb +1 -1
- data/lib/google/cloud/eventarc/publishing/v1.rb +2 -0
- data/proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 126c8e55957c1b5cfa6e28b95c7566b63b448b9a5518fcbc57d75bd72b09c348
|
4
|
+
data.tar.gz: e8b14193445703a6709582f3f22d6153973dfbe8637f2d55738b7acae3821464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9519a8cd56e94ad04e66ce9f0b22c6d0471611c54893ba3b6a18373e90cf3935b20387631c29a2833252fc0e76cc5618160b1344d5cbcee9576d9e33b3c6b3e7
|
7
|
+
data.tar.gz: d6e92b1fba7fdd68b9d261d8bf045faffcc4e029c14e415ceb92ce8dbee88f731d6ba79cdaf8a3512c603713ff51bf6b38c0f170d042af6a57935cc5dda093eb
|
@@ -256,6 +256,94 @@ module Google
|
|
256
256
|
raise ::Google::Cloud::Error.from_error(e)
|
257
257
|
end
|
258
258
|
|
259
|
+
##
|
260
|
+
# Publish events to a subscriber's channel.
|
261
|
+
#
|
262
|
+
# @overload publish_events(request, options = nil)
|
263
|
+
# Pass arguments to `publish_events` via a request object, either of type
|
264
|
+
# {::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest} or an equivalent Hash.
|
265
|
+
#
|
266
|
+
# @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest, ::Hash]
|
267
|
+
# A request object representing the call parameters. Required. To specify no
|
268
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
269
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
270
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
271
|
+
#
|
272
|
+
# @overload publish_events(channel: nil, events: nil)
|
273
|
+
# Pass arguments to `publish_events` via keyword arguments. Note that at
|
274
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
275
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
276
|
+
#
|
277
|
+
# @param channel [::String]
|
278
|
+
# The full name of the channel to publish to. For example:
|
279
|
+
# `projects/{project}/locations/{location}/channels/{channel-id}`.
|
280
|
+
# @param events [::Array<::Google::Protobuf::Any, ::Hash>]
|
281
|
+
# The CloudEvents v1.0 events to publish. No other types are allowed.
|
282
|
+
#
|
283
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
284
|
+
# @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
|
285
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
286
|
+
#
|
287
|
+
# @return [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
|
288
|
+
#
|
289
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
290
|
+
#
|
291
|
+
# @example Basic example
|
292
|
+
# require "google/cloud/eventarc/publishing/v1"
|
293
|
+
#
|
294
|
+
# # Create a client object. The client can be reused for multiple calls.
|
295
|
+
# client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
|
296
|
+
#
|
297
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
298
|
+
# request = Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new
|
299
|
+
#
|
300
|
+
# # Call the publish_events method.
|
301
|
+
# result = client.publish_events request
|
302
|
+
#
|
303
|
+
# # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse.
|
304
|
+
# p result
|
305
|
+
#
|
306
|
+
def publish_events request, options = nil
|
307
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
308
|
+
|
309
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest
|
310
|
+
|
311
|
+
# Converts hash and nil to an options object
|
312
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
313
|
+
|
314
|
+
# Customize the options with defaults
|
315
|
+
metadata = @config.rpcs.publish_events.metadata.to_h
|
316
|
+
|
317
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
318
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
319
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
320
|
+
gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION
|
321
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
322
|
+
|
323
|
+
header_params = {}
|
324
|
+
if request.channel
|
325
|
+
header_params["channel"] = request.channel
|
326
|
+
end
|
327
|
+
|
328
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
329
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.rpcs.publish_events.timeout,
|
332
|
+
metadata: metadata,
|
333
|
+
retry_policy: @config.rpcs.publish_events.retry_policy
|
334
|
+
|
335
|
+
options.apply_defaults timeout: @config.timeout,
|
336
|
+
metadata: @config.metadata,
|
337
|
+
retry_policy: @config.retry_policy
|
338
|
+
|
339
|
+
@publisher_stub.call_rpc :publish_events, request, options: options do |response, operation|
|
340
|
+
yield response, operation if block_given?
|
341
|
+
return response
|
342
|
+
end
|
343
|
+
rescue ::GRPC::BadStatus => e
|
344
|
+
raise ::Google::Cloud::Error.from_error(e)
|
345
|
+
end
|
346
|
+
|
259
347
|
##
|
260
348
|
# Configuration class for the Publisher API.
|
261
349
|
#
|
@@ -396,11 +484,18 @@ module Google
|
|
396
484
|
# @return [::Gapic::Config::Method]
|
397
485
|
#
|
398
486
|
attr_reader :publish_channel_connection_events
|
487
|
+
##
|
488
|
+
# RPC-specific configuration for `publish_events`
|
489
|
+
# @return [::Gapic::Config::Method]
|
490
|
+
#
|
491
|
+
attr_reader :publish_events
|
399
492
|
|
400
493
|
# @private
|
401
494
|
def initialize parent_rpcs = nil
|
402
495
|
publish_channel_connection_events_config = parent_rpcs.publish_channel_connection_events if parent_rpcs.respond_to? :publish_channel_connection_events
|
403
496
|
@publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
|
497
|
+
publish_events_config = parent_rpcs.publish_events if parent_rpcs.respond_to? :publish_events
|
498
|
+
@publish_events = ::Gapic::Config::Method.new publish_events_config
|
404
499
|
|
405
500
|
yield self if block_given?
|
406
501
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# source: google/cloud/eventarc/publishing/v1/publisher.proto
|
3
3
|
|
4
4
|
require 'google/api/annotations_pb'
|
5
|
-
require 'google/protobuf/any_pb'
|
6
5
|
require 'google/api/client_pb'
|
6
|
+
require 'google/protobuf/any_pb'
|
7
7
|
require 'google/protobuf'
|
8
8
|
|
9
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
@@ -14,6 +14,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
14
14
|
end
|
15
15
|
add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse" do
|
16
16
|
end
|
17
|
+
add_message "google.cloud.eventarc.publishing.v1.PublishEventsRequest" do
|
18
|
+
optional :channel, :string, 1
|
19
|
+
repeated :events, :message, 2, "google.protobuf.Any"
|
20
|
+
end
|
21
|
+
add_message "google.cloud.eventarc.publishing.v1.PublishEventsResponse" do
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
@@ -24,6 +30,8 @@ module Google
|
|
24
30
|
module V1
|
25
31
|
PublishChannelConnectionEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest").msgclass
|
26
32
|
PublishChannelConnectionEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse").msgclass
|
33
|
+
PublishEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishEventsRequest").msgclass
|
34
|
+
PublishEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishEventsResponse").msgclass
|
27
35
|
end
|
28
36
|
end
|
29
37
|
end
|
@@ -59,6 +59,8 @@ module Google
|
|
59
59
|
|
60
60
|
# Publish events to a ChannelConnection in a partner's project.
|
61
61
|
rpc :PublishChannelConnectionEvents, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse
|
62
|
+
# Publish events to a subscriber's channel.
|
63
|
+
rpc :PublishEvents, ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse
|
62
64
|
end
|
63
65
|
|
64
66
|
Stub = Service.rpc_stub_class
|
@@ -40,6 +40,25 @@ module Google
|
|
40
40
|
include ::Google::Protobuf::MessageExts
|
41
41
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
42
42
|
end
|
43
|
+
|
44
|
+
# The request message for the PublishEvents method.
|
45
|
+
# @!attribute [rw] channel
|
46
|
+
# @return [::String]
|
47
|
+
# The full name of the channel to publish to. For example:
|
48
|
+
# `projects/{project}/locations/{location}/channels/{channel-id}`.
|
49
|
+
# @!attribute [rw] events
|
50
|
+
# @return [::Array<::Google::Protobuf::Any>]
|
51
|
+
# The CloudEvents v1.0 events to publish. No other types are allowed.
|
52
|
+
class PublishEventsRequest
|
53
|
+
include ::Google::Protobuf::MessageExts
|
54
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
55
|
+
end
|
56
|
+
|
57
|
+
# The response message for the PublishEvents method.
|
58
|
+
class PublishEventsResponse
|
59
|
+
include ::Google::Protobuf::MessageExts
|
60
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
61
|
+
end
|
43
62
|
end
|
44
63
|
end
|
45
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-eventarc-publishing-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|