simple_spark 1.0.7 → 1.0.8
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 +5 -5
- data/README.md +33 -0
- data/lib/simple_spark/client.rb +4 -0
- data/lib/simple_spark/endpoints/events.rb +31 -0
- data/lib/simple_spark/version.rb +1 -1
- data/lib/simple_spark.rb +1 -0
- data/spec/simple_spark/client_spec.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cbdf85242494fe095cb7ce40c9e6c2ef485c079c2ff6dd306e0446c3f5b4f7a5
|
4
|
+
data.tar.gz: 43e97d881ece27eded5f6166ed8b9cdf5c716c0d23dfff99291e39149eed41d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bce5c2d519fe46bb10aca0eabb8043a4888ab946d74c4334a987efadca0de08b1a12fa9744c435213dbed40057c4c2993d352fc8c7b9f3837afbfb458a2bc8d5
|
7
|
+
data.tar.gz: 801c0d5bfb2958a555ae45bd4de93f0941a548ae025ebe6d7b01a2214632694b6c4c1cf395c24361746b17e34a53431dd323700367e1decde23973302d43501f
|
data/README.md
CHANGED
@@ -426,6 +426,34 @@ simple_spark.message_events.search(campaign_ids: 'christmas-campaign, summer-cam
|
|
426
426
|
|
427
427
|
<a href="https://developers.sparkpost.com/api/#/reference/message-events/events-samples" target="_blank">see SparkPost API Documentation</a>
|
428
428
|
|
429
|
+
### Events
|
430
|
+
|
431
|
+
#### Samples
|
432
|
+
|
433
|
+
List an example of the event data that will be included in a response from the Events search endpoint
|
434
|
+
|
435
|
+
```ruby
|
436
|
+
simple_spark.events.samples
|
437
|
+
```
|
438
|
+
|
439
|
+
To limit to just some events
|
440
|
+
|
441
|
+
```ruby
|
442
|
+
simple_spark.events.samples('bounce')
|
443
|
+
```
|
444
|
+
|
445
|
+
<a href="https://developers.sparkpost.com/api/events/#events-get-events-samples" target="_blank">see SparkPost API Documentation</a>
|
446
|
+
|
447
|
+
#### Search
|
448
|
+
|
449
|
+
Perform a filtered search for event data. The response is sorted by descending timestamp. For full options you should consult the SparkPost API documentation
|
450
|
+
|
451
|
+
```ruby
|
452
|
+
simple_spark.events.search(campaign_ids: 'christmas-campaign, summer-campaign')
|
453
|
+
```
|
454
|
+
|
455
|
+
<a href="https://developers.sparkpost.com/api/events/#events-get-events-samples" target="_blank">see SparkPost API Documentation</a>
|
456
|
+
|
429
457
|
### Webhooks
|
430
458
|
|
431
459
|
#### List
|
@@ -807,6 +835,11 @@ simple_spark.templates.delete(yourtemplateid)
|
|
807
835
|
|
808
836
|
## Changelog
|
809
837
|
|
838
|
+
|
839
|
+
### 1.0.8
|
840
|
+
|
841
|
+
- Add Events Endpoint
|
842
|
+
|
810
843
|
### 1.0.6
|
811
844
|
|
812
845
|
- Exceptions now return SparkPost results object too
|
data/lib/simple_spark/client.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
module SimpleSpark
|
2
|
+
module Endpoints
|
3
|
+
# Provides access to the /message-events endpoint
|
4
|
+
# @note See: https://developers.sparkpost.com/api/events/
|
5
|
+
class Events
|
6
|
+
attr_accessor :client
|
7
|
+
|
8
|
+
def initialize(client)
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns sample events
|
13
|
+
# @param events [String] Event types for which to get a sample payload, use the Webhooks Events endpoint to list the
|
14
|
+
# available event types, defaults to all event types
|
15
|
+
# @return [Array] a list of sample Event hash objects
|
16
|
+
# @note See: https://developers.sparkpost.com/api/events/#events-get-events-samples
|
17
|
+
def samples(events = nil)
|
18
|
+
query_params = events.nil? ? {} : { events: events }
|
19
|
+
@client.call(method: :get, path: 'events/message/samples', query_values: query_params)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Perform a filtered search for message event data. The response is sorted by descending timestamp.
|
23
|
+
# @param params [String] Params to use in the search
|
24
|
+
# @return [Array] a list of Event hash objects
|
25
|
+
# @note https://developers.sparkpost.com/api/events/#events-get-search-for-message-events
|
26
|
+
def search(params = {})
|
27
|
+
@client.call(method: :get, path: 'events/message', query_values: params)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/simple_spark/version.rb
CHANGED
data/lib/simple_spark.rb
CHANGED
@@ -8,6 +8,7 @@ require 'simple_spark/endpoints/templates'
|
|
8
8
|
require 'simple_spark/endpoints/inbound_domains'
|
9
9
|
require 'simple_spark/endpoints/sending_domains'
|
10
10
|
require 'simple_spark/endpoints/message_events'
|
11
|
+
require 'simple_spark/endpoints/events'
|
11
12
|
require 'simple_spark/endpoints/webhooks'
|
12
13
|
require 'simple_spark/endpoints/relay_webhooks'
|
13
14
|
require 'simple_spark/endpoints/subaccounts'
|
@@ -76,6 +76,10 @@ describe SimpleSpark::Client do
|
|
76
76
|
specify { expect(client.message_events.class).to eq(SimpleSpark::Endpoints::MessageEvents) }
|
77
77
|
end
|
78
78
|
|
79
|
+
context 'events' do
|
80
|
+
specify { expect(client.events.class).to eq(SimpleSpark::Endpoints::Events) }
|
81
|
+
end
|
82
|
+
|
79
83
|
context 'relay_webhooks' do
|
80
84
|
specify { expect(client.relay_webhooks.class).to eq(SimpleSpark::Endpoints::RelayWebhooks) }
|
81
85
|
end
|
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: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jak Charlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/simple_spark.rb
|
69
69
|
- lib/simple_spark/client.rb
|
70
70
|
- lib/simple_spark/endpoints/account.rb
|
71
|
+
- lib/simple_spark/endpoints/events.rb
|
71
72
|
- lib/simple_spark/endpoints/inbound_domains.rb
|
72
73
|
- lib/simple_spark/endpoints/message_events.rb
|
73
74
|
- lib/simple_spark/endpoints/metrics.rb
|
@@ -104,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
107
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.7.7
|
108
109
|
signing_key:
|
109
110
|
specification_version: 4
|
110
111
|
summary: A library for accessing the SparkPost REST API http://www.sparkpost.com
|