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,220 @@
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 ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecords
17
+ attr_accessor :data
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'data' => :'data'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'data' => :'Array<ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecordsDataInner>'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecords` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'data')
60
+ if (value = attributes[:'data']).is_a?(Array)
61
+ self.data = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ data == o.data
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [data].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = KlaviyoAPI.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,238 @@
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 ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecordsDataInner
17
+ attr_accessor :type
18
+
19
+ # Array of object record IDs to delete.
20
+ attr_accessor :id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'type' => :'type',
26
+ :'id' => :'id'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'type' => :'ObjectRecordEnum',
39
+ :'id' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecordsDataInner` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ObjectRecordDeleteJobCreateQueryResourceObjectRelationshipsObjectRecordsDataInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'type')
65
+ self.type = attributes[:'type']
66
+ end
67
+
68
+ if attributes.key?(:'id')
69
+ self.id = attributes[:'id']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @type.nil?
78
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
79
+ end
80
+
81
+ if @id.nil?
82
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @type.nil?
92
+ return false if @id.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ type == o.type &&
102
+ id == o.id
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [type, id].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = KlaviyoAPI.const_get(type)
186
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,35 @@
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 ObjectRecordEnum
17
+ OBJECT_RECORD = "object-record".freeze
18
+
19
+ # Builds the enum from string
20
+ # @param [String] The enum value in the form of the string
21
+ # @return [String] The enum value
22
+ def self.build_from_hash(value)
23
+ new.build_from_hash(value)
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def build_from_hash(value)
30
+ constantValues = ObjectRecordEnum.constants.select { |c| ObjectRecordEnum::const_get(c) == value }
31
+ raise "Invalid ENUM value #{value} for class #ObjectRecordEnum" if constantValues.empty?
32
+ value
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,223 @@
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 ObjectSchemaCreateQuery
17
+ attr_accessor :data
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'data' => :'data'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'data' => :'ObjectSchemaCreateQueryResourceObject'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ObjectSchemaCreateQuery` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ObjectSchemaCreateQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'data')
60
+ self.data = attributes[:'data']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ if @data.nil?
69
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
70
+ end
71
+
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return false if @data.nil?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ data == o.data
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [data].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ new.build_from_hash(attributes)
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = KlaviyoAPI.const_get(type)
171
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end