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.
@@ -0,0 +1,170 @@
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/eventarc/publishing/v1/publisher_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Eventarc
24
+ module Publishing
25
+ module V1
26
+ module Publisher
27
+ module Rest
28
+ ##
29
+ # REST service stub for the Publisher service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, credentials:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ numeric_enums: true,
41
+ raise_faraday_errors: false
42
+ end
43
+
44
+ ##
45
+ # Baseline implementation for the publish_channel_connection_events REST call
46
+ #
47
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest]
48
+ # A request object representing the call parameters. Required.
49
+ # @param options [::Gapic::CallOptions]
50
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
51
+ #
52
+ # @yield [result, operation] Access the result along with the TransportOperation object
53
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
54
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
55
+ #
56
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse]
57
+ # A result object deserialized from the server's reply
58
+ def publish_channel_connection_events request_pb, options = nil
59
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
60
+
61
+ verb, uri, query_string_params, body = ServiceStub.transcode_publish_channel_connection_events_request request_pb
62
+ query_string_params = if query_string_params.any?
63
+ query_string_params.to_h { |p| p.split("=", 2) }
64
+ else
65
+ {}
66
+ end
67
+
68
+ response = @client_stub.make_http_request(
69
+ verb,
70
+ uri: uri,
71
+ body: body || "",
72
+ params: query_string_params,
73
+ options: options
74
+ )
75
+ operation = ::Gapic::Rest::TransportOperation.new response
76
+ result = ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse.decode_json response.body, ignore_unknown_fields: true
77
+
78
+ yield result, operation if block_given?
79
+ result
80
+ end
81
+
82
+ ##
83
+ # Baseline implementation for the publish_events REST call
84
+ #
85
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest]
86
+ # A request object representing the call parameters. Required.
87
+ # @param options [::Gapic::CallOptions]
88
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
89
+ #
90
+ # @yield [result, operation] Access the result along with the TransportOperation object
91
+ # @yieldparam result [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
92
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
93
+ #
94
+ # @return [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse]
95
+ # A result object deserialized from the server's reply
96
+ def publish_events request_pb, options = nil
97
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
98
+
99
+ verb, uri, query_string_params, body = ServiceStub.transcode_publish_events_request request_pb
100
+ query_string_params = if query_string_params.any?
101
+ query_string_params.to_h { |p| p.split("=", 2) }
102
+ else
103
+ {}
104
+ end
105
+
106
+ response = @client_stub.make_http_request(
107
+ verb,
108
+ uri: uri,
109
+ body: body || "",
110
+ params: query_string_params,
111
+ options: options
112
+ )
113
+ operation = ::Gapic::Rest::TransportOperation.new response
114
+ result = ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse.decode_json response.body, ignore_unknown_fields: true
115
+
116
+ yield result, operation if block_given?
117
+ result
118
+ end
119
+
120
+ ##
121
+ # @private
122
+ #
123
+ # GRPC transcoding helper method for the publish_channel_connection_events REST call
124
+ #
125
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest]
126
+ # A request object representing the call parameters. Required.
127
+ # @return [Array(String, [String, nil], Hash{String => String})]
128
+ # Uri, Body, Query string parameters
129
+ def self.transcode_publish_channel_connection_events_request request_pb
130
+ transcoder = Gapic::Rest::GrpcTranscoder.new
131
+ .with_bindings(
132
+ uri_method: :post,
133
+ uri_template: "/v1/{channel_connection}:publishEvents",
134
+ body: "*",
135
+ matches: [
136
+ ["channel_connection", %r{^projects/[^/]+/locations/[^/]+/channelConnections/[^/]+/?$}, false]
137
+ ]
138
+ )
139
+ transcoder.transcode request_pb
140
+ end
141
+
142
+ ##
143
+ # @private
144
+ #
145
+ # GRPC transcoding helper method for the publish_events REST call
146
+ #
147
+ # @param request_pb [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest]
148
+ # A request object representing the call parameters. Required.
149
+ # @return [Array(String, [String, nil], Hash{String => String})]
150
+ # Uri, Body, Query string parameters
151
+ def self.transcode_publish_events_request request_pb
152
+ transcoder = Gapic::Rest::GrpcTranscoder.new
153
+ .with_bindings(
154
+ uri_method: :post,
155
+ uri_template: "/v1/{channel}:publishEvents",
156
+ body: "*",
157
+ matches: [
158
+ ["channel", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false]
159
+ ]
160
+ )
161
+ transcoder.transcode request_pb
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
169
+ end
170
+ end
@@ -0,0 +1,76 @@
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 "gapic/rest"
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/rest/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 REST client:
60
+ #
61
+ # require "google/cloud/eventarc/publishing/v1/publisher/rest"
62
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
63
+ #
64
+ module Publisher
65
+ # Client for the REST transport
66
+ module Rest
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+
75
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
76
+ require "google/cloud/eventarc/publishing/v1/publisher/rest/helpers" if ::File.file? helper_path
@@ -24,6 +24,7 @@ require "google/cloud/eventarc/publishing/v1/version"
24
24
 
25
25
  require "google/cloud/eventarc/publishing/v1/publisher/credentials"
26
26
  require "google/cloud/eventarc/publishing/v1/publisher/client"
27
+ require "google/cloud/eventarc/publishing/v1/publisher/rest"
27
28
 
28
29
  module Google
29
30
  module Cloud
@@ -56,11 +57,16 @@ module Google
56
57
  #
57
58
  # Publisher allows an event provider to publish events to Eventarc.
58
59
  #
59
- # To load this service and instantiate a client:
60
+ # @example Load this service and instantiate a gRPC client
60
61
  #
61
62
  # require "google/cloud/eventarc/publishing/v1/publisher"
62
63
  # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
63
64
  #
65
+ # @example Load this service and instantiate a REST client
66
+ #
67
+ # require "google/cloud/eventarc/publishing/v1/publisher/rest"
68
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
69
+ #
64
70
  module Publisher
65
71
  end
66
72
  end
@@ -12,12 +12,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest" do
13
13
  optional :channel_connection, :string, 1
14
14
  repeated :events, :message, 2, "google.protobuf.Any"
15
+ repeated :text_events, :string, 3
15
16
  end
16
17
  add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse" do
17
18
  end
18
19
  add_message "google.cloud.eventarc.publishing.v1.PublishEventsRequest" do
19
20
  optional :channel, :string, 1
20
21
  repeated :events, :message, 2, "google.protobuf.Any"
22
+ repeated :text_events, :string, 3
21
23
  end
22
24
  add_message "google.cloud.eventarc.publishing.v1.PublishEventsResponse" do
23
25
  end
@@ -14,7 +14,6 @@
14
14
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
- #
18
17
 
19
18
  require 'grpc'
20
19
  require 'google/cloud/eventarc/publishing/v1/publisher_pb'
@@ -0,0 +1,39 @@
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/eventarc/publishing/v1/publisher/rest"
20
+ require "google/cloud/eventarc/publishing/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Eventarc
25
+ module Publishing
26
+ ##
27
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
28
+ #
29
+ # @example
30
+ #
31
+ # require "google/cloud/eventarc/publishing/v1/rest"
32
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
33
+ #
34
+ module V1
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -22,7 +22,7 @@ module Google
22
22
  module Eventarc
23
23
  module Publishing
24
24
  module V1
25
- VERSION = "0.3.0"
25
+ VERSION = "0.5.0"
26
26
  end
27
27
  end
28
28
  end
@@ -24,13 +24,18 @@ module Google
24
24
  module Eventarc
25
25
  module Publishing
26
26
  ##
27
- # To load this package, including all its services, and instantiate a client:
27
+ # API client module.
28
28
  #
29
- # @example
29
+ # @example Load this package, including all its services, and instantiate a gRPC client
30
30
  #
31
31
  # require "google/cloud/eventarc/publishing/v1"
32
32
  # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new
33
33
  #
34
+ # @example Load this package, including all its services, and instantiate a REST client
35
+ #
36
+ # require "google/cloud/eventarc/publishing/v1"
37
+ # client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new
38
+ #
34
39
  module V1
35
40
  end
36
41
  end