google-cloud-eventarc-publishing-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,415 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+
22
+ module Google
23
+ module Cloud
24
+ module Eventarc
25
+ module Publishing
26
+ module V1
27
+ module Publisher
28
+ ##
29
+ # Client for the Publisher service.
30
+ #
31
+ # Eventarc processes events generated by an event provider and delivers them to
32
+ # a subscriber.
33
+ #
34
+ # An event provider is a software-as-a-service (SaaS) system or
35
+ # product that can generate and deliver events through Eventarc.
36
+ #
37
+ # A third-party event provider is an event provider from outside of Google.
38
+ #
39
+ # A partner is a third-party event provider that is integrated with Eventarc.
40
+ #
41
+ # A subscriber is a GCP customer interested in receiving events.
42
+ #
43
+ # Channel is a first-class Eventarc resource that is created and managed
44
+ # by the subscriber in their GCP project. A Channel represents a subscriber's
45
+ # intent to receive events from an event provider. A Channel is associated with
46
+ # exactly one event provider.
47
+ #
48
+ # ChannelConnection is a first-class Eventarc resource that
49
+ # is created and managed by the partner in their GCP project. A
50
+ # ChannelConnection represents a connection between a partner and a
51
+ # subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
52
+ # Channel.
53
+ #
54
+ # Publisher allows an event provider to publish events to Eventarc.
55
+ #
56
+ class Client
57
+ # @private
58
+ attr_reader :publisher_stub
59
+
60
+ ##
61
+ # Configure the Publisher Client class.
62
+ #
63
+ # See {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client::Configuration}
64
+ # for a description of the configuration fields.
65
+ #
66
+ # @example
67
+ #
68
+ # # Modify the configuration for all Publisher clients
69
+ # ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.configure do |config|
70
+ # config.timeout = 10.0
71
+ # end
72
+ #
73
+ # @yield [config] Configure the Client client.
74
+ # @yieldparam config [Client::Configuration]
75
+ #
76
+ # @return [Client::Configuration]
77
+ #
78
+ def self.configure
79
+ @configure ||= begin
80
+ namespace = ["Google", "Cloud", "Eventarc", "Publishing", "V1"]
81
+ parent_config = while namespace.any?
82
+ parent_name = namespace.join "::"
83
+ parent_const = const_get parent_name
84
+ break parent_const.configure if parent_const.respond_to? :configure
85
+ namespace.pop
86
+ end
87
+ default_config = Client::Configuration.new parent_config
88
+
89
+ default_config.rpcs.publish_channel_connection_events.timeout = 60.0
90
+
91
+ default_config
92
+ end
93
+ yield @configure if block_given?
94
+ @configure
95
+ end
96
+
97
+ ##
98
+ # Configure the Publisher Client instance.
99
+ #
100
+ # The configuration is set to the derived mode, meaning that values can be changed,
101
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
102
+ # should be made on {Client.configure}.
103
+ #
104
+ # See {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client::Configuration}
105
+ # for a description of the configuration fields.
106
+ #
107
+ # @yield [config] Configure the Client client.
108
+ # @yieldparam config [Client::Configuration]
109
+ #
110
+ # @return [Client::Configuration]
111
+ #
112
+ def configure
113
+ yield @config if block_given?
114
+ @config
115
+ end
116
+
117
+ ##
118
+ # Create a new Publisher client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the Publisher client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # These require statements are intentionally placed here to initialize
135
+ # the gRPC module only when it's required.
136
+ # See https://github.com/googleapis/toolkit/issues/446
137
+ require "gapic/grpc"
138
+ require "google/cloud/eventarc/publishing/v1/publisher_services_pb"
139
+
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
151
+ !@config.endpoint.split(".").first.include?("-")
152
+ credentials ||= Credentials.default scope: @config.scope,
153
+ enable_self_signed_jwt: enable_self_signed_jwt
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
155
+ credentials = Credentials.new credentials, scope: @config.scope
156
+ end
157
+ @quota_project_id = @config.quota_project
158
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
159
+
160
+ @publisher_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ channel_args: @config.channel_args,
165
+ interceptors: @config.interceptors
166
+ )
167
+ end
168
+
169
+ # Service calls
170
+
171
+ ##
172
+ # Publish events to a ChannelConnection in a partner's project.
173
+ #
174
+ # @overload publish_channel_connection_events(request, options = nil)
175
+ # Pass arguments to `publish_channel_connection_events` via a request object, either of type
176
+ # {::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest} or an equivalent Hash.
177
+ #
178
+ # @param request [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, ::Hash]
179
+ # A request object representing the call parameters. Required. To specify no
180
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
181
+ # @param options [::Gapic::CallOptions, ::Hash]
182
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
183
+ #
184
+ # @overload publish_channel_connection_events(channel_connection: nil, events: nil)
185
+ # Pass arguments to `publish_channel_connection_events` via keyword arguments. Note that at
186
+ # least one keyword argument is required. To specify no parameters, or to keep all
187
+ # the default parameter values, pass an empty Hash as a request object (see above).
188
+ #
189
+ # @param channel_connection [::String]
190
+ # The channel_connection that the events are published from. For example:
191
+ # `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
192
+ # @param events [::Array<::Google::Protobuf::Any, ::Hash>]
193
+ # The CloudEvents v1.0 events to publish. No other types are allowed.
194
+ #
195
+ # @yield [response, operation] Access the result along with the RPC operation
196
+ # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
197
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
198
+ #
199
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
200
+ #
201
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
202
+ #
203
+ # @example Basic example
204
+ # require "google/cloud/eventarc/publishing/v1"
205
+ #
206
+ # # Create a client object. The client can be reused for multiple calls.
207
+ # client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
208
+ #
209
+ # # Create a request. To set request fields, pass in keyword arguments.
210
+ # request = Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new
211
+ #
212
+ # # Call the publish_channel_connection_events method.
213
+ # result = client.publish_channel_connection_events request
214
+ #
215
+ # # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse.
216
+ # p result
217
+ #
218
+ def publish_channel_connection_events request, options = nil
219
+ raise ::ArgumentError, "request must be provided" if request.nil?
220
+
221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest
222
+
223
+ # Converts hash and nil to an options object
224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
225
+
226
+ # Customize the options with defaults
227
+ metadata = @config.rpcs.publish_channel_connection_events.metadata.to_h
228
+
229
+ # Set x-goog-api-client and x-goog-user-project headers
230
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
232
+ gapic_version: ::Google::Cloud::Eventarc::Publishing::V1::VERSION
233
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
+
235
+ header_params = {}
236
+ if request.channel_connection
237
+ header_params["channel_connection"] = request.channel_connection
238
+ end
239
+
240
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
241
+ metadata[:"x-goog-request-params"] ||= request_params_header
242
+
243
+ options.apply_defaults timeout: @config.rpcs.publish_channel_connection_events.timeout,
244
+ metadata: metadata,
245
+ retry_policy: @config.rpcs.publish_channel_connection_events.retry_policy
246
+
247
+ options.apply_defaults timeout: @config.timeout,
248
+ metadata: @config.metadata,
249
+ retry_policy: @config.retry_policy
250
+
251
+ @publisher_stub.call_rpc :publish_channel_connection_events, request, options: options do |response, operation|
252
+ yield response, operation if block_given?
253
+ return response
254
+ end
255
+ rescue ::GRPC::BadStatus => e
256
+ raise ::Google::Cloud::Error.from_error(e)
257
+ end
258
+
259
+ ##
260
+ # Configuration class for the Publisher API.
261
+ #
262
+ # This class represents the configuration for Publisher,
263
+ # providing control over timeouts, retry behavior, logging, transport
264
+ # parameters, and other low-level controls. Certain parameters can also be
265
+ # applied individually to specific RPCs. See
266
+ # {::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client::Configuration::Rpcs}
267
+ # for a list of RPCs that can be configured independently.
268
+ #
269
+ # Configuration can be applied globally to all clients, or to a single client
270
+ # on construction.
271
+ #
272
+ # @example
273
+ #
274
+ # # Modify the global config, setting the timeout for
275
+ # # publish_channel_connection_events to 20 seconds,
276
+ # # and all remaining timeouts to 10 seconds.
277
+ # ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.configure do |config|
278
+ # config.timeout = 10.0
279
+ # config.rpcs.publish_channel_connection_events.timeout = 20.0
280
+ # end
281
+ #
282
+ # # Apply the above configuration only to a new client.
283
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new do |config|
284
+ # config.timeout = 10.0
285
+ # config.rpcs.publish_channel_connection_events.timeout = 20.0
286
+ # end
287
+ #
288
+ # @!attribute [rw] endpoint
289
+ # The hostname or hostname:port of the service endpoint.
290
+ # Defaults to `"eventarcpublishing.googleapis.com"`.
291
+ # @return [::String]
292
+ # @!attribute [rw] credentials
293
+ # Credentials to send with calls. You may provide any of the following types:
294
+ # * (`String`) The path to a service account key file in JSON format
295
+ # * (`Hash`) A service account key as a Hash
296
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
297
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
298
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
299
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
300
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
301
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
302
+ # * (`nil`) indicating no credentials
303
+ # @return [::Object]
304
+ # @!attribute [rw] scope
305
+ # The OAuth scopes
306
+ # @return [::Array<::String>]
307
+ # @!attribute [rw] lib_name
308
+ # The library name as recorded in instrumentation and logging
309
+ # @return [::String]
310
+ # @!attribute [rw] lib_version
311
+ # The library version as recorded in instrumentation and logging
312
+ # @return [::String]
313
+ # @!attribute [rw] channel_args
314
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
315
+ # `GRPC::Core::Channel` object is provided as the credential.
316
+ # @return [::Hash]
317
+ # @!attribute [rw] interceptors
318
+ # An array of interceptors that are run before calls are executed.
319
+ # @return [::Array<::GRPC::ClientInterceptor>]
320
+ # @!attribute [rw] timeout
321
+ # The call timeout in seconds.
322
+ # @return [::Numeric]
323
+ # @!attribute [rw] metadata
324
+ # Additional gRPC headers to be sent with the call.
325
+ # @return [::Hash{::Symbol=>::String}]
326
+ # @!attribute [rw] retry_policy
327
+ # The retry policy. The value is a hash with the following keys:
328
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
329
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
330
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
331
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
332
+ # trigger a retry.
333
+ # @return [::Hash]
334
+ # @!attribute [rw] quota_project
335
+ # A separate project against which to charge quota.
336
+ # @return [::String]
337
+ #
338
+ class Configuration
339
+ extend ::Gapic::Config
340
+
341
+ config_attr :endpoint, "eventarcpublishing.googleapis.com", ::String
342
+ config_attr :credentials, nil do |value|
343
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
344
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
345
+ allowed.any? { |klass| klass === value }
346
+ end
347
+ config_attr :scope, nil, ::String, ::Array, nil
348
+ config_attr :lib_name, nil, ::String, nil
349
+ config_attr :lib_version, nil, ::String, nil
350
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
351
+ config_attr :interceptors, nil, ::Array, nil
352
+ config_attr :timeout, nil, ::Numeric, nil
353
+ config_attr :metadata, nil, ::Hash, nil
354
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
355
+ config_attr :quota_project, nil, ::String, nil
356
+
357
+ # @private
358
+ def initialize parent_config = nil
359
+ @parent_config = parent_config unless parent_config.nil?
360
+
361
+ yield self if block_given?
362
+ end
363
+
364
+ ##
365
+ # Configurations for individual RPCs
366
+ # @return [Rpcs]
367
+ #
368
+ def rpcs
369
+ @rpcs ||= begin
370
+ parent_rpcs = nil
371
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
372
+ Rpcs.new parent_rpcs
373
+ end
374
+ end
375
+
376
+ ##
377
+ # Configuration RPC class for the Publisher API.
378
+ #
379
+ # Includes fields providing the configuration for each RPC in this service.
380
+ # Each configuration object is of type `Gapic::Config::Method` and includes
381
+ # the following configuration fields:
382
+ #
383
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
384
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
385
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
386
+ # include the following keys:
387
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
388
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
389
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
390
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
391
+ # trigger a retry.
392
+ #
393
+ class Rpcs
394
+ ##
395
+ # RPC-specific configuration for `publish_channel_connection_events`
396
+ # @return [::Gapic::Config::Method]
397
+ #
398
+ attr_reader :publish_channel_connection_events
399
+
400
+ # @private
401
+ def initialize parent_rpcs = nil
402
+ publish_channel_connection_events_config = parent_rpcs.publish_channel_connection_events if parent_rpcs.respond_to? :publish_channel_connection_events
403
+ @publish_channel_connection_events = ::Gapic::Config::Method.new publish_channel_connection_events_config
404
+
405
+ yield self if block_given?
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
414
+ end
415
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Eventarc
24
+ module Publishing
25
+ module V1
26
+ module Publisher
27
+ # Credentials for the Publisher API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "EVENTARC_CREDENTIALS",
34
+ "EVENTARC_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "EVENTARC_CREDENTIALS_JSON",
39
+ "EVENTARC_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/eventarc/publishing/v1/version"
24
+
25
+ require "google/cloud/eventarc/publishing/v1/publisher/credentials"
26
+ require "google/cloud/eventarc/publishing/v1/publisher/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Eventarc
31
+ module Publishing
32
+ module V1
33
+ ##
34
+ # Eventarc processes events generated by an event provider and delivers them to
35
+ # a subscriber.
36
+ #
37
+ # An event provider is a software-as-a-service (SaaS) system or
38
+ # product that can generate and deliver events through Eventarc.
39
+ #
40
+ # A third-party event provider is an event provider from outside of Google.
41
+ #
42
+ # A partner is a third-party event provider that is integrated with Eventarc.
43
+ #
44
+ # A subscriber is a GCP customer interested in receiving events.
45
+ #
46
+ # Channel is a first-class Eventarc resource that is created and managed
47
+ # by the subscriber in their GCP project. A Channel represents a subscriber's
48
+ # intent to receive events from an event provider. A Channel is associated with
49
+ # exactly one event provider.
50
+ #
51
+ # ChannelConnection is a first-class Eventarc resource that
52
+ # is created and managed by the partner in their GCP project. A
53
+ # ChannelConnection represents a connection between a partner and a
54
+ # subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
55
+ # Channel.
56
+ #
57
+ # Publisher allows an event provider to publish events to Eventarc.
58
+ #
59
+ # To load this service and instantiate a client:
60
+ #
61
+ # require "google/cloud/eventarc/publishing/v1/publisher"
62
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
63
+ #
64
+ module Publisher
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+
72
+ helper_path = ::File.join __dir__, "publisher", "helpers.rb"
73
+ require "google/cloud/eventarc/publishing/v1/publisher/helpers" if ::File.file? helper_path
@@ -0,0 +1,31 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/eventarc/publishing/v1/publisher.proto
3
+
4
+ require 'google/api/annotations_pb'
5
+ require 'google/protobuf/any_pb'
6
+ require 'google/api/client_pb'
7
+ require 'google/protobuf'
8
+
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_file("google/cloud/eventarc/publishing/v1/publisher.proto", :syntax => :proto3) do
11
+ add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest" do
12
+ optional :channel_connection, :string, 1
13
+ repeated :events, :message, 2, "google.protobuf.Any"
14
+ end
15
+ add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse" do
16
+ end
17
+ end
18
+ end
19
+
20
+ module Google
21
+ module Cloud
22
+ module Eventarc
23
+ module Publishing
24
+ module V1
25
+ PublishChannelConnectionEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest").msgclass
26
+ PublishChannelConnectionEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse").msgclass
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,70 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/eventarc/publishing/v1/publisher.proto for package 'Google.Cloud.Eventarc.Publishing.V1'
3
+ # Original file comments:
4
+ # Copyright 2021 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/eventarc/publishing/v1/publisher_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Eventarc
25
+ module Publishing
26
+ module V1
27
+ module Publisher
28
+ # Eventarc processes events generated by an event provider and delivers them to
29
+ # a subscriber.
30
+ #
31
+ # An event provider is a software-as-a-service (SaaS) system or
32
+ # product that can generate and deliver events through Eventarc.
33
+ #
34
+ # A third-party event provider is an event provider from outside of Google.
35
+ #
36
+ # A partner is a third-party event provider that is integrated with Eventarc.
37
+ #
38
+ # A subscriber is a GCP customer interested in receiving events.
39
+ #
40
+ # Channel is a first-class Eventarc resource that is created and managed
41
+ # by the subscriber in their GCP project. A Channel represents a subscriber's
42
+ # intent to receive events from an event provider. A Channel is associated with
43
+ # exactly one event provider.
44
+ #
45
+ # ChannelConnection is a first-class Eventarc resource that
46
+ # is created and managed by the partner in their GCP project. A
47
+ # ChannelConnection represents a connection between a partner and a
48
+ # subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
49
+ # Channel.
50
+ #
51
+ # Publisher allows an event provider to publish events to Eventarc.
52
+ class Service
53
+
54
+ include ::GRPC::GenericService
55
+
56
+ self.marshal_class_method = :encode
57
+ self.unmarshal_class_method = :decode
58
+ self.service_name = 'google.cloud.eventarc.publishing.v1.Publisher'
59
+
60
+ # Publish events to a ChannelConnection in a partner's project.
61
+ rpc :PublishChannelConnectionEvents, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse
62
+ end
63
+
64
+ Stub = Service.rpc_stub_class
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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
+
20
+ module Google
21
+ module Cloud
22
+ module Eventarc
23
+ module Publishing
24
+ module V1
25
+ VERSION = "0.1.0"
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end