klaviyo_sdk 1.0.1.20220329 → 1.0.2.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +99 -99
  4. data/docs/Campaign.md +2 -2
  5. data/docs/CampaignsApi.md +37 -37
  6. data/docs/CheckMembershipRequest.md +2 -2
  7. data/docs/DataPrivacyApi.md +5 -5
  8. data/docs/DeleteEmail.md +2 -2
  9. data/docs/DeletePerson.md +2 -2
  10. data/docs/DeletePhone.md +2 -2
  11. data/docs/DeprecatedGetListResponse.md +2 -2
  12. data/docs/DeprecatedGetListResponseData.md +2 -2
  13. data/docs/GlobalExclusionResponseData.md +2 -2
  14. data/docs/IdentifyPayload.md +2 -2
  15. data/docs/IdentifyPayloadProperties.md +2 -2
  16. data/docs/InlineObject.md +2 -2
  17. data/docs/InlineObject3.md +2 -2
  18. data/docs/InlineObject4.md +2 -2
  19. data/docs/InlineObject5.md +2 -2
  20. data/docs/ListsSegmentsApi.md +71 -71
  21. data/docs/Metric.md +2 -2
  22. data/docs/MetricExport.md +2 -2
  23. data/docs/MetricTimeline.md +2 -2
  24. data/docs/MetricTimelineData.md +2 -2
  25. data/docs/MetricsApi.md +17 -17
  26. data/docs/Person.md +2 -2
  27. data/docs/PrivacyEmail.md +2 -2
  28. data/docs/PrivacyId.md +2 -2
  29. data/docs/PrivacyPhone.md +2 -2
  30. data/docs/ProfilesApi.md +22 -22
  31. data/docs/RenderedTemplate.md +2 -2
  32. data/docs/Template.md +2 -2
  33. data/docs/TemplatesApi.md +29 -29
  34. data/docs/TrackIdentifyApi.md +13 -13
  35. data/docs/TrackPayload.md +2 -2
  36. data/docs/TrackPayloadCustomerProperties.md +2 -2
  37. data/docs/TrackPayloadProperties.md +2 -2
  38. data/klaviyo_sdk.gemspec +1 -1
  39. data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
  40. data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
  41. data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
  42. data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
  43. data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
  44. data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
  45. data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
  46. data/lib/klaviyo_sdk/api_client.rb +2 -2
  47. data/lib/klaviyo_sdk/api_error.rb +1 -1
  48. data/lib/klaviyo_sdk/configuration.rb +1 -1
  49. data/lib/klaviyo_sdk/models/campaign.rb +4 -4
  50. data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
  51. data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
  52. data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
  53. data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
  54. data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
  55. data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
  56. data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
  57. data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
  58. data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
  59. data/lib/klaviyo_sdk/models/inline_object.rb +4 -4
  60. data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
  61. data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
  62. data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
  63. data/lib/klaviyo_sdk/models/metric.rb +4 -4
  64. data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
  65. data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
  66. data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
  67. data/lib/klaviyo_sdk/models/person.rb +4 -4
  68. data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
  69. data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
  70. data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
  71. data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
  72. data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
  73. data/lib/klaviyo_sdk/models/template.rb +4 -4
  74. data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
  75. data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
  76. data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
  77. data/lib/klaviyo_sdk/version.rb +1 -1
  78. data/lib/klaviyo_sdk.rb +7 -7
  79. data/spec/api/campaigns_api_spec.rb +3 -3
  80. data/spec/api/data_privacy_api_spec.rb +3 -3
  81. data/spec/api/lists_segments_api_spec.rb +3 -3
  82. data/spec/api/metrics_api_spec.rb +3 -3
  83. data/spec/api/profiles_api_spec.rb +3 -3
  84. data/spec/api/templates_api_spec.rb +3 -3
  85. data/spec/api/track_identify_api_spec.rb +3 -3
  86. data/spec/api_client_spec.rb +29 -29
  87. data/spec/configuration_spec.rb +3 -3
  88. data/spec/models/campaign_spec.rb +4 -4
  89. data/spec/models/check_membership_request_spec.rb +4 -4
  90. data/spec/models/delete_email_spec.rb +4 -4
  91. data/spec/models/delete_person_spec.rb +4 -4
  92. data/spec/models/delete_phone_spec.rb +4 -4
  93. data/spec/models/deprecated_get_list_response_data_spec.rb +4 -4
  94. data/spec/models/deprecated_get_list_response_spec.rb +4 -4
  95. data/spec/models/global_exclusion_response_data_spec.rb +4 -4
  96. data/spec/models/identify_payload_properties_spec.rb +4 -4
  97. data/spec/models/identify_payload_spec.rb +4 -4
  98. data/spec/models/inline_object3_spec.rb +4 -4
  99. data/spec/models/inline_object4_spec.rb +4 -4
  100. data/spec/models/inline_object5_spec.rb +4 -4
  101. data/spec/models/inline_object_spec.rb +4 -4
  102. data/spec/models/metric_export_spec.rb +4 -4
  103. data/spec/models/metric_spec.rb +4 -4
  104. data/spec/models/metric_timeline_data_spec.rb +4 -4
  105. data/spec/models/metric_timeline_spec.rb +4 -4
  106. data/spec/models/person_spec.rb +4 -4
  107. data/spec/models/privacy_email_spec.rb +4 -4
  108. data/spec/models/privacy_id_spec.rb +4 -4
  109. data/spec/models/privacy_phone_spec.rb +4 -4
  110. data/spec/models/rendered_template_spec.rb +4 -4
  111. data/spec/models/template_spec.rb +4 -4
  112. data/spec/models/track_payload_customer_properties_spec.rb +4 -4
  113. data/spec/models/track_payload_properties_spec.rb +4 -4
  114. data/spec/models/track_payload_spec.rb +4 -4
  115. metadata +2 -3
  116. data/klaviyo_sdk-1.0.0.20220329.gem +0 -0
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  # The profiles that you would like to subscribe. Each object in the list must have either an email or phone number key. You can also provide additional properties as key-value pairs. If you are a GDPR compliant business, you will need to include `$consent` in your API call. `$consent` is a list-type, Klaviyo special property and only accepts some subset of the following: `[\"email\", \"web\", \"sms\", \"directmail\", \"mobile\"]`. If you are updating consent for a phone number or would like to send an opt-in SMS to the profile (for double opt-in lists), include an `sms_consent` key in the profile with a value of `true` or `false`.
18
18
  class InlineObject3
19
19
  attr_accessor :profiles
@@ -47,13 +47,13 @@ module Client
47
47
  # @param [Hash] attributes Model attributes in the form of hash
48
48
  def initialize(attributes = {})
49
49
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::InlineObject3` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::InlineObject3` initialize method"
51
51
  end
52
52
 
53
53
  # check to see if the attribute exists and convert string to symbol for hash key
54
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
55
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
57
  end
58
58
  h[k.to_sym] = v
59
59
  }
@@ -170,7 +170,7 @@ module Client
170
170
  end
171
171
  else # model
172
172
  # models (e.g. Pet) or oneOf
173
- klass = Client.const_get(type)
173
+ klass = Klaviyo.const_get(type)
174
174
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
175
  end
176
176
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  # The profiles that you would like to add to the list. Each object in the array must have an `email` or `phone_number`. You can also provide additional properties as key-value pairs.
18
18
  class InlineObject4
19
19
  attr_accessor :profiles
@@ -47,13 +47,13 @@ module Client
47
47
  # @param [Hash] attributes Model attributes in the form of hash
48
48
  def initialize(attributes = {})
49
49
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::InlineObject4` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::InlineObject4` initialize method"
51
51
  end
52
52
 
53
53
  # check to see if the attribute exists and convert string to symbol for hash key
54
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
55
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
57
  end
58
58
  h[k.to_sym] = v
59
59
  }
@@ -198,7 +198,7 @@ module Client
198
198
  end
199
199
  else # model
200
200
  # models (e.g. Pet) or oneOf
201
- klass = Client.const_get(type)
201
+ klass = Klaviyo.const_get(type)
202
202
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
203
  end
204
204
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  # The profiles that you would like to remove from the list. Example: { \"emails\":[\"george.washington@klaviyo.com\",\"abraham.lincoln@klaviyo.com\"], \"phone_numbers\":[\"+13239169023\"], \"push_tokens\":[\"03df25c845d460bcdad7802d2vf6fc1dfde97283bf75cc993eb6dca835ea2e2r\"] }
18
18
  class InlineObject5
19
19
  attr_accessor :emails
@@ -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 `Client::InlineObject5` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::InlineObject5` 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 `Client::InlineObject5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::InlineObject5`. 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
  }
@@ -232,7 +232,7 @@ module Client
232
232
  end
233
233
  else # model
234
234
  # models (e.g. Pet) or oneOf
235
- klass = Client.const_get(type)
235
+ klass = Klaviyo.const_get(type)
236
236
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
237
237
  end
238
238
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class Metric
18
18
  attr_accessor :object
19
19
 
@@ -66,13 +66,13 @@ module Client
66
66
  # @param [Hash] attributes Model attributes in the form of hash
67
67
  def initialize(attributes = {})
68
68
  if (!attributes.is_a?(Hash))
69
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::Metric` initialize method"
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::Metric` initialize method"
70
70
  end
71
71
 
72
72
  # check to see if the attribute exists and convert string to symbol for hash key
73
73
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
74
  if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::Metric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::Metric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
76
  end
77
77
  h[k.to_sym] = v
78
78
  }
@@ -209,7 +209,7 @@ module Client
209
209
  end
210
210
  else # model
211
211
  # models (e.g. Pet) or oneOf
212
- klass = Client.const_get(type)
212
+ klass = Klaviyo.const_get(type)
213
213
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
214
  end
215
215
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class MetricExport
18
18
  attr_accessor :metric
19
19
 
@@ -74,13 +74,13 @@ module Client
74
74
  # @param [Hash] attributes Model attributes in the form of hash
75
75
  def initialize(attributes = {})
76
76
  if (!attributes.is_a?(Hash))
77
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::MetricExport` initialize method"
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::MetricExport` initialize method"
78
78
  end
79
79
 
80
80
  # check to see if the attribute exists and convert string to symbol for hash key
81
81
  attributes = attributes.each_with_object({}) { |(k, v), h|
82
82
  if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::MetricExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::MetricExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
84
  end
85
85
  h[k.to_sym] = v
86
86
  }
@@ -229,7 +229,7 @@ module Client
229
229
  end
230
230
  else # model
231
231
  # models (e.g. Pet) or oneOf
232
- klass = Client.const_get(type)
232
+ klass = Klaviyo.const_get(type)
233
233
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
234
  end
235
235
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class MetricTimeline
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 `Client::MetricTimeline` initialize method"
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::MetricTimeline` 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 `Client::MetricTimeline`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::MetricTimeline`. 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
  }
@@ -215,7 +215,7 @@ module Client
215
215
  end
216
216
  else # model
217
217
  # models (e.g. Pet) or oneOf
218
- klass = Client.const_get(type)
218
+ klass = Klaviyo.const_get(type)
219
219
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
220
  end
221
221
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class MetricTimelineData
18
18
  attr_accessor :object
19
19
 
@@ -78,13 +78,13 @@ module Client
78
78
  # @param [Hash] attributes Model attributes in the form of hash
79
79
  def initialize(attributes = {})
80
80
  if (!attributes.is_a?(Hash))
81
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::MetricTimelineData` initialize method"
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::MetricTimelineData` initialize method"
82
82
  end
83
83
 
84
84
  # check to see if the attribute exists and convert string to symbol for hash key
85
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
86
86
  if (!self.class.attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::MetricTimelineData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::MetricTimelineData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
88
  end
89
89
  h[k.to_sym] = v
90
90
  }
@@ -238,7 +238,7 @@ module Client
238
238
  end
239
239
  else # model
240
240
  # models (e.g. Pet) or oneOf
241
- klass = Client.const_get(type)
241
+ klass = Klaviyo.const_get(type)
242
242
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
243
  end
244
244
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class Person
18
18
  attr_accessor :object
19
19
 
@@ -122,13 +122,13 @@ module Client
122
122
  # @param [Hash] attributes Model attributes in the form of hash
123
123
  def initialize(attributes = {})
124
124
  if (!attributes.is_a?(Hash))
125
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::Person` initialize method"
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::Person` initialize method"
126
126
  end
127
127
 
128
128
  # check to see if the attribute exists and convert string to symbol for hash key
129
129
  attributes = attributes.each_with_object({}) { |(k, v), h|
130
130
  if (!self.class.attribute_map.key?(k.to_sym))
131
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::Person`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::Person`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
132
  end
133
133
  h[k.to_sym] = v
134
134
  }
@@ -333,7 +333,7 @@ module Client
333
333
  end
334
334
  else # model
335
335
  # models (e.g. Pet) or oneOf
336
- klass = Client.const_get(type)
336
+ klass = Klaviyo.const_get(type)
337
337
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
338
338
  end
339
339
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class Person
18
18
  attr_accessor :object
19
19
 
@@ -122,13 +122,13 @@ module Client
122
122
  # @param [Hash] attributes Model attributes in the form of hash
123
123
  def initialize(attributes = {})
124
124
  if (!attributes.is_a?(Hash))
125
- fail ArgumentError, "The input argument (attributes) must be a hash in `Client::Person` initialize method"
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::Person` initialize method"
126
126
  end
127
127
 
128
128
  # check to see if the attribute exists and convert string to symbol for hash key
129
129
  attributes = attributes.each_with_object({}) { |(k, v), h|
130
130
  if (!self.class.attribute_map.key?(k.to_sym))
131
- fail ArgumentError, "`#{k}` is not a valid attribute in `Client::Person`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::Person`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
132
  end
133
133
  h[k.to_sym] = v
134
134
  }
@@ -333,7 +333,7 @@ module Client
333
333
  end
334
334
  else # model
335
335
  # models (e.g. Pet) or oneOf
336
- klass = Client.const_get(type)
336
+ klass = Klaviyo.const_get(type)
337
337
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
338
338
  end
339
339
  end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module Client
16
+ module Klaviyo
17
17
  class PrivacyEmail
18
18
  attr_accessor :email
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 `Client::PrivacyEmail` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::PrivacyEmail` 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 `Client::PrivacyEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::PrivacyEmail`. 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 = Client.const_get(type)
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 Client
16
+ module Klaviyo
17
17
  class PrivacyId
18
18
  attr_accessor :person_id
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 `Client::PrivacyId` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::PrivacyId` 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 `Client::PrivacyId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::PrivacyId`. 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 = Client.const_get(type)
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 Client
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 `Client::PrivacyPhone` initialize method"
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 `Client::PrivacyPhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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 Client
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 `Client::RenderedTemplate` initialize method"
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 `Client::RenderedTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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 Client
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 `Client::Template` initialize method"
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 `Client::Template`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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 Client
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 `Client::TrackPayload` initialize method"
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 `Client::TrackPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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 Client
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 `Client::TrackPayloadCustomerProperties` initialize method"
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 `Client::TrackPayloadCustomerProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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 Client
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 `Client::TrackPayloadProperties` initialize method"
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 `Client::TrackPayloadProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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 = Client.const_get(type)
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
@@ -10,6 +10,6 @@ OpenAPI Generator version: 5.4.0
10
10
 
11
11
  =end
12
12
 
13
- module Client
13
+ module Klaviyo
14
14
  VERSION = '1.0.0'
15
15
  end
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 Client
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
- # Client.configure do |config|
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 = Client.const_set(c[0..-4], Struct.new(*attributes))
89
- original_class = Client.const_get(c)
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
- Client::ApiError => [/400/, /503/, /504/]
106
+ Klaviyo::ApiError => [/400/, /503/, /504/]
107
107
  }
108
108
  end
109
109
  Retriable.retriable do
110
- Client.const_get(c).new.send(m, *arg)
110
+ Klaviyo.const_get(c).new.send(m, *arg)
111
111
  end
112
112
  else
113
- Client.const_get(c).new.send(m, *arg)
113
+ Klaviyo.const_get(c).new.send(m, *arg)
114
114
  end
115
115
  end
116
116
  }