helo-email-sdk 1.0.0.pre.beta.8 → 1.0.0.pre.beta.9
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/README.md +1 -1
- data/lib/helo/apis/sending.rb +5 -5
- data/lib/helo/client.rb +8 -0
- data/lib/helo/core/client.rb +8 -0
- data/lib/helo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 763e8c10e5f8bb0185d0bb5d403ac124251f4617eb576e43529819511c2c48fb
|
|
4
|
+
data.tar.gz: b66d39d5a778657060dd56c36acbbd7c9c6589805c1409007a66b707d72f02fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8018c7857a5bdc849ef2d98678616f143ff1ba8a4719c479cbf4f45eac46ec1a04f5a55e611ec11235f03b9384917f7459af3fbf8ec892177064533fab4a7a2
|
|
7
|
+
data.tar.gz: '0959f7281a4591ddfa71f429d8e636fa8e00a0f59a17a182504308159777f96c6827aed144506369729354dfc0f9650957018ba7378ce741b858bd3c706a1652'
|
data/README.md
CHANGED
data/lib/helo/apis/sending.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Helo
|
|
4
4
|
class Sending < API
|
|
5
|
-
def
|
|
5
|
+
def send_transactional(request_data, channel_id: nil, idempotency_key: nil)
|
|
6
6
|
request = SendMessageRequest.new(request_data)
|
|
7
7
|
headers = {}
|
|
8
8
|
headers["X-Helo-Channel-Id"] = channel_id unless channel_id.nil?
|
|
@@ -11,7 +11,7 @@ module Helo
|
|
|
11
11
|
SendMessageAcceptedResponse.from_hash(response.body)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def
|
|
14
|
+
def send_transactional_batch(request_data, channel_id: nil, idempotency_key: nil)
|
|
15
15
|
request = SendMessageBatchRequest.new(request_data)
|
|
16
16
|
headers = {}
|
|
17
17
|
headers["X-Helo-Channel-Id"] = channel_id unless channel_id.nil?
|
|
@@ -20,7 +20,7 @@ module Helo
|
|
|
20
20
|
SendMessageBatchResponse.from_hash(response.body)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def
|
|
23
|
+
def send_broadcast(request_data, channel_id: nil, idempotency_key: nil)
|
|
24
24
|
request = SendBroadcastRequest.new(request_data)
|
|
25
25
|
headers = {}
|
|
26
26
|
headers["X-Helo-Channel-Id"] = channel_id unless channel_id.nil?
|
|
@@ -29,7 +29,7 @@ module Helo
|
|
|
29
29
|
SendBroadcastResponse.from_hash(response.body)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
def
|
|
32
|
+
def send_broadcast_message(request_data, channel_id: nil, idempotency_key: nil)
|
|
33
33
|
request = SendMessageRequest.new(request_data)
|
|
34
34
|
headers = {}
|
|
35
35
|
headers["X-Helo-Channel-Id"] = channel_id unless channel_id.nil?
|
|
@@ -38,6 +38,6 @@ module Helo
|
|
|
38
38
|
SendMessageAcceptedResponse.from_hash(response.body)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
class_methods :
|
|
41
|
+
class_methods :send_transactional, :send_transactional_batch, :send_broadcast, :send_broadcast_message
|
|
42
42
|
end
|
|
43
43
|
end
|
data/lib/helo/client.rb
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
module Helo
|
|
4
4
|
class Client < Helo::Core::Client
|
|
5
|
+
# Identifies the package and the Ruby it is running on. RUBY_PLATFORM covers
|
|
6
|
+
# OS and architecture in one ("arm64-darwin24", "x86_64-linux").
|
|
7
|
+
USER_AGENT = "helo-email-sdk/1.0.0-beta.9 (ruby #{RUBY_VERSION}; #{RUBY_PLATFORM})"
|
|
8
|
+
|
|
9
|
+
def user_agent
|
|
10
|
+
USER_AGENT
|
|
11
|
+
end
|
|
12
|
+
|
|
5
13
|
private
|
|
6
14
|
|
|
7
15
|
def handle_error_response(response)
|
data/lib/helo/core/client.rb
CHANGED
|
@@ -21,6 +21,8 @@ module Helo::Core
|
|
|
21
21
|
token = current_api_key
|
|
22
22
|
req.headers["Authorization"] = "Bearer #{token}" if token
|
|
23
23
|
|
|
24
|
+
req.headers["User-Agent"] = user_agent if user_agent
|
|
25
|
+
|
|
24
26
|
# Apply per-request headers verbatim (already in wire form)
|
|
25
27
|
headers.each do |key, value|
|
|
26
28
|
req.headers[key.to_s] = value.to_s
|
|
@@ -32,6 +34,12 @@ module Helo::Core
|
|
|
32
34
|
handle_connection_error(e)
|
|
33
35
|
end
|
|
34
36
|
|
|
37
|
+
# The generated Client subclass overrides this with the package identity it
|
|
38
|
+
# was generated for; Helo::Core on its own has no package to name.
|
|
39
|
+
def user_agent
|
|
40
|
+
nil
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
private
|
|
36
44
|
|
|
37
45
|
def connection
|
data/lib/helo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: helo-email-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.pre.beta.
|
|
4
|
+
version: 1.0.0.pre.beta.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Helo Email
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activemodel
|
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
253
253
|
- !ruby/object:Gem::Version
|
|
254
254
|
version: '0'
|
|
255
255
|
requirements: []
|
|
256
|
-
rubygems_version:
|
|
256
|
+
rubygems_version: 4.0.10
|
|
257
257
|
specification_version: 4
|
|
258
258
|
summary: Helo Ruby SDK
|
|
259
259
|
test_files: []
|