simple_spark 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +65 -3
- data/lib/simple_spark/client.rb +4 -0
- data/lib/simple_spark/endpoints/relay_webhooks.rb +66 -0
- data/lib/simple_spark/endpoints/sending_domains.rb +3 -3
- data/lib/simple_spark/version.rb +1 -1
- data/lib/simple_spark.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc5b026632213e5e88bc3e7c4260ce79ba4184a
|
4
|
+
data.tar.gz: 0beacfa2100f3a4a9419104e271983383780a4ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cb764d5b04dba18a6641994dd9235c7f71984b2b8d1ae664b0ab4b378d0dd41022c90ddf267932f6a40da6cce91c4253f4c0bef60de0a601002049d99a3421e
|
7
|
+
data.tar.gz: faeef41ea69b60c34a7e7c9febc6e4c820ff10348f757e7a77b37a1894a96b00677e9c72b981e41f2560f4052dd6aca7b931bac24008b360ed4a163829578870
|
data/README.md
CHANGED
@@ -272,7 +272,7 @@ simple_spark.sending_domains.create('mail.mydomain.com')
|
|
272
272
|
|
273
273
|
#### Retrieve
|
274
274
|
|
275
|
-
Retrieves a Sending
|
275
|
+
Retrieves a Sending Domain by its domain name
|
276
276
|
|
277
277
|
```ruby
|
278
278
|
simple_spark.sending_domains.retrieve('mail.mydomain.com')
|
@@ -342,7 +342,7 @@ simple_spark.inbound_domains.create('mail.mydomain.com')
|
|
342
342
|
|
343
343
|
#### Retrieve
|
344
344
|
|
345
|
-
Retrieves an Inbound
|
345
|
+
Retrieves an Inbound Domain by its domain name
|
346
346
|
|
347
347
|
```ruby
|
348
348
|
simple_spark.inbound_domains.retrieve('mail.mydomain.com')
|
@@ -360,6 +360,68 @@ simple_spark.inbound_domains.delete('mail.mydomain.com')
|
|
360
360
|
|
361
361
|
<a href="https://developers.sparkpost.com/api/#/reference/inbound-domains/retrieve-and-delete" target="_blank">see SparkPost API Documentation</a>
|
362
362
|
|
363
|
+
### Relay Webhooks
|
364
|
+
|
365
|
+
#### List
|
366
|
+
|
367
|
+
List all Relay Webhooks
|
368
|
+
|
369
|
+
```ruby
|
370
|
+
simple_spark.relay_webhooks.list
|
371
|
+
```
|
372
|
+
|
373
|
+
<a href="https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/list-all-relay-webhooks" target="_blank">see SparkPost API Documentation</a>
|
374
|
+
|
375
|
+
#### Create
|
376
|
+
|
377
|
+
Create a new Relay Webhook
|
378
|
+
|
379
|
+
```ruby
|
380
|
+
properties = {
|
381
|
+
name: "Replies Webhook",
|
382
|
+
target: "https://webhooks.customer.example/replies",
|
383
|
+
auth_token: "",
|
384
|
+
match: {
|
385
|
+
protocol: "SMTP",
|
386
|
+
domain: "email.example.com"
|
387
|
+
}
|
388
|
+
}
|
389
|
+
simple_spark.relay_webhooks.create(properties)
|
390
|
+
```
|
391
|
+
|
392
|
+
<a href="https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/create-a-relay-webhook" target="_blank">see SparkPost API Documentation</a>
|
393
|
+
|
394
|
+
#### Retrieve
|
395
|
+
|
396
|
+
Retrieves a Relay Webhook by its id
|
397
|
+
|
398
|
+
```ruby
|
399
|
+
simple_spark.relay_webhooks.retrieve(id)
|
400
|
+
```
|
401
|
+
|
402
|
+
<a href="https://developers.sparkpost.com/api/#/reference/relay-webhooks/retrieve-update-and-delete/retrieve-a-relay-webhook" target="_blank">see SparkPost API Documentation</a>
|
403
|
+
|
404
|
+
#### Update
|
405
|
+
|
406
|
+
Updates a Relay Webhook with new values
|
407
|
+
|
408
|
+
```ruby
|
409
|
+
properties = { name: "Replies Webhook" }
|
410
|
+
simple_spark.relay_webhooks.update(id, properties)
|
411
|
+
```
|
412
|
+
|
413
|
+
<a href="https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/update-a-relay-webhook" target="_blank">see SparkPost API Documentation</a>
|
414
|
+
|
415
|
+
#### Delete
|
416
|
+
|
417
|
+
Deletes a Relay Webhook permanently
|
418
|
+
|
419
|
+
```ruby
|
420
|
+
simple_spark.relay_webhooks.delete(id)
|
421
|
+
```
|
422
|
+
|
423
|
+
<a href="https://developers.sparkpost.com/api/#/reference/relay-webhooks/retrieve-update-and-delete/delete-a-relay-webhook" target="_blank">see SparkPost API Documentation</a>
|
424
|
+
|
363
425
|
### Templates
|
364
426
|
|
365
427
|
#### List
|
@@ -404,7 +466,7 @@ simple_spark.templates.retrieve(yourtemplateid, draft)
|
|
404
466
|
Updates a Template with new values
|
405
467
|
|
406
468
|
```ruby
|
407
|
-
properties = { "name" => "Sorry, the Winter Sale!" }
|
469
|
+
properties = { "name" => "Sorry, the Winter Sale!" }
|
408
470
|
update_published = false
|
409
471
|
simple_spark.templates.update(yourtemplateid, properties, update_published)
|
410
472
|
```
|
data/lib/simple_spark/client.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
module SimpleSpark
|
2
|
+
module Endpoints
|
3
|
+
# Provides access to the /relay-webhooks endpoint
|
4
|
+
# See: https://developers.sparkpost.com/api/#/reference/relay-webhooks
|
5
|
+
class RelayWebhooks
|
6
|
+
attr_accessor :client
|
7
|
+
|
8
|
+
def initialize(client)
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
# Lists your relay webhooks
|
13
|
+
# @return [Array] a list of Relay Webhook hash objects
|
14
|
+
# @note See: https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/list-all-relay-webhooks
|
15
|
+
def list
|
16
|
+
@client.call(:get, 'relay-webhooks')
|
17
|
+
end
|
18
|
+
|
19
|
+
# Create a relay webhook
|
20
|
+
# @param values [Hash] the values to create with
|
21
|
+
# @note See: https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/create-a-relay-webhook
|
22
|
+
# @note Example:
|
23
|
+
# properties = {
|
24
|
+
# name: "Replies Webhook",
|
25
|
+
# target: "https://webhooks.customer.example/replies",
|
26
|
+
# auth_token: "",
|
27
|
+
# match: {
|
28
|
+
# protocol: "SMTP",
|
29
|
+
# domain: "email.example.com"
|
30
|
+
# }
|
31
|
+
# }
|
32
|
+
def create(values)
|
33
|
+
@client.call(:post, 'relay-webhooks', values)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Retrieve a relay webhook
|
37
|
+
# @param webhook_id [String] the id to retrieve
|
38
|
+
# @return [Hash] an Relay Webhook hash object
|
39
|
+
# @note See: https://developers.sparkpost.com/api/#/reference/relay-webhooks/retrieve-update-and-delete/retrieve-a-relay-webhook
|
40
|
+
def retrieve(webhook_id)
|
41
|
+
@client.call(:get, "relay-webhooks/#{webhook_id}")
|
42
|
+
end
|
43
|
+
|
44
|
+
# Update a relay webhook
|
45
|
+
# @param webhook_id [String] the id to retrieve
|
46
|
+
# @param values [Hash] the values to update the relay webhook with
|
47
|
+
# @return [Hash] an Relay Webhook hash object
|
48
|
+
# @note Example:
|
49
|
+
# properties = {
|
50
|
+
# name: "New Replies Webhook",
|
51
|
+
# target: "https://webhook.customer.example/replies"
|
52
|
+
# }
|
53
|
+
# @note See: https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/update-a-relay-webhook
|
54
|
+
def update(webhook_id, values)
|
55
|
+
@client.call(:put, "relay-webhooks/#{webhook_id}", values)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Delete a relay webhook
|
59
|
+
# @param webhook_id [String] the id to retrieve
|
60
|
+
# @note See: https://developers.sparkpost.com/api/#/reference/relay-webhooks/retrieve-update-and-delete/delete-a-relay-webhook
|
61
|
+
def delete(webhook_id)
|
62
|
+
@client.call(:delete, "relay-webhooks/#{webhook_id}")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -24,8 +24,8 @@ module SimpleSpark
|
|
24
24
|
# @param domain_name [String] the domain name to create
|
25
25
|
# @param tracking_domain [String] the domain name to track this domain against
|
26
26
|
# @note See: https://developers.sparkpost.com/api/#/reference/sending-domains/create-and-list
|
27
|
-
def create(
|
28
|
-
@client.call(:post, 'sending-domains',
|
27
|
+
def create(values)
|
28
|
+
@client.call(:post, 'sending-domains', values)
|
29
29
|
end
|
30
30
|
|
31
31
|
# Retrieve a sending domain
|
@@ -59,7 +59,7 @@ module SimpleSpark
|
|
59
59
|
# @note See: https://developers.sparkpost.com/api/#/reference/sending-domains/verify
|
60
60
|
def verify(domain_name, values)
|
61
61
|
domain_name = @client.url_encode(domain_name)
|
62
|
-
@client.call(:post, "sending-domains/#{domain_name}", values)
|
62
|
+
@client.call(:post, "sending-domains/#{domain_name}/verify", values)
|
63
63
|
end
|
64
64
|
|
65
65
|
# Delete a sending domain
|
data/lib/simple_spark/version.rb
CHANGED
data/lib/simple_spark.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_spark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jak Charlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -209,6 +209,7 @@ files:
|
|
209
209
|
- lib/simple_spark/client.rb
|
210
210
|
- lib/simple_spark/endpoints/inbound_domains.rb
|
211
211
|
- lib/simple_spark/endpoints/message_events.rb
|
212
|
+
- lib/simple_spark/endpoints/relay_webhooks.rb
|
212
213
|
- lib/simple_spark/endpoints/sending_domains.rb
|
213
214
|
- lib/simple_spark/endpoints/templates.rb
|
214
215
|
- lib/simple_spark/endpoints/transmissions.rb
|
@@ -245,4 +246,3 @@ summary: A library for accessing the SparkPost REST API http://www.sparkpost.com
|
|
245
246
|
test_files:
|
246
247
|
- spec/simple_spark/client_spec.rb
|
247
248
|
- spec/spec_helper.rb
|
248
|
-
has_rdoc:
|