klaviyo_sdk 1.0.0.20220329 → 1.0.3.20220329
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +10 -0
- data/README.md +99 -99
- data/Rakefile +10 -0
- data/docs/Campaign.md +38 -0
- data/docs/CampaignsApi.md +707 -0
- data/docs/CheckMembershipRequest.md +22 -0
- data/docs/DataPrivacyApi.md +81 -0
- data/docs/DeleteEmail.md +18 -0
- data/docs/DeletePerson.md +18 -0
- data/docs/DeletePhone.md +18 -0
- data/docs/DeprecatedGetListResponse.md +30 -0
- data/docs/DeprecatedGetListResponseData.md +28 -0
- data/docs/GlobalExclusionResponseData.md +30 -0
- data/docs/IdentifyPayload.md +20 -0
- data/docs/IdentifyPayloadProperties.md +42 -0
- data/docs/InlineObject.md +18 -0
- data/docs/InlineObject3.md +18 -0
- data/docs/InlineObject4.md +18 -0
- data/docs/InlineObject5.md +22 -0
- data/docs/ListsSegmentsApi.md +1198 -0
- data/docs/Metric.md +28 -0
- data/docs/MetricExport.md +32 -0
- data/docs/MetricTimeline.md +24 -0
- data/docs/MetricTimelineData.md +34 -0
- data/docs/MetricsApi.md +329 -0
- data/docs/Person.md +56 -0
- data/docs/PrivacyEmail.md +18 -0
- data/docs/PrivacyId.md +18 -0
- data/docs/PrivacyPhone.md +18 -0
- data/docs/ProfilesApi.md +391 -0
- data/docs/RenderedTemplate.md +24 -0
- data/docs/Template.md +30 -0
- data/docs/TemplatesApi.md +541 -0
- data/docs/TrackIdentifyApi.md +267 -0
- data/docs/TrackPayload.md +24 -0
- data/docs/TrackPayloadCustomerProperties.md +20 -0
- data/docs/TrackPayloadProperties.md +22 -0
- data/git_push.sh +57 -0
- data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
- data/klaviyo_sdk.gemspec +6 -1
- data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
- data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
- data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
- data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
- data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
- data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
- data/lib/klaviyo_sdk/api_client.rb +2 -2
- data/lib/klaviyo_sdk/api_error.rb +1 -1
- data/lib/klaviyo_sdk/configuration.rb +1 -1
- data/lib/klaviyo_sdk/models/campaign.rb +4 -4
- data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
- data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
- data/lib/klaviyo_sdk/models/metric.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
- data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
- data/lib/klaviyo_sdk/models/template.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/version.rb +1 -1
- data/lib/klaviyo_sdk.rb +7 -7
- data/spec/api/campaigns_api_spec.rb +165 -0
- data/spec/api/data_privacy_api_spec.rb +47 -0
- data/spec/api/lists_segments_api_spec.rb +239 -0
- data/spec/api/metrics_api_spec.rb +96 -0
- data/spec/api/profiles_api_spec.rb +103 -0
- data/spec/api/templates_api_spec.rb +130 -0
- data/spec/api/track_identify_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/campaign_spec.rb +94 -0
- data/spec/models/check_membership_request_spec.rb +46 -0
- data/spec/models/delete_email_spec.rb +34 -0
- data/spec/models/delete_person_spec.rb +34 -0
- data/spec/models/delete_phone_spec.rb +34 -0
- data/spec/models/deprecated_get_list_response_data_spec.rb +64 -0
- data/spec/models/deprecated_get_list_response_spec.rb +70 -0
- data/spec/models/global_exclusion_response_data_spec.rb +70 -0
- data/spec/models/identify_payload_properties_spec.rb +106 -0
- data/spec/models/identify_payload_spec.rb +40 -0
- data/spec/models/inline_object3_spec.rb +34 -0
- data/spec/models/inline_object4_spec.rb +34 -0
- data/spec/models/inline_object5_spec.rb +46 -0
- data/spec/models/inline_object_spec.rb +34 -0
- data/spec/models/metric_export_spec.rb +76 -0
- data/spec/models/metric_spec.rb +64 -0
- data/spec/models/metric_timeline_data_spec.rb +82 -0
- data/spec/models/metric_timeline_spec.rb +52 -0
- data/spec/models/person_spec.rb +148 -0
- data/spec/models/privacy_email_spec.rb +34 -0
- data/spec/models/privacy_id_spec.rb +34 -0
- data/spec/models/privacy_phone_spec.rb +34 -0
- data/spec/models/rendered_template_spec.rb +52 -0
- data/spec/models/template_spec.rb +70 -0
- data/spec/models/track_payload_customer_properties_spec.rb +40 -0
- data/spec/models/track_payload_properties_spec.rb +46 -0
- data/spec/models/track_payload_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +80 -3
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class PrivacyPhone
|
18
18
|
attr_accessor :phone_number
|
19
19
|
|
@@ -46,13 +46,13 @@ module Client
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
47
|
def initialize(attributes = {})
|
48
48
|
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::PrivacyPhone` initialize method"
|
50
50
|
end
|
51
51
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::PrivacyPhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
56
|
end
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
@@ -162,7 +162,7 @@ module Client
|
|
162
162
|
end
|
163
163
|
else # model
|
164
164
|
# models (e.g. Pet) or oneOf
|
165
|
-
klass =
|
165
|
+
klass = Klaviyo.const_get(type)
|
166
166
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
167
|
end
|
168
168
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class RenderedTemplate
|
18
18
|
attr_accessor :object
|
19
19
|
|
@@ -58,13 +58,13 @@ module Client
|
|
58
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
59
|
def initialize(attributes = {})
|
60
60
|
if (!attributes.is_a?(Hash))
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::RenderedTemplate` initialize method"
|
62
62
|
end
|
63
63
|
|
64
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
65
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
66
|
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::RenderedTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
68
|
end
|
69
69
|
h[k.to_sym] = v
|
70
70
|
}
|
@@ -191,7 +191,7 @@ module Client
|
|
191
191
|
end
|
192
192
|
else # model
|
193
193
|
# models (e.g. Pet) or oneOf
|
194
|
-
klass =
|
194
|
+
klass = Klaviyo.const_get(type)
|
195
195
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
196
196
|
end
|
197
197
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class Template
|
18
18
|
attr_accessor :object
|
19
19
|
|
@@ -70,13 +70,13 @@ module Client
|
|
70
70
|
# @param [Hash] attributes Model attributes in the form of hash
|
71
71
|
def initialize(attributes = {})
|
72
72
|
if (!attributes.is_a?(Hash))
|
73
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::Template` initialize method"
|
74
74
|
end
|
75
75
|
|
76
76
|
# check to see if the attribute exists and convert string to symbol for hash key
|
77
77
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
78
78
|
if (!self.class.attribute_map.key?(k.to_sym))
|
79
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::Template`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
80
80
|
end
|
81
81
|
h[k.to_sym] = v
|
82
82
|
}
|
@@ -216,7 +216,7 @@ module Client
|
|
216
216
|
end
|
217
217
|
else # model
|
218
218
|
# models (e.g. Pet) or oneOf
|
219
|
-
klass =
|
219
|
+
klass = Klaviyo.const_get(type)
|
220
220
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
221
221
|
end
|
222
222
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class TrackPayload
|
18
18
|
attr_accessor :token
|
19
19
|
|
@@ -59,13 +59,13 @@ module Client
|
|
59
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
60
60
|
def initialize(attributes = {})
|
61
61
|
if (!attributes.is_a?(Hash))
|
62
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::TrackPayload` initialize method"
|
63
63
|
end
|
64
64
|
|
65
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
66
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::TrackPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
69
|
end
|
70
70
|
h[k.to_sym] = v
|
71
71
|
}
|
@@ -205,7 +205,7 @@ module Client
|
|
205
205
|
end
|
206
206
|
else # model
|
207
207
|
# models (e.g. Pet) or oneOf
|
208
|
-
klass =
|
208
|
+
klass = Klaviyo.const_get(type)
|
209
209
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
210
210
|
end
|
211
211
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class TrackPayloadCustomerProperties
|
18
18
|
attr_accessor :_email
|
19
19
|
|
@@ -50,13 +50,13 @@ module Client
|
|
50
50
|
# @param [Hash] attributes Model attributes in the form of hash
|
51
51
|
def initialize(attributes = {})
|
52
52
|
if (!attributes.is_a?(Hash))
|
53
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::TrackPayloadCustomerProperties` initialize method"
|
54
54
|
end
|
55
55
|
|
56
56
|
# check to see if the attribute exists and convert string to symbol for hash key
|
57
57
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
58
|
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::TrackPayloadCustomerProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
60
|
end
|
61
61
|
h[k.to_sym] = v
|
62
62
|
}
|
@@ -171,7 +171,7 @@ module Client
|
|
171
171
|
end
|
172
172
|
else # model
|
173
173
|
# models (e.g. Pet) or oneOf
|
174
|
-
klass =
|
174
|
+
klass = Klaviyo.const_get(type)
|
175
175
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
176
|
end
|
177
177
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class TrackPayloadProperties
|
18
18
|
attr_accessor :event_id
|
19
19
|
|
@@ -55,13 +55,13 @@ module Client
|
|
55
55
|
# @param [Hash] attributes Model attributes in the form of hash
|
56
56
|
def initialize(attributes = {})
|
57
57
|
if (!attributes.is_a?(Hash))
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::TrackPayloadProperties` initialize method"
|
59
59
|
end
|
60
60
|
|
61
61
|
# check to see if the attribute exists and convert string to symbol for hash key
|
62
62
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
63
|
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::TrackPayloadProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
65
|
end
|
66
66
|
h[k.to_sym] = v
|
67
67
|
}
|
@@ -181,7 +181,7 @@ module Client
|
|
181
181
|
end
|
182
182
|
else # model
|
183
183
|
# models (e.g. Pet) or oneOf
|
184
|
-
klass =
|
184
|
+
klass = Klaviyo.const_get(type)
|
185
185
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
186
|
end
|
187
187
|
end
|
data/lib/klaviyo_sdk/version.rb
CHANGED
data/lib/klaviyo_sdk.rb
CHANGED
@@ -57,12 +57,12 @@ require 'klaviyo_sdk/api/track_identify_api'
|
|
57
57
|
# retry logic
|
58
58
|
require 'retriable'
|
59
59
|
|
60
|
-
module
|
60
|
+
module Klaviyo
|
61
61
|
@is_initialized = false
|
62
62
|
|
63
63
|
class << self
|
64
64
|
# Customize default settings for the SDK using block.
|
65
|
-
#
|
65
|
+
# Klaviyo.configure do |config|
|
66
66
|
# config.username = "xxx"
|
67
67
|
# config.password = "xxx"
|
68
68
|
# end
|
@@ -85,8 +85,8 @@ module Client
|
|
85
85
|
self.constants.each do |c|
|
86
86
|
if c[-3..-1] == "Api"
|
87
87
|
attributes = [:attr1]
|
88
|
-
wrapper_class =
|
89
|
-
original_class =
|
88
|
+
wrapper_class = Klaviyo.const_set(c[0..-4], Struct.new(*attributes))
|
89
|
+
original_class = Klaviyo.const_get(c)
|
90
90
|
|
91
91
|
# recreate methods
|
92
92
|
original_class.public_instance_methods(false).each do |m|
|
@@ -103,14 +103,14 @@ module Client
|
|
103
103
|
c.tries = max_retries
|
104
104
|
c.max_elapsed_time = max_delay
|
105
105
|
c.on = {
|
106
|
-
|
106
|
+
Klaviyo::ApiError => [/429/, /503/, /504/]
|
107
107
|
}
|
108
108
|
end
|
109
109
|
Retriable.retriable do
|
110
|
-
|
110
|
+
Klaviyo.const_get(c).new.send(m, *arg)
|
111
111
|
end
|
112
112
|
else
|
113
|
-
|
113
|
+
Klaviyo.const_get(c).new.send(m, *arg)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
}
|
@@ -0,0 +1,165 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::CampaignsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'CampaignsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::CampaignsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of CampaignsApi' do
|
30
|
+
it 'should create an instance of CampaignsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::CampaignsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for cancel_campaign
|
36
|
+
# Cancel a Campaign
|
37
|
+
# Cancels a campaign send. Marks a campaign as cancelled regardless of it's current status.
|
38
|
+
# @param campaign_id
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Campaign]
|
41
|
+
describe 'cancel_campaign test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for clone_campaign
|
48
|
+
# Clone a Campaign
|
49
|
+
# Creates a copy of a campaign. The new campaign starts as a draft.
|
50
|
+
# @param campaign_id
|
51
|
+
# @param name The name for the new campaign. All other properties of the campaign will remain the same. Note, the template for the new campaign will be cloned from the existing template so changes to the existing campaign's content will not alter the content of the new campaign.
|
52
|
+
# @param list_id The list you will send the campaign to.
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @return [Campaign]
|
55
|
+
describe 'clone_campaign test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for create_campaign
|
62
|
+
# Create New Campaign
|
63
|
+
# Creates a new campaign. The created campaign is a draft and is not automatically sent.
|
64
|
+
# @param list_id The list you will send the campaign to.
|
65
|
+
# @param template_id The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
|
66
|
+
# @param from_email The email address your email will be sent from and will be used in the `reply-to` header.
|
67
|
+
# @param from_name The name or label associated with the email address you're sending from.
|
68
|
+
# @param subject The email subject of the campaign
|
69
|
+
# @param [Hash] opts the optional parameters
|
70
|
+
# @option opts [String] :name If not specified, this will default to the subject of the campaign.
|
71
|
+
# @option opts [Boolean] :use_smart_sending If set, limits the number of emails sent to an individual within a short period. Valid values are `true` and `false`. If not specified, defaults to `true`.
|
72
|
+
# @option opts [Boolean] :add_google_analytics If specified, adds Google Analytics tracking tags to links. Valid values are `true` and `false`. If not specified, defaults to `false`.
|
73
|
+
# @return [Campaign]
|
74
|
+
describe 'create_campaign test' do
|
75
|
+
it 'should work' do
|
76
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# unit tests for get_campaign_info
|
81
|
+
# Get Campaign Info
|
82
|
+
# Returns summary information for the campaign specified.
|
83
|
+
# @param campaign_id
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @return [Campaign]
|
86
|
+
describe 'get_campaign_info test' do
|
87
|
+
it 'should work' do
|
88
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# unit tests for get_campaign_recipients
|
93
|
+
# Get Campaign Recipients
|
94
|
+
# Returns summary information about email recipients for the campaign specified that includes each recipients email, customer ID, and status.
|
95
|
+
# @param campaign_id
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Max = 25,000
|
98
|
+
# @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are `asc` or `desc`. Defaults to `asc`.
|
99
|
+
# @option opts [String] :offset For pagination, if a response to this endpoint includes a `next_offset`, use that value to get the next page of recipients.
|
100
|
+
# @return [Hash<String, Object>]
|
101
|
+
describe 'get_campaign_recipients test' do
|
102
|
+
it 'should work' do
|
103
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# unit tests for get_campaigns
|
108
|
+
# Get Campaigns
|
109
|
+
# Returns a list of all the campaigns you've created. The campaigns are returned in reverse sorted order by the time they were created.
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
112
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Max = 100
|
113
|
+
# @return [Hash<String, Object>]
|
114
|
+
describe 'get_campaigns test' do
|
115
|
+
it 'should work' do
|
116
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# unit tests for schedule_campaign
|
121
|
+
# Schedule a Campaign
|
122
|
+
# Schedules a campaign for a time in the future
|
123
|
+
# @param campaign_id
|
124
|
+
# @param send_time A timestamp of the format `%Y-%m-%d %H:%M:%S` in the UTC timezone. Ex: `2022-01-13 00:00:00`
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @return [Hash<String, Object>]
|
127
|
+
describe 'schedule_campaign test' do
|
128
|
+
it 'should work' do
|
129
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# unit tests for send_campaign
|
134
|
+
# Send a Campaign Immediately
|
135
|
+
# Queues a campaign for immediate delivery
|
136
|
+
# @param campaign_id
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @return [Hash<String, Object>]
|
139
|
+
describe 'send_campaign test' do
|
140
|
+
it 'should work' do
|
141
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# unit tests for update_campaign
|
146
|
+
# Update Campaign
|
147
|
+
# Updates details of a campaign. You can update a campaign's name, subject, from email address, from name, template or list.
|
148
|
+
# @param campaign_id
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @option opts [String] :list_id The list you will send the campaign to.
|
151
|
+
# @option opts [String] :template_id The ID of the Email Template object that will be the content of this campaign. Note the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
|
152
|
+
# @option opts [String] :from_email The email address your email will be sent from and will be used in the reply-to header.
|
153
|
+
# @option opts [String] :from_name The name or label associated with the email address you're sending from.
|
154
|
+
# @option opts [String] :subject The email subject of the campaign
|
155
|
+
# @option opts [String] :name A name for this campaign. If not specified, this will default to the subject of the campaign.
|
156
|
+
# @option opts [Boolean] :use_smart_sending If set, limits the number of emails sent to an individual within a short period. Campaigns initially default to `true`.
|
157
|
+
# @option opts [Boolean] :add_google_analytics If specified, adds Google Analytics tracking tags to links. Campaigns initially default to `false`.
|
158
|
+
# @return [Campaign]
|
159
|
+
describe 'update_campaign test' do
|
160
|
+
it 'should work' do
|
161
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::DataPrivacyApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'DataPrivacyApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::DataPrivacyApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of DataPrivacyApi' do
|
30
|
+
it 'should create an instance of DataPrivacyApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::DataPrivacyApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for request_deletion
|
36
|
+
# Request a Deletion
|
37
|
+
# Request a data privacy-compliant deletion for the person record corresponding to an email address, phone number, or person identifier. **If multiple person records exist for the provided identifier, only one of them will be deleted.** The arguments should be sent as content type application/json. Note that only **one** identifier (email, phone_number, or person_id) can be specified. In addition to your API key, you need to set exactly one of the following parameters: `email`, `phone_number`, `or person_id`, along with the associated `string` value. Examples: Email: `{\"email\":\"abraham.lincoln@klaviyo.com\"}` Phone Number: `{\"phone_number\":\"+13239169023\"}` Person ID: `{\"person_id\":\"PERSON_ID\"}`
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :body
|
40
|
+
# @return [String]
|
41
|
+
describe 'request_deletion test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|