klaviyo-api-sdk 17.0.0 → 18.0.0

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.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +932 -414
  4. data/klaviyo-api-sdk.gemspec +1 -1
  5. data/lib/klaviyo-api-sdk/api/accounts_api.rb +12 -12
  6. data/lib/klaviyo-api-sdk/api/campaigns_api.rb +215 -155
  7. data/lib/klaviyo-api-sdk/api/catalogs_api.rb +585 -381
  8. data/lib/klaviyo-api-sdk/api/client_api.rb +100 -0
  9. data/lib/klaviyo-api-sdk/api/conversations_api.rb +3 -3
  10. data/lib/klaviyo-api-sdk/api/coupons_api.rb +187 -108
  11. data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +2755 -83
  12. data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +3 -3
  13. data/lib/klaviyo-api-sdk/api/events_api.rb +72 -58
  14. data/lib/klaviyo-api-sdk/api/flows_api.rb +238 -152
  15. data/lib/klaviyo-api-sdk/api/forms_api.rb +81 -60
  16. data/lib/klaviyo-api-sdk/api/images_api.rb +48 -27
  17. data/lib/klaviyo-api-sdk/api/lists_api.rb +113 -88
  18. data/lib/klaviyo-api-sdk/api/metrics_api.rb +184 -156
  19. data/lib/klaviyo-api-sdk/api/profiles_api.rb +445 -226
  20. data/lib/klaviyo-api-sdk/api/reporting_api.rb +76 -27
  21. data/lib/klaviyo-api-sdk/api/reviews_api.rb +38 -31
  22. data/lib/klaviyo-api-sdk/api/segments_api.rb +107 -82
  23. data/lib/klaviyo-api-sdk/api/tags_api.rb +164 -128
  24. data/lib/klaviyo-api-sdk/api/templates_api.rb +113 -60
  25. data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +24 -17
  26. data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +41 -27
  27. data/lib/klaviyo-api-sdk/api/webhooks_api.rb +73 -31
  28. data/lib/klaviyo-api-sdk/api_client.rb +1 -1
  29. data/lib/klaviyo-api-sdk/models/action_output_condition.rb +1 -1
  30. data/lib/klaviyo-api-sdk/models/action_output_condition_filter.rb +78 -195
  31. data/lib/klaviyo-api-sdk/models/action_output_split_action_data.rb +2 -6
  32. data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters.rb → action_output_split_action_data_action_output_filter.rb} +4 -4
  33. data/lib/klaviyo-api-sdk/models/{action_output_condition_condition_group.rb → action_output_split_action_data_action_output_filter_condition_groups_inner.rb} +3 -3
  34. data/lib/klaviyo-api-sdk/models/age_gate_properties.rb +11 -1
  35. data/lib/klaviyo-api-sdk/models/api_schema_property.rb +301 -0
  36. data/lib/klaviyo-api-sdk/models/back_in_stock_email_consent_checkbox_properties.rb +11 -1
  37. data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +15 -2
  38. data/lib/klaviyo-api-sdk/models/base_style_properties.rb +15 -5
  39. data/lib/klaviyo-api-sdk/models/button_action.rb +1 -0
  40. data/lib/klaviyo-api-sdk/models/button_properties.rb +11 -1
  41. data/lib/klaviyo-api-sdk/models/button_styles.rb +25 -3
  42. data/lib/klaviyo-api-sdk/models/{action_output_condition_filter2.rb → button_styles_height.rb} +3 -7
  43. data/lib/klaviyo-api-sdk/models/cart_content.rb +277 -0
  44. data/lib/klaviyo-api-sdk/models/cart_content_properties.rb +236 -0
  45. data/lib/klaviyo-api-sdk/models/checkboxes_properties.rb +11 -1
  46. data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
  47. data/lib/klaviyo-api-sdk/models/constant_property_mapping.rb +287 -0
  48. data/lib/klaviyo-api-sdk/models/{price_drop_condition_filter2.rb → constant_property_mapping_value.rb} +6 -16
  49. data/lib/klaviyo-api-sdk/models/content_experiment_action.rb +1 -1
  50. data/lib/klaviyo-api-sdk/models/{send_push_notification_action_content_experiment_action_data.rb → content_experiment_action_data.rb} +6 -5
  51. data/lib/klaviyo-api-sdk/models/{send_push_notification_action_current_experiment.rb → content_experiment_action_data_current_experiment.rb} +6 -6
  52. data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter2.rb → content_experiment_action_data_main_action.rb} +3 -16
  53. data/lib/klaviyo-api-sdk/models/countdown_timer_properties.rb +11 -1
  54. data/lib/klaviyo-api-sdk/models/coupon_properties.rb +11 -1
  55. data/lib/klaviyo-api-sdk/models/custom_css.rb +231 -0
  56. data/lib/klaviyo-api-sdk/models/custom_html.rb +292 -0
  57. data/lib/klaviyo-api-sdk/models/custom_html_properties.rb +263 -0
  58. data/lib/klaviyo-api-sdk/models/custom_object_date_trigger.rb +450 -0
  59. data/lib/klaviyo-api-sdk/models/custom_object_property_condition.rb +1 -1
  60. data/lib/klaviyo-api-sdk/models/custom_object_relationship_source.rb +328 -0
  61. data/lib/klaviyo-api-sdk/models/date_properties.rb +11 -1
  62. data/lib/klaviyo-api-sdk/models/display_options.rb +24 -4
  63. data/lib/klaviyo-api-sdk/models/dropdown_properties.rb +11 -1
  64. data/lib/klaviyo-api-sdk/models/email_properties.rb +11 -1
  65. data/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb +13 -9
  66. data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +13 -9
  67. data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object.rb +237 -0
  68. data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes.rb +292 -0
  69. data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes_source_mapping.rb +224 -0
  70. data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +15 -2
  71. data/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb +14 -1
  72. data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
  73. data/lib/klaviyo-api-sdk/models/flow_definition_triggers_inner.rb +1 -0
  74. data/lib/klaviyo-api-sdk/models/flow_email.rb +1 -1
  75. data/lib/klaviyo-api-sdk/models/flow_push_notification.rb +14 -4
  76. data/lib/klaviyo-api-sdk/models/flow_sms.rb +15 -2
  77. data/lib/klaviyo-api-sdk/models/form_create_query_resource_object_attributes.rb +2 -2
  78. data/lib/klaviyo-api-sdk/models/html_text_properties.rb +11 -1
  79. data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen.rb +305 -0
  80. data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen_properties.rb +220 -0
  81. data/lib/klaviyo-api-sdk/models/image_action.rb +1 -0
  82. data/lib/klaviyo-api-sdk/models/image_block_cropping_properties.rb +0 -35
  83. data/lib/klaviyo-api-sdk/models/image_properties.rb +11 -1
  84. data/lib/klaviyo-api-sdk/models/low_inventory_condition.rb +1 -1
  85. data/lib/klaviyo-api-sdk/models/low_inventory_trigger.rb +2 -6
  86. data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter.rb → low_inventory_trigger_trigger_filter.rb} +4 -4
  87. data/lib/klaviyo-api-sdk/models/{low_inventory_condition_condition_group.rb → low_inventory_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
  88. data/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb +2 -2
  89. data/lib/klaviyo-api-sdk/models/metric_property_condition.rb +1 -1
  90. data/lib/klaviyo-api-sdk/models/metric_property_condition_filter.rb +87 -195
  91. data/lib/klaviyo-api-sdk/models/metric_trigger.rb +2 -1
  92. data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters.rb → metric_trigger_trigger_filter.rb} +4 -4
  93. data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters_condition_groups_inner.rb → metric_trigger_trigger_filter_condition_groups_inner.rb} +4 -4
  94. data/lib/klaviyo-api-sdk/models/mobile_push_content_create.rb +18 -5
  95. data/lib/klaviyo-api-sdk/models/mobile_push_content_update.rb +18 -5
  96. data/lib/klaviyo-api-sdk/models/mobile_push_options_on_open.rb +2 -1
  97. data/lib/klaviyo-api-sdk/models/multi_branch_split_branch_branch_filter_condition_groups_inner_conditions_inner.rb +5 -0
  98. data/lib/klaviyo-api-sdk/models/object_record_bulk_delete_job_enum.rb +35 -0
  99. data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query.rb +223 -0
  100. data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object.rb +237 -0
  101. data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters_condition_groups_inner.rb → object_record_delete_job_create_query_resource_object_relationships.rb} +13 -15
  102. data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object_relationships_object_records.rb +220 -0
  103. data/lib/klaviyo-api-sdk/models/object_record_delete_job_rels_records_data_inner.rb +238 -0
  104. data/lib/klaviyo-api-sdk/models/object_record_enum.rb +35 -0
  105. data/lib/klaviyo-api-sdk/models/object_schema_create_query.rb +223 -0
  106. data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object.rb +246 -0
  107. data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_attributes.rb +322 -0
  108. data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships.rb +218 -0
  109. data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type.rb +218 -0
  110. data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type_data.rb +238 -0
  111. data/lib/klaviyo-api-sdk/models/object_schema_enum.rb +35 -0
  112. data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query.rb +223 -0
  113. data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object.rb +252 -0
  114. data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object_attributes.rb +302 -0
  115. data/lib/klaviyo-api-sdk/models/object_schema_relationship_create_meta.rb +237 -0
  116. data/lib/klaviyo-api-sdk/models/{metric_property_condition_condition_group.rb → object_schema_relationship_create_query.rb} +14 -14
  117. data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters_condition_groups_inner.rb → object_schema_relationship_create_query_data_inner.rb} +37 -15
  118. data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_meta.rb +224 -0
  119. data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query.rb +225 -0
  120. data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query_data_inner.rb +247 -0
  121. data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query.rb +223 -0
  122. data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query_data.rb +247 -0
  123. data/lib/klaviyo-api-sdk/models/object_schema_relationship_update_meta.rb +246 -0
  124. data/lib/klaviyo-api-sdk/models/object_type_create_query.rb +223 -0
  125. data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object.rb +237 -0
  126. data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes.rb +307 -0
  127. data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes_object_schema.rb +224 -0
  128. data/lib/klaviyo-api-sdk/models/object_type_enum.rb +35 -0
  129. data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +13 -4
  130. data/lib/klaviyo-api-sdk/models/open_tracking_subscription_parameters.rb +258 -0
  131. data/lib/klaviyo-api-sdk/models/open_tracking_unsubscription_parameters.rb +258 -0
  132. data/lib/klaviyo-api-sdk/models/opt_in_code_properties.rb +11 -1
  133. data/lib/klaviyo-api-sdk/models/patch_identifiers.rb +227 -0
  134. data/lib/klaviyo-api-sdk/models/phone_number_properties.rb +11 -1
  135. data/lib/klaviyo-api-sdk/models/price_drop_condition.rb +1 -1
  136. data/lib/klaviyo-api-sdk/models/price_drop_trigger.rb +2 -6
  137. data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters.rb → price_drop_trigger_trigger_filter.rb} +4 -4
  138. data/lib/klaviyo-api-sdk/models/{price_drop_condition_condition_group.rb → price_drop_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
  139. data/lib/klaviyo-api-sdk/models/profile_event_tracked_properties.rb +19 -9
  140. data/lib/klaviyo-api-sdk/models/profile_has_not_received_email_message_condition.rb +1 -1
  141. data/lib/klaviyo-api-sdk/models/{profile_has_not_received_push_message_condition_timeframe_filter.rb → profile_has_not_received_email_message_condition_timeframe_filter.rb} +1 -1
  142. data/lib/klaviyo-api-sdk/models/profile_has_not_received_push_message_condition.rb +1 -1
  143. data/lib/klaviyo-api-sdk/models/profile_has_not_received_sms_message_condition.rb +1 -1
  144. data/lib/klaviyo-api-sdk/models/profile_meta.rb +13 -4
  145. data/lib/klaviyo-api-sdk/models/profile_not_in_flow_condition.rb +1 -1
  146. data/lib/klaviyo-api-sdk/models/profile_object_schema_enum.rb +35 -0
  147. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query.rb +225 -0
  148. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query_data_inner.rb +247 -0
  149. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query.rb +225 -0
  150. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query_data_inner.rb +247 -0
  151. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query.rb +223 -0
  152. data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query_data.rb +247 -0
  153. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +2 -2
  154. data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +2 -2
  155. data/lib/klaviyo-api-sdk/models/profile_relationship_source.rb +330 -0
  156. data/lib/klaviyo-api-sdk/models/property_filter.rb +237 -0
  157. data/lib/klaviyo-api-sdk/models/property_source.rb +254 -0
  158. data/lib/klaviyo-api-sdk/models/push_action_button.rb +1 -5
  159. data/lib/klaviyo-api-sdk/models/push_action_button_definition.rb +261 -0
  160. data/lib/klaviyo-api-sdk/models/push_on_open_web_url.rb +268 -0
  161. data/lib/klaviyo-api-sdk/models/quote_style.rb +21 -1
  162. data/lib/klaviyo-api-sdk/models/radio_buttons_properties.rb +11 -1
  163. data/lib/klaviyo-api-sdk/models/redirect_properties.rb +2 -5
  164. data/lib/klaviyo-api-sdk/models/related_id_path.rb +273 -0
  165. data/lib/klaviyo-api-sdk/models/review_block_styles.rb +13 -13
  166. data/lib/klaviyo-api-sdk/models/review_properties.rb +11 -1
  167. data/lib/klaviyo-api-sdk/models/reviewer_name_style.rb +21 -1
  168. data/lib/klaviyo-api-sdk/models/row_v0_blocks_inner.rb +1 -0
  169. data/lib/klaviyo-api-sdk/models/signup_counter_properties.rb +11 -1
  170. data/lib/klaviyo-api-sdk/models/simple_property_mapping.rb +287 -0
  171. data/lib/klaviyo-api-sdk/models/simple_relationship_mapping.rb +287 -0
  172. data/lib/klaviyo-api-sdk/models/simple_relationship_mapping_source.rb +105 -0
  173. data/lib/klaviyo-api-sdk/models/sms_consent_checkbox_properties.rb +11 -1
  174. data/lib/klaviyo-api-sdk/models/sms_disclosure_link_text_style.rb +319 -0
  175. data/lib/klaviyo-api-sdk/models/sms_disclosure_properties.rb +11 -1
  176. data/lib/klaviyo-api-sdk/models/sms_disclosure_styles.rb +1 -1
  177. data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object.rb +237 -0
  178. data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes.rb +235 -0
  179. data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes_property_mappings_inner.rb +104 -0
  180. data/lib/klaviyo-api-sdk/models/source_mapping_enum.rb +35 -0
  181. data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query.rb +223 -0
  182. data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query_resource_object.rb +252 -0
  183. data/lib/klaviyo-api-sdk/models/spin_to_win_properties.rb +11 -1
  184. data/lib/klaviyo-api-sdk/models/string_phone_operator_string_array_filter.rb +1 -1
  185. data/lib/klaviyo-api-sdk/models/table_fallback_image_sub_block.rb +0 -13
  186. data/lib/klaviyo-api-sdk/models/table_image_sub_block.rb +0 -13
  187. data/lib/klaviyo-api-sdk/models/template_definition.rb +1 -0
  188. data/lib/klaviyo-api-sdk/models/text_properties.rb +11 -1
  189. data/lib/klaviyo-api-sdk/models/version.rb +39 -4
  190. data/lib/klaviyo-api-sdk/models/version_properties.rb +14 -4
  191. data/lib/klaviyo-api-sdk/models/version_styles.rb +15 -6
  192. data/lib/klaviyo-api-sdk/models/version_triggers_inner.rb +1 -0
  193. data/lib/klaviyo-api-sdk.rb +86 -23
  194. data/lib/klaviyo-api-sdk.rb.bak +87 -24
  195. metadata +88 -25
  196. data/lib/klaviyo-api-sdk/models/custom_object_property_condition_filter.rb +0 -117
  197. data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
  198. data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
  199. data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
  200. data/lib/klaviyo-api-sdk/models/metric_property_condition_filter2.rb +0 -117
  201. data/lib/klaviyo-api-sdk/models/price_drop_condition_filter.rb +0 -225
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class CheckboxesProperties
17
17
  attr_accessor :display_device
18
18
 
19
+ attr_accessor :classname
20
+
19
21
  attr_accessor :property_name
20
22
 
21
23
  attr_accessor :label
@@ -56,6 +58,7 @@ module KlaviyoAPI
56
58
  def self.attribute_map
57
59
  {
58
60
  :'display_device' => :'display_device',
61
+ :'classname' => :'classname',
59
62
  :'property_name' => :'property_name',
60
63
  :'label' => :'label',
61
64
  :'show_label' => :'show_label',
@@ -75,6 +78,7 @@ module KlaviyoAPI
75
78
  def self.openapi_types
76
79
  {
77
80
  :'display_device' => :'Array<String>',
81
+ :'classname' => :'String',
78
82
  :'property_name' => :'String',
79
83
  :'label' => :'String',
80
84
  :'show_label' => :'Boolean',
@@ -88,6 +92,7 @@ module KlaviyoAPI
88
92
  # List of attributes with nullable: true
89
93
  def self.openapi_nullable
90
94
  Set.new([
95
+ :'classname',
91
96
  :'label',
92
97
  :'required',
93
98
  :'placeholder'
@@ -115,6 +120,10 @@ module KlaviyoAPI
115
120
  end
116
121
  end
117
122
 
123
+ if attributes.key?(:'classname')
124
+ self.classname = attributes[:'classname']
125
+ end
126
+
118
127
  if attributes.key?(:'property_name')
119
128
  self.property_name = attributes[:'property_name']
120
129
  end
@@ -179,6 +188,7 @@ module KlaviyoAPI
179
188
  return true if self.equal?(o)
180
189
  self.class == o.class &&
181
190
  display_device == o.display_device &&
191
+ classname == o.classname &&
182
192
  property_name == o.property_name &&
183
193
  label == o.label &&
184
194
  show_label == o.show_label &&
@@ -197,7 +207,7 @@ module KlaviyoAPI
197
207
  # Calculates hash code according to all attributes.
198
208
  # @return [Integer] Hash code
199
209
  def hash
200
- [display_device, property_name, label, show_label, required, error_messages, options, placeholder].hash
210
+ [display_device, classname, property_name, label, show_label, required, error_messages, options, placeholder].hash
201
211
  end
202
212
 
203
213
  # Builds the object from hash
@@ -21,10 +21,15 @@ module KlaviyoAPI
21
21
  :'FlowsProfileMetricCondition',
22
22
  :'ProfileHasCustomObjectCondition',
23
23
  :'ProfileHasGroupMembershipCondition',
24
+ :'ProfileHasNotReceivedEmailMessageCondition',
25
+ :'ProfileHasNotReceivedPushMessageCondition',
26
+ :'ProfileHasNotReceivedSmsMessageCondition',
24
27
  :'ProfileMarketingConsentCondition',
25
28
  :'ProfileNoGroupMembershipCondition',
26
29
  :'ProfilePermissionsCondition',
27
30
  :'ProfilePostalCodeDistanceCondition',
31
+ :'ProfilePredictiveAnalyticsChannelAffinityPriorityCondition',
32
+ :'ProfilePredictiveAnalyticsChannelAffinityRankCondition',
28
33
  :'ProfilePredictiveAnalyticsDateCondition',
29
34
  :'ProfilePredictiveAnalyticsNumericCondition',
30
35
  :'ProfilePredictiveAnalyticsStringCondition',
@@ -0,0 +1,287 @@
1
+ =begin
2
+ #Klaviyo API
3
+
4
+ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
5
+
6
+ Contact: developers@klaviyo.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.2.1
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module KlaviyoAPI
16
+ class ConstantPropertyMapping
17
+ # Property ID. Must be a positive integer.
18
+ attr_accessor :id
19
+
20
+ # String literal for serialization
21
+ attr_accessor :type
22
+
23
+ attr_accessor :value
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'id' => :'id',
51
+ :'type' => :'type',
52
+ :'value' => :'value'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'id' => :'Integer',
65
+ :'type' => :'String',
66
+ :'value' => :'ConstantPropertyMappingValue'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ConstantPropertyMapping` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ConstantPropertyMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
93
+ end
94
+
95
+ if attributes.key?(:'type')
96
+ self.type = attributes[:'type']
97
+ end
98
+
99
+ if attributes.key?(:'value')
100
+ self.value = attributes[:'value']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ if @id.nil?
109
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
110
+ end
111
+
112
+ if @type.nil?
113
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
114
+ end
115
+
116
+ if @value.nil?
117
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ return false if @id.nil?
127
+ return false if @type.nil?
128
+ type_validator = EnumAttributeValidator.new('String', ["constant"])
129
+ return false unless type_validator.valid?(@type)
130
+ return false if @value.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] type Object to be assigned
136
+ def type=(type)
137
+ validator = EnumAttributeValidator.new('String', ["constant"])
138
+ unless validator.valid?(type)
139
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @type = type
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ id == o.id &&
150
+ type == o.type &&
151
+ value == o.value
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ def hash
163
+ [id, type, value].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def self.build_from_hash(attributes)
170
+ new.build_from_hash(attributes)
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ self.class.openapi_types.each_pair do |key, type|
180
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
181
+ self.send("#{key}=", nil)
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = KlaviyoAPI.const_get(type)
235
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end
@@ -13,26 +13,16 @@ require 'date'
13
13
  require 'time'
14
14
 
15
15
  module KlaviyoAPI
16
- module PriceDropConditionFilter2
16
+ # Constant value assigned to every record
17
+ module ConstantPropertyMappingValue
17
18
  class << self
18
19
  # List of class defined in oneOf (OpenAPI v3)
19
20
  def openapi_one_of
20
21
  [
21
- :'AnniversaryDateFilter',
22
- :'BooleanFilter',
23
- :'CalendarDateFilter',
24
- :'ExistenceOperatorExistenceFilter',
25
- :'ListContainsOperatorListContainsFilter',
26
- :'ListLengthFilter',
27
- :'NumericOperatorNumericFilter',
28
- :'NumericRangeFilter',
29
- :'RelativeAnniversaryDateFilter',
30
- :'RelativeDateOperatorBaseRelativeDateFilter',
31
- :'RelativeDateRangeFilter',
32
- :'StaticDateFilter',
33
- :'StaticDateRangeFilter',
34
- :'StringArrayOperatorStringArrayFilter',
35
- :'StringOperatorStringFilter'
22
+ :'Boolean',
23
+ :'Float',
24
+ :'Integer',
25
+ :'String'
36
26
  ]
37
27
  end
38
28
 
@@ -71,7 +71,7 @@ module KlaviyoAPI
71
71
  :'temporary_id' => :'String',
72
72
  :'type' => :'String',
73
73
  :'links' => :'Link',
74
- :'data' => :'SendPushNotificationActionContentExperimentActionData'
74
+ :'data' => :'ContentExperimentActionData'
75
75
  }
76
76
  end
77
77
 
@@ -13,7 +13,7 @@ require 'date'
13
13
  require 'time'
14
14
 
15
15
  module KlaviyoAPI
16
- class SendPushNotificationActionContentExperimentActionData
16
+ class ContentExperimentActionData
17
17
  # Flow action status.
18
18
  attr_accessor :status
19
19
 
@@ -66,8 +66,8 @@ module KlaviyoAPI
66
66
  {
67
67
  :'status' => :'String',
68
68
  :'experiment_status' => :'String',
69
- :'main_action' => :'SendPushNotificationAction',
70
- :'current_experiment' => :'SendPushNotificationActionCurrentExperiment'
69
+ :'main_action' => :'ContentExperimentActionDataMainAction',
70
+ :'current_experiment' => :'ContentExperimentActionDataCurrentExperiment'
71
71
  }
72
72
  end
73
73
 
@@ -75,6 +75,7 @@ module KlaviyoAPI
75
75
  def self.openapi_nullable
76
76
  Set.new([
77
77
  :'experiment_status',
78
+ :'current_experiment'
78
79
  ])
79
80
  end
80
81
 
@@ -82,13 +83,13 @@ module KlaviyoAPI
82
83
  # @param [Hash] attributes Model attributes in the form of hash
83
84
  def initialize(attributes = {})
84
85
  if (!attributes.is_a?(Hash))
85
- fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SendPushNotificationActionContentExperimentActionData` initialize method"
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ContentExperimentActionData` initialize method"
86
87
  end
87
88
 
88
89
  # check to see if the attribute exists and convert string to symbol for hash key
89
90
  attributes = attributes.each_with_object({}) { |(k, v), h|
90
91
  if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SendPushNotificationActionContentExperimentActionData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ContentExperimentActionData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
93
  end
93
94
  h[k.to_sym] = v
94
95
  }
@@ -13,7 +13,7 @@ require 'date'
13
13
  require 'time'
14
14
 
15
15
  module KlaviyoAPI
16
- class SendPushNotificationActionCurrentExperiment
16
+ class ContentExperimentActionDataCurrentExperiment
17
17
  # Not allowed on create.
18
18
  attr_accessor :id
19
19
 
@@ -72,7 +72,7 @@ module KlaviyoAPI
72
72
  {
73
73
  :'id' => :'String',
74
74
  :'name' => :'String',
75
- :'variations' => :'Array<SendPushNotificationAction>',
75
+ :'variations' => :'Array<ContentExperimentActionDataMainAction>',
76
76
  :'allocations' => :'Object',
77
77
  :'started' => :'Time',
78
78
  :'winner_metric' => :'String'
@@ -94,13 +94,13 @@ module KlaviyoAPI
94
94
  # @param [Hash] attributes Model attributes in the form of hash
95
95
  def initialize(attributes = {})
96
96
  if (!attributes.is_a?(Hash))
97
- fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SendPushNotificationActionCurrentExperiment` initialize method"
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ContentExperimentActionDataCurrentExperiment` initialize method"
98
98
  end
99
99
 
100
100
  # check to see if the attribute exists and convert string to symbol for hash key
101
101
  attributes = attributes.each_with_object({}) { |(k, v), h|
102
102
  if (!self.class.attribute_map.key?(k.to_sym))
103
- fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SendPushNotificationActionCurrentExperiment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ContentExperimentActionDataCurrentExperiment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
104
  end
105
105
  h[k.to_sym] = v
106
106
  }
@@ -147,7 +147,7 @@ module KlaviyoAPI
147
147
  # @return true if the model is valid
148
148
  def valid?
149
149
  return false if @variations.nil?
150
- winner_metric_validator = EnumAttributeValidator.new('String', ["open-rate"])
150
+ winner_metric_validator = EnumAttributeValidator.new('String', ["click-rate", "open-rate"])
151
151
  return false unless winner_metric_validator.valid?(@winner_metric)
152
152
  true
153
153
  end
@@ -155,7 +155,7 @@ module KlaviyoAPI
155
155
  # Custom attribute writer method checking allowed values (enum).
156
156
  # @param [Object] winner_metric Object to be assigned
157
157
  def winner_metric=(winner_metric)
158
- validator = EnumAttributeValidator.new('String', ["open-rate"])
158
+ validator = EnumAttributeValidator.new('String', ["click-rate", "open-rate"])
159
159
  unless validator.valid?(winner_metric)
160
160
  fail ArgumentError, "invalid value for \"winner_metric\", must be one of #{validator.allowable_values}."
161
161
  end
@@ -13,26 +13,13 @@ require 'date'
13
13
  require 'time'
14
14
 
15
15
  module KlaviyoAPI
16
- module LowInventoryConditionFilter2
16
+ module ContentExperimentActionDataMainAction
17
17
  class << self
18
18
  # List of class defined in oneOf (OpenAPI v3)
19
19
  def openapi_one_of
20
20
  [
21
- :'AnniversaryDateFilter',
22
- :'BooleanFilter',
23
- :'CalendarDateFilter',
24
- :'ExistenceOperatorExistenceFilter',
25
- :'ListContainsOperatorListContainsFilter',
26
- :'ListLengthFilter',
27
- :'NumericOperatorNumericFilter',
28
- :'NumericRangeFilter',
29
- :'RelativeAnniversaryDateFilter',
30
- :'RelativeDateOperatorBaseRelativeDateFilter',
31
- :'RelativeDateRangeFilter',
32
- :'StaticDateFilter',
33
- :'StaticDateRangeFilter',
34
- :'StringArrayOperatorStringArrayFilter',
35
- :'StringOperatorStringFilter'
21
+ :'SendPushNotificationAction',
22
+ :'SendWhatsAppAction'
36
23
  ]
37
24
  end
38
25
 
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class CountdownTimerProperties
17
17
  attr_accessor :display_device
18
18
 
19
+ attr_accessor :classname
20
+
19
21
  # Options for displaying a timer.
20
22
  attr_accessor :clock_face
21
23
 
@@ -50,6 +52,7 @@ module KlaviyoAPI
50
52
  def self.attribute_map
51
53
  {
52
54
  :'display_device' => :'display_device',
55
+ :'classname' => :'classname',
53
56
  :'clock_face' => :'clock_face',
54
57
  :'animation' => :'animation',
55
58
  :'configuration' => :'configuration'
@@ -65,6 +68,7 @@ module KlaviyoAPI
65
68
  def self.openapi_types
66
69
  {
67
70
  :'display_device' => :'Array<String>',
71
+ :'classname' => :'String',
68
72
  :'clock_face' => :'String',
69
73
  :'animation' => :'String',
70
74
  :'configuration' => :'CountdownTimerPropertiesConfiguration'
@@ -74,6 +78,7 @@ module KlaviyoAPI
74
78
  # List of attributes with nullable: true
75
79
  def self.openapi_nullable
76
80
  Set.new([
81
+ :'classname',
77
82
  :'animation',
78
83
  ])
79
84
  end
@@ -99,6 +104,10 @@ module KlaviyoAPI
99
104
  end
100
105
  end
101
106
 
107
+ if attributes.key?(:'classname')
108
+ self.classname = attributes[:'classname']
109
+ end
110
+
102
111
  if attributes.key?(:'clock_face')
103
112
  self.clock_face = attributes[:'clock_face']
104
113
  else
@@ -164,6 +173,7 @@ module KlaviyoAPI
164
173
  return true if self.equal?(o)
165
174
  self.class == o.class &&
166
175
  display_device == o.display_device &&
176
+ classname == o.classname &&
167
177
  clock_face == o.clock_face &&
168
178
  animation == o.animation &&
169
179
  configuration == o.configuration
@@ -178,7 +188,7 @@ module KlaviyoAPI
178
188
  # Calculates hash code according to all attributes.
179
189
  # @return [Integer] Hash code
180
190
  def hash
181
- [display_device, clock_face, animation, configuration].hash
191
+ [display_device, classname, clock_face, animation, configuration].hash
182
192
  end
183
193
 
184
194
  # Builds the object from hash
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class CouponProperties
17
17
  attr_accessor :display_device
18
18
 
19
+ attr_accessor :classname
20
+
19
21
  attr_accessor :coupon
20
22
 
21
23
  attr_accessor :success_message
@@ -46,6 +48,7 @@ module KlaviyoAPI
46
48
  def self.attribute_map
47
49
  {
48
50
  :'display_device' => :'display_device',
51
+ :'classname' => :'classname',
49
52
  :'coupon' => :'coupon',
50
53
  :'success_message' => :'success_message'
51
54
  }
@@ -60,6 +63,7 @@ module KlaviyoAPI
60
63
  def self.openapi_types
61
64
  {
62
65
  :'display_device' => :'Array<String>',
66
+ :'classname' => :'String',
63
67
  :'coupon' => :'CouponPropertiesCoupon',
64
68
  :'success_message' => :'String'
65
69
  }
@@ -68,6 +72,7 @@ module KlaviyoAPI
68
72
  # List of attributes with nullable: true
69
73
  def self.openapi_nullable
70
74
  Set.new([
75
+ :'classname',
71
76
  :'success_message'
72
77
  ])
73
78
  end
@@ -93,6 +98,10 @@ module KlaviyoAPI
93
98
  end
94
99
  end
95
100
 
101
+ if attributes.key?(:'classname')
102
+ self.classname = attributes[:'classname']
103
+ end
104
+
96
105
  if attributes.key?(:'coupon')
97
106
  self.coupon = attributes[:'coupon']
98
107
  end
@@ -126,6 +135,7 @@ module KlaviyoAPI
126
135
  return true if self.equal?(o)
127
136
  self.class == o.class &&
128
137
  display_device == o.display_device &&
138
+ classname == o.classname &&
129
139
  coupon == o.coupon &&
130
140
  success_message == o.success_message
131
141
  end
@@ -139,7 +149,7 @@ module KlaviyoAPI
139
149
  # Calculates hash code according to all attributes.
140
150
  # @return [Integer] Hash code
141
151
  def hash
142
- [display_device, coupon, success_message].hash
152
+ [display_device, classname, coupon, success_message].hash
143
153
  end
144
154
 
145
155
  # Builds the object from hash