klaviyo 2.0.6 → 2.0.7

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: c50780aa07007d13ffcbfd5e88692dc46122641627511be21f4988012d48d20e
4
- data.tar.gz: 453757a911094db7394000a2aa59d4a0f31a3cb6aa9196e50a749dac3e51b336
3
+ metadata.gz: fd15569462efd51dde6435c9a861cff6503687426b7df8d6b31c626f5a8cd219
4
+ data.tar.gz: 01517c8f0f9de3c2d94bfa9bb470f7031f4b92ac5e1d3c96eda17d4041459b32
5
5
  SHA512:
6
- metadata.gz: 62278b5560afe418dc8658e71646f36905cdb10c2b607b923377ea08c8ea247630fc782c6dbceda1d4fe2a88f5f332995abce6dcf90484cfbc1791516d4b6cd3
7
- data.tar.gz: 1358f2f45b1e92144f8a43f0f52a291f3ee859af3e416924e003a1b7c7a02553965d6240fecf8289eb41167c422565c8909b57344b8baed9091c6f022801183b
6
+ metadata.gz: 033abf3a29a87bdab5ab380419c3b9a37c6430c3b93a68dd87abcd88c2f69a2922f7127b525eda6282d696eaebcb50f706a551cfadf6d747ef3efbcf62ad9b23
7
+ data.tar.gz: 1cc3ddfa7eeb7fc0b09e8ce7192077c56d9d7323f4ed52cddccf16ce528f046582db3182189a9e6fdfd0d991eeb72bd94f2aa336dcb6ea66fc2fd00fec4119d6
data/klaviyo.gemspec CHANGED
@@ -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.6'
6
- s.date = '2021-04-08'
5
+ s.version = '2.0.7'
6
+ s.date = '2021-04-20'
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']
@@ -2,7 +2,7 @@ module Klaviyo
2
2
  class DataPrivacy < Client
3
3
  DATA_PRIVACY = 'data-privacy'
4
4
  DELETION_REQUEST = 'deletion-request'
5
-
5
+
6
6
  # Submits a data privacy-related deletion request
7
7
  # @param id_type [String] 'email' or 'phone_number' or 'person_id
8
8
  # @param identifier [String] value for the identifier specified
@@ -11,9 +11,9 @@ module Klaviyo
11
11
  unless ['email', 'phone_number', 'person_id'].include? id_type
12
12
  raise Klaviyo::KlaviyoError.new(INVALID_ID_TYPE_ERROR)
13
13
  end
14
- identifier = { id_type => identifier }
14
+ identifier = { id_type => identifier }
15
15
  path = "#{DATA_PRIVACY}/#{DELETION_REQUEST}"
16
- v2_request(HTTP_POST, path, identifier)
16
+ v2_request(HTTP_POST, path, **identifier)
17
17
  end
18
18
  end
19
19
  end
@@ -37,7 +37,7 @@ module Klaviyo
37
37
  name: name,
38
38
  html: html
39
39
  }
40
- v1_request(HTTP_PUT, path, params)
40
+ v1_request(HTTP_PUT, path, **params)
41
41
  end
42
42
 
43
43
  # Deletes a given template.
@@ -14,7 +14,7 @@ module Klaviyo
14
14
  body = {
15
15
  :list_name => list_name
16
16
  }
17
- v2_request(HTTP_POST, LISTS, body)
17
+ v2_request(HTTP_POST, LISTS, **body)
18
18
  end
19
19
 
20
20
  # Retrieves all the lists in the Klaviyo account
@@ -40,7 +40,7 @@ module Klaviyo
40
40
  body = {
41
41
  :list_name => list_name
42
42
  }
43
- v2_request(HTTP_PUT, path, body)
43
+ v2_request(HTTP_PUT, path, **body)
44
44
  end
45
45
 
46
46
  # Deletes a list
@@ -65,7 +65,7 @@ module Klaviyo
65
65
  :phone_numbers => phone_numbers,
66
66
  :push_tokens => push_tokens
67
67
  }
68
- v2_request(HTTP_GET, path, params)
68
+ v2_request(HTTP_GET, path, **params)
69
69
  end
70
70
 
71
71
  # Subscribe profiles to a list.
@@ -80,7 +80,7 @@ module Klaviyo
80
80
  params = {
81
81
  :profiles => profiles
82
82
  }
83
- v2_request(HTTP_POST, path, params)
83
+ v2_request(HTTP_POST, path, **params)
84
84
  end
85
85
 
86
86
  # Unsubscribe and remove profiles from a list
@@ -92,7 +92,7 @@ module Klaviyo
92
92
  params = {
93
93
  :emails => emails
94
94
  }
95
- v2_request(HTTP_DELETE, path, params)
95
+ v2_request(HTTP_DELETE, path, **params)
96
96
  end
97
97
 
98
98
  # Add profiles to a list
@@ -106,7 +106,7 @@ module Klaviyo
106
106
  params = {
107
107
  :profiles => profiles
108
108
  }
109
- v2_request(HTTP_POST, path, params)
109
+ v2_request(HTTP_POST, path, **params)
110
110
  end
111
111
 
112
112
  # Check if profiles are on a list
@@ -123,7 +123,7 @@ module Klaviyo
123
123
  :phone_numbers => phone_numbers,
124
124
  :push_tokens => push_tokens
125
125
  }
126
- v2_request(HTTP_GET, path, params)
126
+ v2_request(HTTP_GET, path, **params)
127
127
  end
128
128
 
129
129
  # Remove profiles from a list
@@ -139,7 +139,7 @@ module Klaviyo
139
139
  :phone_numbers => phone_numbers,
140
140
  :push_tokens => push_tokens
141
141
  }
142
- v2_request(HTTP_DELETE, path, params)
142
+ v2_request(HTTP_DELETE, path, **params)
143
143
  end
144
144
 
145
145
  # Get all emails, phone numbers, along with reasons for list exclusion
@@ -151,7 +151,7 @@ module Klaviyo
151
151
  params = {
152
152
  :marker => marker
153
153
  }
154
- v2_request(HTTP_GET, path, params)
154
+ v2_request(HTTP_GET, path, **params)
155
155
  end
156
156
 
157
157
  # Get all of the emails, phone numbers, and push tokens for profiles in a given list or segment
@@ -11,7 +11,7 @@ module Klaviyo
11
11
  :page => page,
12
12
  :count => count
13
13
  }
14
- v1_request(HTTP_GET, METRICS, params)
14
+ v1_request(HTTP_GET, METRICS, **params)
15
15
  end
16
16
 
17
17
  # Returns a batched timeline of all events in your Klaviyo account.
@@ -26,7 +26,7 @@ module Klaviyo
26
26
  :count => count,
27
27
  :sort => sort
28
28
  }
29
- v1_request(HTTP_GET, path, params)
29
+ v1_request(HTTP_GET, path, **params)
30
30
  end
31
31
 
32
32
  # Returns a batched timeline for one specific type of metric.
@@ -42,7 +42,7 @@ module Klaviyo
42
42
  :count => count,
43
43
  :sort => sort
44
44
  }
45
- v1_request(HTTP_GET, path, params)
45
+ v1_request(HTTP_GET, path, **params)
46
46
  end
47
47
 
48
48
  # Export event data, optionally filtering and segmented on available event properties
@@ -74,7 +74,7 @@ module Klaviyo
74
74
  :by => by,
75
75
  :count => count
76
76
  }
77
- v1_request(HTTP_GET, path, params)
77
+ v1_request(HTTP_GET, path, **params)
78
78
  end
79
79
  end
80
80
  end
@@ -12,7 +12,7 @@ module Klaviyo
12
12
  params = {
13
13
  :email => email
14
14
  }
15
- v2_request(HTTP_GET, path, params)
15
+ v2_request(HTTP_GET, path, **params)
16
16
  end
17
17
 
18
18
  # Retrieve all the data attributes for a Klaviyo Person ID.
@@ -29,7 +29,7 @@ module Klaviyo
29
29
  # @return returns the updated person object
30
30
  def self.update_person_attributes(person_id, kwargs = {})
31
31
  path = "#{PERSON}/#{person_id}"
32
- v1_request(HTTP_PUT, path, kwargs)
32
+ v1_request(HTTP_PUT, path, **kwargs)
33
33
  end
34
34
 
35
35
  # Listing a person's event timeline
@@ -45,7 +45,7 @@ module Klaviyo
45
45
  :count => count,
46
46
  :sort => sort
47
47
  }
48
- v1_request(HTTP_GET, path, params)
48
+ v1_request(HTTP_GET, path, **params)
49
49
  end
50
50
 
51
51
  # Listing a person's event timeline for a particular metric
@@ -62,7 +62,7 @@ module Klaviyo
62
62
  :count => count,
63
63
  :sort => sort
64
64
  }
65
- v1_request(HTTP_GET, path, params)
65
+ v1_request(HTTP_GET, path, **params)
66
66
  end
67
67
  end
68
68
  end
@@ -27,7 +27,7 @@ module Klaviyo
27
27
  :properties => properties
28
28
  }
29
29
 
30
- public_request(HTTP_GET, 'identify', params)
30
+ public_request(HTTP_GET, 'identify', **params)
31
31
  end
32
32
 
33
33
  # Used for tracking events and customer behaviors
@@ -55,7 +55,7 @@ module Klaviyo
55
55
  }
56
56
  data[:body] = data[:body].merge(kwargs[:params])
57
57
  full_url = "#{V1_API}/#{path}"
58
- request(method, full_url, content_type, data)
58
+ request(method, full_url, content_type, **data)
59
59
  else
60
60
  defaults = {:page => nil,
61
61
  :count => nil,
@@ -75,7 +75,7 @@ module Klaviyo
75
75
  }
76
76
  data = {}
77
77
  data[:body] = key.merge(kwargs)
78
- request(method, path, CONTENT_JSON, data)
78
+ request(method, path, CONTENT_JSON, **data)
79
79
  end
80
80
 
81
81
  def self.build_params(params)
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.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaviyo Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2021-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json