klaviyo 2.0.2 → 2.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b799e59210fdba2f42e88c903a4194f826590309e50650cbf360016bb0fd14e
4
- data.tar.gz: df417c927034075c4894d2c186bc4f5a50ca2e26ed3e825a659adbd73f6524e6
3
+ metadata.gz: 438fe72ddfdd5e636f8026c8e0b02daf22586e58c4a2628065db088b633bb1be
4
+ data.tar.gz: c586d57114a208aa6843fa6dd218d2e2ceae454282c8b4b297a7ab122cd89dd3
5
5
  SHA512:
6
- metadata.gz: 1ef1843515b936f2fd60b91dbd3d3cdaea780b56b49379134c04211c4609ad12ad1a296225fe576418bd93f0a437d88ec212c8b3f02fc6aa5289b5e39db7d5b1
7
- data.tar.gz: e77f951331a55720f0f8f38a01d7ce51707f4cf316cd3eeeabc64739090ef1a41e5387e84b831bf703f3e19004bf35ec91d3b5e3e624bc94cec23fb4b1b6646f
6
+ metadata.gz: bce5653e39bc762647ee52f29a3c0b2d8ea672b782a5192e9ca3d3da11a41e388f67a5c11f7eb28ce7f274f691a445677ee345eb3855ba2fa422ed30407a282f
7
+ data.tar.gz: 5f831ad7a264a16b697435e1cafe6c942f7c58572bdf67041d74b3f65f398fd4ba948e0c70edbccb6d5839d16f0831553ce2868fe43b6b6fe796d9dfef2e2103
@@ -2,8 +2,8 @@ files = ['klaviyo.gemspec', '{lib}/**/**/*'].map {|f| Dir[f]}.flatten
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'klaviyo'
5
- s.version = '2.0.2'
6
- s.date = '2020-12-28'
5
+ s.version = '2.0.3'
6
+ s.date = '2021-01-11'
7
7
  s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
8
8
  s.description = 'Ruby wrapper for the Klaviyo API'
9
9
  s.authors = ['Klaviyo Team']
@@ -0,0 +1,41 @@
1
+ module Klaviyo
2
+ class Campaigns < Client
3
+ CANCEL = 'cancel'
4
+ CAMPAIGN = 'campaign'
5
+ CAMPAIGNS = 'campaigns'
6
+ SEND = 'send'
7
+
8
+ # Retrieves all the campaigns from Klaviyo account
9
+ # @return [List] of JSON formatted campaing objects
10
+ def self.get_campaigns()
11
+ v1_request(HTTP_GET, CAMPAIGNS)
12
+ end
13
+
14
+ # Retrieves the details of the list
15
+ # @param campaign_id the if of campaign
16
+ # @return [JSON] a JSON object containing information about the campaign
17
+ def self.get_campaign_details(campaign_id)
18
+ path = "#{CAMPAIGN}/#{campaign_id}"
19
+
20
+ v1_request(HTTP_GET, path)
21
+ end
22
+
23
+ # Sends the campaign immediately
24
+ # @param campaign_id [String] the id of campaign
25
+ # @return will return with HTTP ok in case of success
26
+ def self.send_campaign(campaign_id)
27
+ path = "#{CAMPAIGN}/#{campaign_id}/#{SEND}"
28
+
29
+ v1_request(HTTP_POST, path)
30
+ end
31
+
32
+ # Cancels the campaign with specified campaign_id
33
+ # @param campaign_id [String] the id of campaign
34
+ # @return [JSON] a JSON object containing the campaign details
35
+ def self.cancel_campaign(campaign_id)
36
+ path = "#{CAMPAIGN}/#{campaign_id}/#{CANCEL}"
37
+
38
+ v1_request(HTTP_POST, path)
39
+ end
40
+ end
41
+ end
@@ -8,6 +8,7 @@ require_relative 'apis/public'
8
8
  require_relative 'apis/lists'
9
9
  require_relative 'apis/metrics'
10
10
  require_relative 'apis/profiles'
11
+ require_relative 'apis/campaigns'
11
12
 
12
13
  module Klaviyo
13
14
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaviyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaviyo Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -74,6 +74,7 @@ extra_rdoc_files: []
74
74
  files:
75
75
  - klaviyo.gemspec
76
76
  - lib/klaviyo.rb
77
+ - lib/klaviyo/apis/campaigns.rb
77
78
  - lib/klaviyo/apis/lists.rb
78
79
  - lib/klaviyo/apis/metrics.rb
79
80
  - lib/klaviyo/apis/profiles.rb