sendmux-sending 1.4.0 → 2.0.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
- metadata +11 -120
- data/CHANGELOG.md +0 -41
- data/LICENSE +0 -21
- data/README.md +0 -112
- data/lib/sendmux/sending/client.rb +0 -49
- data/lib/sendmux/sending/version.rb +0 -7
- data/lib/sendmux/sending.rb +0 -12
- data/lib/sendmux_sending_generated/api/attachments_api.rb +0 -370
- data/lib/sendmux_sending_generated/api/emails_api.rb +0 -172
- data/lib/sendmux_sending_generated/api/meta_api.rb +0 -142
- data/lib/sendmux_sending_generated/api_client.rb +0 -447
- data/lib/sendmux_sending_generated/api_error.rb +0 -58
- data/lib/sendmux_sending_generated/api_model_base.rb +0 -88
- data/lib/sendmux_sending_generated/configuration.rb +0 -399
- data/lib/sendmux_sending_generated/models/address.rb +0 -215
- data/lib/sendmux_sending_generated/models/attachment.rb +0 -103
- data/lib/sendmux_sending_generated/models/attachment_upload_data.rb +0 -284
- data/lib/sendmux_sending_generated/models/attachment_upload_intent_data.rb +0 -337
- data/lib/sendmux_sending_generated/models/attachment_upload_intent_request.rb +0 -279
- data/lib/sendmux_sending_generated/models/attachment_upload_intent_response.rb +0 -223
- data/lib/sendmux_sending_generated/models/attachment_upload_response.rb +0 -223
- data/lib/sendmux_sending_generated/models/batch_result_item.rb +0 -256
- data/lib/sendmux_sending_generated/models/batch_send_request.rb +0 -185
- data/lib/sendmux_sending_generated/models/batch_send_success_data.rb +0 -192
- data/lib/sendmux_sending_generated/models/batch_send_success_response.rb +0 -223
- data/lib/sendmux_sending_generated/models/batch_summary.rb +0 -219
- data/lib/sendmux_sending_generated/models/connection.rb +0 -273
- data/lib/sendmux_sending_generated/models/connection_credential.rb +0 -226
- data/lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb +0 -190
- data/lib/sendmux_sending_generated/models/connection_response.rb +0 -223
- data/lib/sendmux_sending_generated/models/connection_team.rb +0 -190
- data/lib/sendmux_sending_generated/models/email_send_request.rb +0 -465
- data/lib/sendmux_sending_generated/models/error_detail.rb +0 -251
- data/lib/sendmux_sending_generated/models/error_issue.rb +0 -219
- data/lib/sendmux_sending_generated/models/error_response.rb +0 -216
- data/lib/sendmux_sending_generated/models/inline_attachment.rb +0 -274
- data/lib/sendmux_sending_generated/models/meta.rb +0 -165
- data/lib/sendmux_sending_generated/models/recipient.rb +0 -214
- data/lib/sendmux_sending_generated/models/send_success_data.rb +0 -227
- data/lib/sendmux_sending_generated/models/send_success_response.rb +0 -223
- data/lib/sendmux_sending_generated/models/success_envelope.rb +0 -190
- data/lib/sendmux_sending_generated/models/uploaded_attachment_ref.rb +0 -176
- data/lib/sendmux_sending_generated/version.rb +0 -15
- data/lib/sendmux_sending_generated.rb +0 -71
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 148cd0ff2e8abcae66dbb2685b9f3ed48d3177e2e509829d28e6a8546f65c73f
|
|
4
|
+
data.tar.gz: 6ebd6abf548de5dee12d6ba373a275bc968900696435a445d9b6f96af5fa1936
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11d9249f8bd68feeeef176e79bdfef34ecef124841bfc0ab1cf4cc944ec32eb76fbcb6af550e183b38c734b6af33b06ac596db96c9f099cfa7f74ef1082bd9f9
|
|
7
|
+
data.tar.gz: 8e30da7df1d48dc83f4d1eb9edbda0a9642a443ddce9a50a7f00266c38ed4b0ad6b7b23f47bf2360568d842b5989ee42b2a3d83b44325c667284ba900a8e7600
|
metadata
CHANGED
|
@@ -1,49 +1,21 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sendmux-sending
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- Qubrics
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - "~>"
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '2.0'
|
|
19
|
-
type: :runtime
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - "~>"
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: '2.0'
|
|
26
|
-
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: faraday-multipart
|
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
|
29
|
-
requirements:
|
|
30
|
-
- - "~>"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '1.0'
|
|
33
|
-
type: :runtime
|
|
34
|
-
prerelease: false
|
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
-
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '1.0'
|
|
40
|
-
- !ruby/object:Gem::Dependency
|
|
41
|
-
name: faraday-retry
|
|
13
|
+
name: qubrics-sending
|
|
42
14
|
requirement: !ruby/object:Gem::Requirement
|
|
43
15
|
requirements:
|
|
44
16
|
- - ">="
|
|
45
17
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
18
|
+
version: 2.0.0
|
|
47
19
|
- - "<"
|
|
48
20
|
- !ruby/object:Gem::Version
|
|
49
21
|
version: '3.0'
|
|
@@ -53,100 +25,19 @@ dependencies:
|
|
|
53
25
|
requirements:
|
|
54
26
|
- - ">="
|
|
55
27
|
- !ruby/object:Gem::Version
|
|
56
|
-
version:
|
|
28
|
+
version: 2.0.0
|
|
57
29
|
- - "<"
|
|
58
30
|
- !ruby/object:Gem::Version
|
|
59
31
|
version: '3.0'
|
|
60
|
-
|
|
61
|
-
name: marcel
|
|
62
|
-
requirement: !ruby/object:Gem::Requirement
|
|
63
|
-
requirements:
|
|
64
|
-
- - "~>"
|
|
65
|
-
- !ruby/object:Gem::Version
|
|
66
|
-
version: '1.0'
|
|
67
|
-
type: :runtime
|
|
68
|
-
prerelease: false
|
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
-
requirements:
|
|
71
|
-
- - "~>"
|
|
72
|
-
- !ruby/object:Gem::Version
|
|
73
|
-
version: '1.0'
|
|
74
|
-
- !ruby/object:Gem::Dependency
|
|
75
|
-
name: sendmux-core
|
|
76
|
-
requirement: !ruby/object:Gem::Requirement
|
|
77
|
-
requirements:
|
|
78
|
-
- - ">="
|
|
79
|
-
- !ruby/object:Gem::Version
|
|
80
|
-
version: 1.3.0
|
|
81
|
-
- - "<"
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: '2.0'
|
|
84
|
-
type: :runtime
|
|
85
|
-
prerelease: false
|
|
86
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
-
requirements:
|
|
88
|
-
- - ">="
|
|
89
|
-
- !ruby/object:Gem::Version
|
|
90
|
-
version: 1.3.0
|
|
91
|
-
- - "<"
|
|
92
|
-
- !ruby/object:Gem::Version
|
|
93
|
-
version: '2.0'
|
|
94
|
-
email:
|
|
95
|
-
- contact@sendmux.ai
|
|
32
|
+
description: Installs the required dependency.
|
|
96
33
|
executables: []
|
|
97
34
|
extensions: []
|
|
98
35
|
extra_rdoc_files: []
|
|
99
|
-
files:
|
|
100
|
-
|
|
101
|
-
- LICENSE
|
|
102
|
-
- README.md
|
|
103
|
-
- lib/sendmux/sending.rb
|
|
104
|
-
- lib/sendmux/sending/client.rb
|
|
105
|
-
- lib/sendmux/sending/version.rb
|
|
106
|
-
- lib/sendmux_sending_generated.rb
|
|
107
|
-
- lib/sendmux_sending_generated/api/attachments_api.rb
|
|
108
|
-
- lib/sendmux_sending_generated/api/emails_api.rb
|
|
109
|
-
- lib/sendmux_sending_generated/api/meta_api.rb
|
|
110
|
-
- lib/sendmux_sending_generated/api_client.rb
|
|
111
|
-
- lib/sendmux_sending_generated/api_error.rb
|
|
112
|
-
- lib/sendmux_sending_generated/api_model_base.rb
|
|
113
|
-
- lib/sendmux_sending_generated/configuration.rb
|
|
114
|
-
- lib/sendmux_sending_generated/models/address.rb
|
|
115
|
-
- lib/sendmux_sending_generated/models/attachment.rb
|
|
116
|
-
- lib/sendmux_sending_generated/models/attachment_upload_data.rb
|
|
117
|
-
- lib/sendmux_sending_generated/models/attachment_upload_intent_data.rb
|
|
118
|
-
- lib/sendmux_sending_generated/models/attachment_upload_intent_request.rb
|
|
119
|
-
- lib/sendmux_sending_generated/models/attachment_upload_intent_response.rb
|
|
120
|
-
- lib/sendmux_sending_generated/models/attachment_upload_response.rb
|
|
121
|
-
- lib/sendmux_sending_generated/models/batch_result_item.rb
|
|
122
|
-
- lib/sendmux_sending_generated/models/batch_send_request.rb
|
|
123
|
-
- lib/sendmux_sending_generated/models/batch_send_success_data.rb
|
|
124
|
-
- lib/sendmux_sending_generated/models/batch_send_success_response.rb
|
|
125
|
-
- lib/sendmux_sending_generated/models/batch_summary.rb
|
|
126
|
-
- lib/sendmux_sending_generated/models/connection.rb
|
|
127
|
-
- lib/sendmux_sending_generated/models/connection_credential.rb
|
|
128
|
-
- lib/sendmux_sending_generated/models/connection_mailboxes_inner.rb
|
|
129
|
-
- lib/sendmux_sending_generated/models/connection_response.rb
|
|
130
|
-
- lib/sendmux_sending_generated/models/connection_team.rb
|
|
131
|
-
- lib/sendmux_sending_generated/models/email_send_request.rb
|
|
132
|
-
- lib/sendmux_sending_generated/models/error_detail.rb
|
|
133
|
-
- lib/sendmux_sending_generated/models/error_issue.rb
|
|
134
|
-
- lib/sendmux_sending_generated/models/error_response.rb
|
|
135
|
-
- lib/sendmux_sending_generated/models/inline_attachment.rb
|
|
136
|
-
- lib/sendmux_sending_generated/models/meta.rb
|
|
137
|
-
- lib/sendmux_sending_generated/models/recipient.rb
|
|
138
|
-
- lib/sendmux_sending_generated/models/send_success_data.rb
|
|
139
|
-
- lib/sendmux_sending_generated/models/send_success_response.rb
|
|
140
|
-
- lib/sendmux_sending_generated/models/success_envelope.rb
|
|
141
|
-
- lib/sendmux_sending_generated/models/uploaded_attachment_ref.rb
|
|
142
|
-
- lib/sendmux_sending_generated/version.rb
|
|
143
|
-
homepage: https://github.com/Sendmux/sendmux-sdk
|
|
36
|
+
files: []
|
|
37
|
+
homepage: https://github.com/qubrics/qubrics-sdk
|
|
144
38
|
licenses:
|
|
145
39
|
- MIT
|
|
146
|
-
metadata:
|
|
147
|
-
homepage_uri: https://github.com/Sendmux/sendmux-sdk
|
|
148
|
-
source_code_uri: https://github.com/Sendmux/sendmux-sdk/tree/main/packages/ruby/sending
|
|
149
|
-
changelog_uri: https://github.com/Sendmux/sendmux-sdk/blob/main/packages/ruby/sending/CHANGELOG.md
|
|
40
|
+
metadata: {}
|
|
150
41
|
rdoc_options: []
|
|
151
42
|
require_paths:
|
|
152
43
|
- lib
|
|
@@ -163,5 +54,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
163
54
|
requirements: []
|
|
164
55
|
rubygems_version: 3.6.2
|
|
165
56
|
specification_version: 4
|
|
166
|
-
summary:
|
|
57
|
+
summary: Dependency-only package.
|
|
167
58
|
test_files: []
|
data/CHANGELOG.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.4.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.3.0...ruby-sending/v1.4.0) (2026-09-10)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Features
|
|
7
|
-
|
|
8
|
-
* add REST OAuth clients and CLI token lifecycle ([cc4a3aa](https://github.com/Sendmux/sendmux-sdk/commit/cc4a3aa6110378641418a94455ed5b9a986e65ff))
|
|
9
|
-
|
|
10
|
-
## [1.3.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.2.0...ruby-sending/v1.3.0) (2026-09-08)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* add connection checks across SDKs, CLI and MCP ([77f449e](https://github.com/Sendmux/sendmux-sdk/commit/77f449e2c8cba49bc8bc84c49c35baa61120866a))
|
|
16
|
-
* **sdk:** add connection checks across clients, CLI and MCP ([3e02c67](https://github.com/Sendmux/sendmux-sdk/commit/3e02c67dcab45e37dad7abbdd4c4e1bd0b1fbbe6))
|
|
17
|
-
|
|
18
|
-
## [1.2.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.1.0...ruby-sending/v1.2.0) (2026-07-08)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Features
|
|
22
|
-
|
|
23
|
-
* **sdk:** add sending attachment upload surfaces ([#96](https://github.com/Sendmux/sendmux-sdk/issues/96)) ([b8f9d5f](https://github.com/Sendmux/sendmux-sdk/commit/b8f9d5fe3c1ae510db82ce05c55cbcad92b43b44))
|
|
24
|
-
|
|
25
|
-
## [1.1.0](https://github.com/Sendmux/sendmux-sdk/compare/ruby-sending/v1.0.0...ruby-sending/v1.1.0) (2026-07-01)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Features
|
|
29
|
-
|
|
30
|
-
* allow owner-approved agent tokens for sending ([9d1cb7d](https://github.com/Sendmux/sendmux-sdk/commit/9d1cb7df3df5aef1f59a4990dc087178ba3a7b21))
|
|
31
|
-
|
|
32
|
-
## 1.0.0 (2026-06-02)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### Features
|
|
36
|
-
|
|
37
|
-
* **ruby:** add generated SDK packages ([f097fdf](https://github.com/Sendmux/sendmux-sdk/commit/f097fdf6afcbc2a048d9fdb1c9a669fff2a7ca4f))
|
|
38
|
-
|
|
39
|
-
## 1.0.0
|
|
40
|
-
|
|
41
|
-
- Initial generated Ruby Sending API package.
|
data/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Sendmux
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# sendmux-sending
|
|
2
|
-
|
|
3
|
-
[](https://rubygems.org/gems/sendmux-sending)
|
|
4
|
-
[](https://github.com/Sendmux/sendmux-sdk/actions/workflows/ci.yml)
|
|
5
|
-
[](https://github.com/Sendmux/sendmux-sdk/blob/main/LICENSE)
|
|
6
|
-
|
|
7
|
-
Ruby SDK package for the Sendmux Sending API.
|
|
8
|
-
|
|
9
|
-
## Documentation
|
|
10
|
-
|
|
11
|
-
- Ruby SDK guide: https://sendmux.ai/docs/sdks/ruby
|
|
12
|
-
- Sending API reference: https://sendmux.ai/docs/sending-api
|
|
13
|
-
- Source: https://github.com/Sendmux/sendmux-sdk/tree/main/packages/ruby/sending
|
|
14
|
-
- Changelog: https://github.com/Sendmux/sendmux-sdk/blob/main/packages/ruby/sending/CHANGELOG.md
|
|
15
|
-
|
|
16
|
-
## Requirements
|
|
17
|
-
|
|
18
|
-
- Ruby 3.1 or newer.
|
|
19
|
-
- A send-capable `smx_mbx_` key or owner-approved Sending-resource `smx_agent_` token.
|
|
20
|
-
|
|
21
|
-
For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See [OAuth for REST APIs](https://sendmux.ai/docs/developer-tools/oauth).
|
|
22
|
-
|
|
23
|
-
## Installation
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
gem install sendmux-sending
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Or add it to your Gemfile:
|
|
30
|
-
|
|
31
|
-
```ruby
|
|
32
|
-
gem "sendmux-sending", "~> 1.0"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## OAuth access tokens
|
|
36
|
-
|
|
37
|
-
Pass either `api_key:` or `access_token:`. `access_token:` accepts a bare token string or a callable; the callable is evaluated once per authenticated request. Your application owns token storage, expiry checks and refresh coordination.
|
|
38
|
-
|
|
39
|
-
```ruby
|
|
40
|
-
require "sendmux/sending"
|
|
41
|
-
|
|
42
|
-
client = Sendmux::Sending::Client.new(
|
|
43
|
-
access_token: -> { ENV.fetch("SENDMUX_ACCESS_TOKEN") }
|
|
44
|
-
)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Usage
|
|
48
|
-
|
|
49
|
-
Create a sending client with a send-capable key for the API-key example below.
|
|
50
|
-
|
|
51
|
-
```ruby
|
|
52
|
-
require "sendmux/sending"
|
|
53
|
-
|
|
54
|
-
client = Sendmux::Sending::Client.new(
|
|
55
|
-
api_key: ENV.fetch("SENDMUX_MAILBOX_KEY")
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
request = Sendmux::Sending::Generated::EmailSendRequest.new(
|
|
59
|
-
from: Sendmux::Sending::Generated::Address.new(email: "sender@example.com"),
|
|
60
|
-
to: Sendmux::Sending::Generated::Address.new(email: "recipient@example.com"),
|
|
61
|
-
subject: "Hello from Sendmux",
|
|
62
|
-
text_body: "This message was sent with the Sendmux Ruby SDK."
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
response = client.emails.sending_send_email(
|
|
66
|
-
request,
|
|
67
|
-
Sendmux::Core::Headers.idempotency_key("send-email-001")
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
puts response.data.message_id
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Client surface
|
|
74
|
-
|
|
75
|
-
`Sendmux::Sending::Client` exposes:
|
|
76
|
-
|
|
77
|
-
- `client.emails` for `sending_send_email` and `sending_send_email_batch`.
|
|
78
|
-
- `client.meta` for `sending_get_open_api_spec`.
|
|
79
|
-
|
|
80
|
-
Pass `base_url:` only when you are targeting an explicitly provided Sendmux endpoint for a controlled environment.
|
|
81
|
-
|
|
82
|
-
### Idempotency and retries
|
|
83
|
-
|
|
84
|
-
Mutating sending operations accept the `:idempotency_key` option. Use `Sendmux::Core::Headers.idempotency_key` so retries are safe when a request is replayable.
|
|
85
|
-
|
|
86
|
-
```ruby
|
|
87
|
-
client.emails.sending_send_email(
|
|
88
|
-
request,
|
|
89
|
-
Sendmux::Core::Headers.idempotency_key("send-email-002")
|
|
90
|
-
)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Errors
|
|
94
|
-
|
|
95
|
-
Generated API errors are mapped to `Sendmux::Core::ApiError`.
|
|
96
|
-
|
|
97
|
-
```ruby
|
|
98
|
-
begin
|
|
99
|
-
client.emails.sending_send_email(request)
|
|
100
|
-
rescue Sendmux::Core::ApiError => error
|
|
101
|
-
warn "#{error.status} #{error.code}: #{error.message}"
|
|
102
|
-
end
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Support
|
|
106
|
-
|
|
107
|
-
- Documentation: https://sendmux.ai/docs
|
|
108
|
-
- Contact: contact@sendmux.ai
|
|
109
|
-
|
|
110
|
-
## Licence
|
|
111
|
-
|
|
112
|
-
MIT licence. See https://github.com/Sendmux/sendmux-sdk/blob/main/LICENSE.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Sendmux
|
|
4
|
-
module Sending
|
|
5
|
-
DEFAULT_BASE_URL = 'https://smtp.sendmux.ai/api/v1'
|
|
6
|
-
|
|
7
|
-
class ApiClient < Generated::ApiClient
|
|
8
|
-
def update_params_for_auth!(header_params, query_params, auth_names)
|
|
9
|
-
return super unless config.access_token_getter && !Array(auth_names).empty?
|
|
10
|
-
|
|
11
|
-
header_params['Authorization'] = "Bearer #{config.access_token_with_refresh}"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def call_api(...)
|
|
15
|
-
super
|
|
16
|
-
rescue Generated::ApiError => e
|
|
17
|
-
raise Sendmux::Core::ErrorMapper.map(e)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
class Client
|
|
22
|
-
attr_reader :api_client, :configuration
|
|
23
|
-
|
|
24
|
-
def initialize(api_key: nil, access_token: nil, base_url: DEFAULT_BASE_URL, retry_options: nil)
|
|
25
|
-
@configuration = Sendmux::Core::Auth.configure_bearer(
|
|
26
|
-
Generated::Configuration.new,
|
|
27
|
-
api_key,
|
|
28
|
-
Sendmux::Core::ApiKeySurface::SENDING,
|
|
29
|
-
base_url: base_url,
|
|
30
|
-
access_token: access_token
|
|
31
|
-
)
|
|
32
|
-
Sendmux::Core::Retry.configure(@configuration, retry_options)
|
|
33
|
-
@api_client = ApiClient.new(@configuration)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def attachments
|
|
37
|
-
@attachments ||= Generated::AttachmentsApi.new(@api_client)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def emails
|
|
41
|
-
@emails ||= Generated::EmailsApi.new(@api_client)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def meta
|
|
45
|
-
@meta ||= Generated::MetaApi.new(@api_client)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|