sendpost_ruby_sdk 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9eb2149c22351f9d17d9847b0033f1bcc4e92af1425143e350f9de9ed0cd2c03
4
- data.tar.gz: 359e1e022b62989d09c73ac780da73aec846ace95cc8029d0b24836d0783053a
3
+ metadata.gz: da8591f47fba789343ae8ef83d83536663256cf93b68d143fa05740630c1b7f0
4
+ data.tar.gz: 72c1744e06d5c530f6603399b2ade313bb75501e777879b22051005677f132fe
5
5
  SHA512:
6
- metadata.gz: e1e71a7501180a3796d5ad29a933adfb0d8278b896e92ce65688022f6ecc1eb1636767af0475833d3b9dfad0ddc2e39b253d40f1e9edde32cc6b58ddc03e3f40
7
- data.tar.gz: 3f1481486c0ecff2636699e4f2c02f2e90f0a2776a110fdf4a3ac32275246a72f0c0f23b3cde6a7cbea1bf28b0c851c167b0b1800685e05f3eadff84ae997cb2
6
+ metadata.gz: 1b3ad6d22a7d37432a3fc077b4847aff39f3971739d069978cb83c59d2371abc0f518b3b96df02dec46acade15c521a2b443a912ce1523b101dc7514460a61e2
7
+ data.tar.gz: a8f5e8c7598b3b845340100768766e75d2eedded7dfa27e92b6afa83f4c82e99db9f88718a150c6cc3747df9a8e8db975b50aa215bed219243890127dd3f7c29
data/README.md CHANGED
@@ -8,7 +8,7 @@ Email API and SMTP relay to not just send and measure email sending, but also al
8
8
  ## Installation
9
9
 
10
10
  ```shell
11
- gem install sendpost_ruby_sdk-1.0.0.gem
11
+ gem install sendpost_ruby_sdk
12
12
  ```
13
13
 
14
14
  ## Getting Started
@@ -44,6 +44,41 @@ end
44
44
 
45
45
  ```
46
46
 
47
+ Example with cc, bcc and template:
48
+
49
+ ```ruby
50
+ require 'sendpost_ruby_sdk'
51
+
52
+ api_instance = Sendpost::EmailApi.new
53
+ x_sub_account_api_key = 'your_api_key' # String | Sub-Account API Key
54
+ email_message = Sendpost::EmailMessage.new
55
+ email_message.from = {
56
+ email: 'richard@piedpiper.com'
57
+ }
58
+ email_message.to = [{
59
+ email: 'gavin@hooli.com',
60
+ cc: [{ email: 'dinesh@bachmanity.com' }],
61
+ bcc: [{ email: 'jian@bachmanity.com' }]
62
+ }]
63
+
64
+ email_message.subject = 'Hello World'
65
+ email_message.template = 'Welcome Mail'
66
+ email_message.html_body = '<strong>it works!</strong>'
67
+ email_message.ippool = 'PiedPiper'
68
+
69
+ opts = {
70
+ email_message: email_message # EmailMessage | Email message
71
+ }
72
+
73
+ begin
74
+ result = api_instance.send_email_with_template(x_sub_account_api_key, opts)
75
+ p result
76
+ rescue Sendpost::ApiError => e
77
+ puts "Exception when calling EmailApi->send_email: #{e}"
78
+ end
79
+
80
+ ```
81
+
47
82
  ## Documentation for API Endpoints
48
83
 
49
84
  All URIs are relative to *https://api.sendpost.io/api/v1*
@@ -52,6 +87,10 @@ Class | Method | HTTP request | Description
52
87
  ------------ | ------------- | ------------- | -------------
53
88
  *Sendpost::EmailApi* | [**send_email**](docs/EmailApi.md#send_email) | **POST** /subaccount/email/ |
54
89
  *Sendpost::EmailApi* | [**send_email_with_template**](docs/EmailApi.md#send_email_with_template) | **POST** /subaccount/email/template |
90
+ *Sendpost::SuppressionApi* | [**count**](docs/SuppressionApi.md#count) | **GET** /subaccount/suppression/count |
91
+ *Sendpost::SuppressionApi* | [**create_suppressions**](docs/SuppressionApi.md#create_suppressions) | **POST** /subaccount/suppression/ |
92
+ *Sendpost::SuppressionApi* | [**delete_suppression**](docs/SuppressionApi.md#delete_suppression) | **DELETE** /subaccount/suppression/ |
93
+ *Sendpost::SuppressionApi* | [**get_suppressions**](docs/SuppressionApi.md#get_suppressions) | **GET** /subaccount/suppression/ |
55
94
 
56
95
 
57
96
  ## Documentation for Models
@@ -59,6 +98,8 @@ Class | Method | HTTP request | Description
59
98
  - [Sendpost::Attachment](docs/Attachment.md)
60
99
  - [Sendpost::City](docs/City.md)
61
100
  - [Sendpost::CopyTo](docs/CopyTo.md)
101
+ - [Sendpost::CountStat](docs/CountStat.md)
102
+ - [Sendpost::DeleteResponse](docs/DeleteResponse.md)
62
103
  - [Sendpost::Device](docs/Device.md)
63
104
  - [Sendpost::EmailMessage](docs/EmailMessage.md)
64
105
  - [Sendpost::EmailResponse](docs/EmailResponse.md)
@@ -67,7 +108,11 @@ Class | Method | HTTP request | Description
67
108
  - [Sendpost::Os](docs/Os.md)
68
109
  - [Sendpost::QEmailMessage](docs/QEmailMessage.md)
69
110
  - [Sendpost::QEvent](docs/QEvent.md)
111
+ - [Sendpost::RDSuppression](docs/RDSuppression.md)
112
+ - [Sendpost::RSuppression](docs/RSuppression.md)
70
113
  - [Sendpost::ReplyTo](docs/ReplyTo.md)
114
+ - [Sendpost::Suppression](docs/Suppression.md)
115
+ - [Sendpost::SuppressionEmail](docs/SuppressionEmail.md)
71
116
  - [Sendpost::To](docs/To.md)
72
117
  - [Sendpost::UserAgent](docs/UserAgent.md)
73
118
  - [Sendpost::WebhookEvent](docs/WebhookEvent.md)
data/config-ruby.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "gemAuthor": "Sendpost",
5
5
  "gemAuthorEmail": "dev@sendpost.io",
6
6
  "gemDescription": "Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.",
7
- "gemHomepage": "https://sendpost.io/",
7
+ "gemHomepage": "https://github.com/sendpost/sendpost_ruby_sdk",
8
8
  "gemSummary": "SendPost Ruby API",
9
9
  "gemName": "sendpost_ruby_sdk",
10
- "gemVersion": "1.0.0"
10
+ "gemVersion": "1.0.1"
11
11
  }
data/docs/CountStat.md ADDED
@@ -0,0 +1,18 @@
1
+ # Sendpost::CountStat
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **count** | **Integer** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'sendpost_ruby_sdk'
13
+
14
+ instance = Sendpost::CountStat.new(
15
+ count: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,20 @@
1
+ # Sendpost::DeleteResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **Integer** | | [optional] |
8
+ | **message** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'sendpost_ruby_sdk'
14
+
15
+ instance = Sendpost::DeleteResponse.new(
16
+ id: null,
17
+ message: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,18 @@
1
+ # Sendpost::RDSuppression
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **suppressions** | [**Array&lt;SuppressionEmail&gt;**](SuppressionEmail.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'sendpost_ruby_sdk'
13
+
14
+ instance = Sendpost::RDSuppression.new(
15
+ suppressions: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,24 @@
1
+ # Sendpost::RSuppression
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **hard_bounce** | [**Array&lt;SuppressionEmail&gt;**](SuppressionEmail.md) | | [optional] |
8
+ | **manual** | [**Array&lt;SuppressionEmail&gt;**](SuppressionEmail.md) | | [optional] |
9
+ | **spam_complaint** | [**Array&lt;SuppressionEmail&gt;**](SuppressionEmail.md) | | [optional] |
10
+ | **unsubscribe** | [**Array&lt;SuppressionEmail&gt;**](SuppressionEmail.md) | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'sendpost_ruby_sdk'
16
+
17
+ instance = Sendpost::RSuppression.new(
18
+ hard_bounce: null,
19
+ manual: null,
20
+ spam_complaint: null,
21
+ unsubscribe: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,26 @@
1
+ # Sendpost::Suppression
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **created** | **Integer** | | [optional] |
8
+ | **email** | **String** | | [optional] |
9
+ | **id** | **Integer** | | [optional] |
10
+ | **reason** | **Integer** | | [optional] |
11
+ | **smtp_error** | **String** | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'sendpost_ruby_sdk'
17
+
18
+ instance = Sendpost::Suppression.new(
19
+ created: null,
20
+ email: null,
21
+ id: null,
22
+ reason: null,
23
+ smtp_error: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,293 @@
1
+ # Sendpost::SuppressionApi
2
+
3
+ All URIs are relative to *https://api.sendpost.io/api/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**count**](SuppressionApi.md#count) | **GET** /subaccount/suppression/count | |
8
+ | [**create_suppressions**](SuppressionApi.md#create_suppressions) | **POST** /subaccount/suppression/ | |
9
+ | [**delete_suppression**](SuppressionApi.md#delete_suppression) | **DELETE** /subaccount/suppression/ | |
10
+ | [**get_suppressions**](SuppressionApi.md#get_suppressions) | **GET** /subaccount/suppression/ | |
11
+
12
+
13
+ ## count
14
+
15
+ > <CountStat> count(x_sub_account_api_key, opts)
16
+
17
+
18
+
19
+ Count Total Suppressions
20
+
21
+ ### Examples
22
+
23
+ ```ruby
24
+ require 'time'
25
+ require 'sendpost_ruby_sdk'
26
+
27
+ api_instance = Sendpost::SuppressionApi.new
28
+ x_sub_account_api_key = 'x_sub_account_api_key_example' # String | Sub-Account API Key
29
+ opts = {
30
+ from: 'from_example', # String | from date
31
+ to: 'to_example' # String | to date
32
+ }
33
+
34
+ begin
35
+
36
+ result = api_instance.count(x_sub_account_api_key, opts)
37
+ p result
38
+ rescue Sendpost::ApiError => e
39
+ puts "Error when calling SuppressionApi->count: #{e}"
40
+ end
41
+ ```
42
+
43
+ #### Using the count_with_http_info variant
44
+
45
+ This returns an Array which contains the response data, status code and headers.
46
+
47
+ > <Array(<CountStat>, Integer, Hash)> count_with_http_info(x_sub_account_api_key, opts)
48
+
49
+ ```ruby
50
+ begin
51
+
52
+ data, status_code, headers = api_instance.count_with_http_info(x_sub_account_api_key, opts)
53
+ p status_code # => 2xx
54
+ p headers # => { ... }
55
+ p data # => <CountStat>
56
+ rescue Sendpost::ApiError => e
57
+ puts "Error when calling SuppressionApi->count_with_http_info: #{e}"
58
+ end
59
+ ```
60
+
61
+ ### Parameters
62
+
63
+ | Name | Type | Description | Notes |
64
+ | ---- | ---- | ----------- | ----- |
65
+ | **x_sub_account_api_key** | **String** | Sub-Account API Key | |
66
+ | **from** | **String** | from date | [optional] |
67
+ | **to** | **String** | to date | [optional] |
68
+
69
+ ### Return type
70
+
71
+ [**CountStat**](CountStat.md)
72
+
73
+ ### Authorization
74
+
75
+ No authorization required
76
+
77
+ ### HTTP request headers
78
+
79
+ - **Content-Type**: Not defined
80
+ - **Accept**: application/json
81
+
82
+
83
+ ## create_suppressions
84
+
85
+ > <Array<Suppression>> create_suppressions(x_sub_account_api_key, opts)
86
+
87
+
88
+
89
+ Add Email Addresses To Suppression List
90
+
91
+ ### Examples
92
+
93
+ ```ruby
94
+ require 'time'
95
+ require 'sendpost_ruby_sdk'
96
+
97
+ api_instance = Sendpost::SuppressionApi.new
98
+ x_sub_account_api_key = 'x_sub_account_api_key_example' # String | Sub-Account API Key
99
+ opts = {
100
+ r_suppression: Sendpost::RSuppression.new # RSuppression | Suppression content
101
+ }
102
+
103
+ begin
104
+
105
+ result = api_instance.create_suppressions(x_sub_account_api_key, opts)
106
+ p result
107
+ rescue Sendpost::ApiError => e
108
+ puts "Error when calling SuppressionApi->create_suppressions: #{e}"
109
+ end
110
+ ```
111
+
112
+ #### Using the create_suppressions_with_http_info variant
113
+
114
+ This returns an Array which contains the response data, status code and headers.
115
+
116
+ > <Array(<Array<Suppression>>, Integer, Hash)> create_suppressions_with_http_info(x_sub_account_api_key, opts)
117
+
118
+ ```ruby
119
+ begin
120
+
121
+ data, status_code, headers = api_instance.create_suppressions_with_http_info(x_sub_account_api_key, opts)
122
+ p status_code # => 2xx
123
+ p headers # => { ... }
124
+ p data # => <Array<Suppression>>
125
+ rescue Sendpost::ApiError => e
126
+ puts "Error when calling SuppressionApi->create_suppressions_with_http_info: #{e}"
127
+ end
128
+ ```
129
+
130
+ ### Parameters
131
+
132
+ | Name | Type | Description | Notes |
133
+ | ---- | ---- | ----------- | ----- |
134
+ | **x_sub_account_api_key** | **String** | Sub-Account API Key | |
135
+ | **r_suppression** | [**RSuppression**](RSuppression.md) | Suppression content | [optional] |
136
+
137
+ ### Return type
138
+
139
+ [**Array&lt;Suppression&gt;**](Suppression.md)
140
+
141
+ ### Authorization
142
+
143
+ No authorization required
144
+
145
+ ### HTTP request headers
146
+
147
+ - **Content-Type**: application/json
148
+ - **Accept**: application/json
149
+
150
+
151
+ ## delete_suppression
152
+
153
+ > <Array<DeleteResponse>> delete_suppression(x_sub_account_api_key, opts)
154
+
155
+
156
+
157
+ Delete specific emails which are in suppression list
158
+
159
+ ### Examples
160
+
161
+ ```ruby
162
+ require 'time'
163
+ require 'sendpost_ruby_sdk'
164
+
165
+ api_instance = Sendpost::SuppressionApi.new
166
+ x_sub_account_api_key = 'x_sub_account_api_key_example' # String | Sub-Account API Key
167
+ opts = {
168
+ rd_suppression: Sendpost::RDSuppression.new # RDSuppression | Suppression content
169
+ }
170
+
171
+ begin
172
+
173
+ result = api_instance.delete_suppression(x_sub_account_api_key, opts)
174
+ p result
175
+ rescue Sendpost::ApiError => e
176
+ puts "Error when calling SuppressionApi->delete_suppression: #{e}"
177
+ end
178
+ ```
179
+
180
+ #### Using the delete_suppression_with_http_info variant
181
+
182
+ This returns an Array which contains the response data, status code and headers.
183
+
184
+ > <Array(<Array<DeleteResponse>>, Integer, Hash)> delete_suppression_with_http_info(x_sub_account_api_key, opts)
185
+
186
+ ```ruby
187
+ begin
188
+
189
+ data, status_code, headers = api_instance.delete_suppression_with_http_info(x_sub_account_api_key, opts)
190
+ p status_code # => 2xx
191
+ p headers # => { ... }
192
+ p data # => <Array<DeleteResponse>>
193
+ rescue Sendpost::ApiError => e
194
+ puts "Error when calling SuppressionApi->delete_suppression_with_http_info: #{e}"
195
+ end
196
+ ```
197
+
198
+ ### Parameters
199
+
200
+ | Name | Type | Description | Notes |
201
+ | ---- | ---- | ----------- | ----- |
202
+ | **x_sub_account_api_key** | **String** | Sub-Account API Key | |
203
+ | **rd_suppression** | [**RDSuppression**](RDSuppression.md) | Suppression content | [optional] |
204
+
205
+ ### Return type
206
+
207
+ [**Array&lt;DeleteResponse&gt;**](DeleteResponse.md)
208
+
209
+ ### Authorization
210
+
211
+ No authorization required
212
+
213
+ ### HTTP request headers
214
+
215
+ - **Content-Type**: application/json
216
+ - **Accept**: application/json
217
+
218
+
219
+ ## get_suppressions
220
+
221
+ > <Array<Suppression>> get_suppressions(x_sub_account_api_key, opts)
222
+
223
+
224
+
225
+ Get all suppressions
226
+
227
+ ### Examples
228
+
229
+ ```ruby
230
+ require 'time'
231
+ require 'sendpost_ruby_sdk'
232
+
233
+ api_instance = Sendpost::SuppressionApi.new
234
+ x_sub_account_api_key = 'x_sub_account_api_key_example' # String | Sub-Account API Key
235
+ opts = {
236
+ offset: 789, # Integer | offset
237
+ limit: 789, # Integer | limit
238
+ search: 'search_example', # String | search
239
+ from: 'from_example', # String | from date
240
+ to: 'to_example' # String | to date
241
+ }
242
+
243
+ begin
244
+
245
+ result = api_instance.get_suppressions(x_sub_account_api_key, opts)
246
+ p result
247
+ rescue Sendpost::ApiError => e
248
+ puts "Error when calling SuppressionApi->get_suppressions: #{e}"
249
+ end
250
+ ```
251
+
252
+ #### Using the get_suppressions_with_http_info variant
253
+
254
+ This returns an Array which contains the response data, status code and headers.
255
+
256
+ > <Array(<Array<Suppression>>, Integer, Hash)> get_suppressions_with_http_info(x_sub_account_api_key, opts)
257
+
258
+ ```ruby
259
+ begin
260
+
261
+ data, status_code, headers = api_instance.get_suppressions_with_http_info(x_sub_account_api_key, opts)
262
+ p status_code # => 2xx
263
+ p headers # => { ... }
264
+ p data # => <Array<Suppression>>
265
+ rescue Sendpost::ApiError => e
266
+ puts "Error when calling SuppressionApi->get_suppressions_with_http_info: #{e}"
267
+ end
268
+ ```
269
+
270
+ ### Parameters
271
+
272
+ | Name | Type | Description | Notes |
273
+ | ---- | ---- | ----------- | ----- |
274
+ | **x_sub_account_api_key** | **String** | Sub-Account API Key | |
275
+ | **offset** | **Integer** | offset | [optional] |
276
+ | **limit** | **Integer** | limit | [optional] |
277
+ | **search** | **String** | search | [optional] |
278
+ | **from** | **String** | from date | [optional] |
279
+ | **to** | **String** | to date | [optional] |
280
+
281
+ ### Return type
282
+
283
+ [**Array&lt;Suppression&gt;**](Suppression.md)
284
+
285
+ ### Authorization
286
+
287
+ No authorization required
288
+
289
+ ### HTTP request headers
290
+
291
+ - **Content-Type**: Not defined
292
+ - **Accept**: application/json
293
+
@@ -0,0 +1,18 @@
1
+ # Sendpost::SuppressionEmail
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'sendpost_ruby_sdk'
13
+
14
+ instance = Sendpost::SuppressionEmail.new(
15
+ email: null
16
+ )
17
+ ```
18
+