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
@@ -0,0 +1,328 @@
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 CustomObjectRelationshipSource
17
+ # Data source ULID ID
18
+ attr_accessor :source_id
19
+
20
+ # String literal for serialization
21
+ attr_accessor :type
22
+
23
+ # JSONPath data selector to owning ID
24
+ attr_accessor :id_path
25
+
26
+ # JSONPath data selector to related ID
27
+ attr_accessor :related_id_path
28
+
29
+ # Strategy for updating relationships with each new RawDataRecord ingestion
30
+ attr_accessor :update_strategy
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'source_id' => :'source_id',
58
+ :'type' => :'type',
59
+ :'id_path' => :'id_path',
60
+ :'related_id_path' => :'related_id_path',
61
+ :'update_strategy' => :'update_strategy'
62
+ }
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'source_id' => :'String',
74
+ :'type' => :'String',
75
+ :'id_path' => :'String',
76
+ :'related_id_path' => :'String',
77
+ :'update_strategy' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ :'update_strategy'
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::CustomObjectRelationshipSource` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!self.class.attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::CustomObjectRelationshipSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'source_id')
104
+ self.source_id = attributes[:'source_id']
105
+ end
106
+
107
+ if attributes.key?(:'type')
108
+ self.type = attributes[:'type']
109
+ end
110
+
111
+ if attributes.key?(:'id_path')
112
+ self.id_path = attributes[:'id_path']
113
+ end
114
+
115
+ if attributes.key?(:'related_id_path')
116
+ self.related_id_path = attributes[:'related_id_path']
117
+ end
118
+
119
+ if attributes.key?(:'update_strategy')
120
+ self.update_strategy = attributes[:'update_strategy']
121
+ else
122
+ self.update_strategy = 'replace_from_origin'
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ if @source_id.nil?
131
+ invalid_properties.push('invalid value for "source_id", source_id cannot be nil.')
132
+ end
133
+
134
+ if @type.nil?
135
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
136
+ end
137
+
138
+ if @id_path.nil?
139
+ invalid_properties.push('invalid value for "id_path", id_path cannot be nil.')
140
+ end
141
+
142
+ if @related_id_path.nil?
143
+ invalid_properties.push('invalid value for "related_id_path", related_id_path cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ return false if @source_id.nil?
153
+ return false if @type.nil?
154
+ type_validator = EnumAttributeValidator.new('String', ["custom-object"])
155
+ return false unless type_validator.valid?(@type)
156
+ return false if @id_path.nil?
157
+ return false if @related_id_path.nil?
158
+ update_strategy_validator = EnumAttributeValidator.new('String', ["additive", "replace_from_origin"])
159
+ return false unless update_strategy_validator.valid?(@update_strategy)
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] type Object to be assigned
165
+ def type=(type)
166
+ validator = EnumAttributeValidator.new('String', ["custom-object"])
167
+ unless validator.valid?(type)
168
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
169
+ end
170
+ @type = type
171
+ end
172
+
173
+ # Custom attribute writer method checking allowed values (enum).
174
+ # @param [Object] update_strategy Object to be assigned
175
+ def update_strategy=(update_strategy)
176
+ validator = EnumAttributeValidator.new('String', ["additive", "replace_from_origin"])
177
+ unless validator.valid?(update_strategy)
178
+ fail ArgumentError, "invalid value for \"update_strategy\", must be one of #{validator.allowable_values}."
179
+ end
180
+ @update_strategy = update_strategy
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ source_id == o.source_id &&
189
+ type == o.type &&
190
+ id_path == o.id_path &&
191
+ related_id_path == o.related_id_path &&
192
+ update_strategy == o.update_strategy
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Integer] Hash code
203
+ def hash
204
+ [source_id, type, id_path, related_id_path, update_strategy].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def self.build_from_hash(attributes)
211
+ new.build_from_hash(attributes)
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ attributes = attributes.transform_keys(&:to_sym)
220
+ self.class.openapi_types.each_pair do |key, type|
221
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
222
+ self.send("#{key}=", nil)
223
+ elsif type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
227
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
228
+ end
229
+ elsif !attributes[self.class.attribute_map[key]].nil?
230
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
231
+ end
232
+ end
233
+
234
+ self
235
+ end
236
+
237
+ # Deserializes the data based on type
238
+ # @param string type Data type
239
+ # @param string value Value to be deserialized
240
+ # @return [Object] Deserialized data
241
+ def _deserialize(type, value)
242
+ case type.to_sym
243
+ when :Time
244
+ Time.parse(value)
245
+ when :Date
246
+ Date.parse(value)
247
+ when :String
248
+ value.to_s
249
+ when :Integer
250
+ value.to_i
251
+ when :Float
252
+ value.to_f
253
+ when :Boolean
254
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
255
+ true
256
+ else
257
+ false
258
+ end
259
+ when :Object
260
+ # generic object (usually a Hash), return directly
261
+ value
262
+ when /\AArray<(?<inner_type>.+)>\z/
263
+ inner_type = Regexp.last_match[:inner_type]
264
+ value.map { |v| _deserialize(inner_type, v) }
265
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
266
+ k_type = Regexp.last_match[:k_type]
267
+ v_type = Regexp.last_match[:v_type]
268
+ {}.tap do |hash|
269
+ value.each do |k, v|
270
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
271
+ end
272
+ end
273
+ else # model
274
+ # models (e.g. Pet) or oneOf
275
+ klass = KlaviyoAPI.const_get(type)
276
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
277
+ end
278
+ end
279
+
280
+ # Returns the string representation of the object
281
+ # @return [String] String presentation of the object
282
+ def to_s
283
+ to_hash.to_s
284
+ end
285
+
286
+ # to_body is an alias to to_hash (backward compatibility)
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_body
289
+ to_hash
290
+ end
291
+
292
+ # Returns the object in the form of hash
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_hash
295
+ hash = {}
296
+ self.class.attribute_map.each_pair do |attr, param|
297
+ value = self.send(attr)
298
+ if value.nil?
299
+ is_nullable = self.class.openapi_nullable.include?(attr)
300
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
301
+ end
302
+
303
+ hash[param] = _to_hash(value)
304
+ end
305
+ hash
306
+ end
307
+
308
+ # Outputs non-array value in the form of hash
309
+ # For object, use to_hash. Otherwise, just return the value
310
+ # @param [Object] value Any valid value
311
+ # @return [Hash] Returns the value in the form of hash
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map { |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+
326
+ end
327
+
328
+ end
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class DateProperties
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
  :'placeholder',
93
98
  :'required',
@@ -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
@@ -174,6 +183,7 @@ module KlaviyoAPI
174
183
  return true if self.equal?(o)
175
184
  self.class == o.class &&
176
185
  display_device == o.display_device &&
186
+ classname == o.classname &&
177
187
  property_name == o.property_name &&
178
188
  label == o.label &&
179
189
  show_label == o.show_label &&
@@ -192,7 +202,7 @@ module KlaviyoAPI
192
202
  # Calculates hash code according to all attributes.
193
203
  # @return [Integer] Hash code
194
204
  def hash
195
- [display_device, property_name, label, show_label, placeholder, required, error_messages, date_format].hash
205
+ [display_device, classname, property_name, label, show_label, placeholder, required, error_messages, date_format].hash
196
206
  end
197
207
 
198
208
  # Builds the object from hash
@@ -21,6 +21,10 @@ module KlaviyoAPI
21
21
 
22
22
  attr_accessor :visibility
23
23
 
24
+ attr_accessor :layout_type
25
+
26
+ attr_accessor :layout_config
27
+
24
28
  class EnumAttributeValidator
25
29
  attr_reader :datatype
26
30
  attr_reader :allowable_values
@@ -48,7 +52,9 @@ module KlaviyoAPI
48
52
  {
49
53
  :'show_on' => :'show_on',
50
54
  :'content_repeat' => :'content_repeat',
51
- :'visibility' => :'visibility'
55
+ :'visibility' => :'visibility',
56
+ :'layout_type' => :'layout_type',
57
+ :'layout_config' => :'layout_config'
52
58
  }
53
59
  end
54
60
 
@@ -62,7 +68,9 @@ module KlaviyoAPI
62
68
  {
63
69
  :'show_on' => :'String',
64
70
  :'content_repeat' => :'ContentRepeatV1',
65
- :'visibility' => :'Visibility'
71
+ :'visibility' => :'Visibility',
72
+ :'layout_type' => :'String',
73
+ :'layout_config' => :'Object'
66
74
  }
67
75
  end
68
76
 
@@ -70,6 +78,8 @@ module KlaviyoAPI
70
78
  def self.openapi_nullable
71
79
  Set.new([
72
80
  :'show_on',
81
+ :'layout_type',
82
+ :'layout_config'
73
83
  ])
74
84
  end
75
85
 
@@ -99,6 +109,14 @@ module KlaviyoAPI
99
109
  if attributes.key?(:'visibility')
100
110
  self.visibility = attributes[:'visibility']
101
111
  end
112
+
113
+ if attributes.key?(:'layout_type')
114
+ self.layout_type = attributes[:'layout_type']
115
+ end
116
+
117
+ if attributes.key?(:'layout_config')
118
+ self.layout_config = attributes[:'layout_config']
119
+ end
102
120
  end
103
121
 
104
122
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -133,7 +151,9 @@ module KlaviyoAPI
133
151
  self.class == o.class &&
134
152
  show_on == o.show_on &&
135
153
  content_repeat == o.content_repeat &&
136
- visibility == o.visibility
154
+ visibility == o.visibility &&
155
+ layout_type == o.layout_type &&
156
+ layout_config == o.layout_config
137
157
  end
138
158
 
139
159
  # @see the `==` method
@@ -145,7 +165,7 @@ module KlaviyoAPI
145
165
  # Calculates hash code according to all attributes.
146
166
  # @return [Integer] Hash code
147
167
  def hash
148
- [show_on, content_repeat, visibility].hash
168
+ [show_on, content_repeat, visibility, layout_type, layout_config].hash
149
169
  end
150
170
 
151
171
  # Builds the object from hash
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class DropdownProperties
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
@@ -16,6 +16,8 @@ module KlaviyoAPI
16
16
  class EmailProperties
17
17
  attr_accessor :display_device
18
18
 
19
+ attr_accessor :classname
20
+
19
21
  attr_accessor :label
20
22
 
21
23
  attr_accessor :show_label
@@ -54,6 +56,7 @@ module KlaviyoAPI
54
56
  def self.attribute_map
55
57
  {
56
58
  :'display_device' => :'display_device',
59
+ :'classname' => :'classname',
57
60
  :'label' => :'label',
58
61
  :'show_label' => :'show_label',
59
62
  :'placeholder' => :'placeholder',
@@ -72,6 +75,7 @@ module KlaviyoAPI
72
75
  def self.openapi_types
73
76
  {
74
77
  :'display_device' => :'Array<String>',
78
+ :'classname' => :'String',
75
79
  :'label' => :'String',
76
80
  :'show_label' => :'Boolean',
77
81
  :'placeholder' => :'String',
@@ -84,6 +88,7 @@ module KlaviyoAPI
84
88
  # List of attributes with nullable: true
85
89
  def self.openapi_nullable
86
90
  Set.new([
91
+ :'classname',
87
92
  :'label',
88
93
  :'placeholder',
89
94
  :'required',
@@ -111,6 +116,10 @@ module KlaviyoAPI
111
116
  end
112
117
  end
113
118
 
119
+ if attributes.key?(:'classname')
120
+ self.classname = attributes[:'classname']
121
+ end
122
+
114
123
  if attributes.key?(:'label')
115
124
  self.label = attributes[:'label']
116
125
  end
@@ -173,6 +182,7 @@ module KlaviyoAPI
173
182
  return true if self.equal?(o)
174
183
  self.class == o.class &&
175
184
  display_device == o.display_device &&
185
+ classname == o.classname &&
176
186
  label == o.label &&
177
187
  show_label == o.show_label &&
178
188
  placeholder == o.placeholder &&
@@ -190,7 +200,7 @@ module KlaviyoAPI
190
200
  # Calculates hash code according to all attributes.
191
201
  # @return [Integer] Hash code
192
202
  def hash
193
- [display_device, label, show_label, placeholder, required, error_messages, property_name].hash
203
+ [display_device, classname, label, show_label, placeholder, required, error_messages, property_name].hash
194
204
  end
195
205
 
196
206
  # Builds the object from hash
@@ -16,10 +16,13 @@ module KlaviyoAPI
16
16
  class EmailSubscriptionParameters
17
17
  attr_accessor :marketing
18
18
 
19
+ attr_accessor :open_tracking
20
+
19
21
  # Attribute mapping from ruby-style variable name to JSON key.
20
22
  def self.attribute_map
21
23
  {
22
- :'marketing' => :'marketing'
24
+ :'marketing' => :'marketing',
25
+ :'open_tracking' => :'open_tracking'
23
26
  }
24
27
  end
25
28
 
@@ -31,7 +34,8 @@ module KlaviyoAPI
31
34
  # Attribute type mapping.
32
35
  def self.openapi_types
33
36
  {
34
- :'marketing' => :'SubscriptionParameters'
37
+ :'marketing' => :'SubscriptionParameters',
38
+ :'open_tracking' => :'OpenTrackingSubscriptionParameters'
35
39
  }
36
40
  end
37
41
 
@@ -59,23 +63,22 @@ module KlaviyoAPI
59
63
  if attributes.key?(:'marketing')
60
64
  self.marketing = attributes[:'marketing']
61
65
  end
66
+
67
+ if attributes.key?(:'open_tracking')
68
+ self.open_tracking = attributes[:'open_tracking']
69
+ end
62
70
  end
63
71
 
64
72
  # Show invalid properties with the reasons. Usually used together with valid?
65
73
  # @return Array for valid properties with the reasons
66
74
  def list_invalid_properties
67
75
  invalid_properties = Array.new
68
- if @marketing.nil?
69
- invalid_properties.push('invalid value for "marketing", marketing cannot be nil.')
70
- end
71
-
72
76
  invalid_properties
73
77
  end
74
78
 
75
79
  # Check to see if the all the properties in the model are valid
76
80
  # @return true if the model is valid
77
81
  def valid?
78
- return false if @marketing.nil?
79
82
  true
80
83
  end
81
84
 
@@ -84,7 +87,8 @@ module KlaviyoAPI
84
87
  def ==(o)
85
88
  return true if self.equal?(o)
86
89
  self.class == o.class &&
87
- marketing == o.marketing
90
+ marketing == o.marketing &&
91
+ open_tracking == o.open_tracking
88
92
  end
89
93
 
90
94
  # @see the `==` method
@@ -96,7 +100,7 @@ module KlaviyoAPI
96
100
  # Calculates hash code according to all attributes.
97
101
  # @return [Integer] Hash code
98
102
  def hash
99
- [marketing].hash
103
+ [marketing, open_tracking].hash
100
104
  end
101
105
 
102
106
  # Builds the object from hash