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
@@ -19,9 +19,10 @@ module KlaviyoAPI
19
19
  @api_client = api_client
20
20
  end
21
21
  # Create Webhook
22
- # Create a new Webhook<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write`
22
+ # Create a new Webhook<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_webhook.json)
23
23
  # @param webhook_create_query [WebhookCreateQuery]
24
24
  # @param [Hash] opts the optional parameters
25
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
25
26
  # @return [Hash<String, Object>]
26
27
  def create_webhook(webhook_create_query, opts = {})
27
28
  data, _status_code, _headers = create_webhook_with_http_info(webhook_create_query, opts)
@@ -29,9 +30,10 @@ module KlaviyoAPI
29
30
  end
30
31
 
31
32
  # Create Webhook
32
- # Create a new Webhook&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60;
33
+ # Create a new Webhook&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_webhook.json)
33
34
  # @param webhook_create_query [WebhookCreateQuery]
34
35
  # @param [Hash] opts the optional parameters
36
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
35
37
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
36
38
  def create_webhook_with_http_info(webhook_create_query, opts = {})
37
39
  if @api_client.config.debugging
@@ -41,16 +43,21 @@ module KlaviyoAPI
41
43
  if @api_client.config.client_side_validation && webhook_create_query.nil?
42
44
  fail ArgumentError, "Missing the required parameter 'webhook_create_query' when calling WebhooksApi.create_webhook"
43
45
  end
46
+ allowable_values = ["created_at", "description", "enabled", "endpoint_url", "id", "name", "updated_at"]
47
+ if @api_client.config.client_side_validation && opts[:'fields_webhook'] && !opts[:'fields_webhook'].all? { |item| allowable_values.include?(item) }
48
+ fail ArgumentError, "invalid value for \"fields_webhook\", must include one of #{allowable_values}"
49
+ end
44
50
  # resource path
45
51
  local_var_path = '/api/webhooks'
46
52
 
47
53
  # query parameters
48
54
  query_params = opts[:query_params] || {}
55
+ query_params[:'fields[webhook]'] = @api_client.build_collection_param(opts[:'fields_webhook'], :csv) if !opts[:'fields_webhook'].nil?
49
56
 
50
57
  # header parameters
51
58
  header_params = opts[:header_params] || {}
52
59
  # klaviyo api revision
53
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
60
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
54
61
  # HTTP header 'Accept' (if needed)
55
62
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
56
63
  # HTTP header 'Content-Type'
@@ -89,7 +96,7 @@ module KlaviyoAPI
89
96
  end
90
97
 
91
98
  # Delete Webhook
92
- # Delete a webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write`
99
+ # Delete a webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_webhook.json)
93
100
  # @param id [String] The ID of the webhook.
94
101
  # @param [Hash] opts the optional parameters
95
102
  # @return [nil]
@@ -99,7 +106,7 @@ module KlaviyoAPI
99
106
  end
100
107
 
101
108
  # Delete Webhook
102
- # Delete a webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60;
109
+ # Delete a webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_webhook.json)
103
110
  # @param id [String] The ID of the webhook.
104
111
  # @param [Hash] opts the optional parameters
105
112
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -120,7 +127,7 @@ module KlaviyoAPI
120
127
  # header parameters
121
128
  header_params = opts[:header_params] || {}
122
129
  # klaviyo api revision
123
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
130
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
124
131
  # HTTP header 'Accept' (if needed)
125
132
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
126
133
 
@@ -154,11 +161,12 @@ module KlaviyoAPI
154
161
  end
155
162
 
156
163
  # Get Webhook
157
- # Get the webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read`
164
+ # Get the webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook.json)
158
165
  # @param id [String] The ID of the webhook.
159
166
  # @param [Hash] opts the optional parameters
160
- # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
161
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
167
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
168
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
169
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
162
170
  # @return [Hash<String, Object>]
163
171
  def get_webhook(id, opts = {})
164
172
  data, _status_code, _headers = get_webhook_with_http_info(id, opts)
@@ -166,11 +174,12 @@ module KlaviyoAPI
166
174
  end
167
175
 
168
176
  # Get Webhook
169
- # Get the webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60;
177
+ # Get the webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook.json)
170
178
  # @param id [String] The ID of the webhook.
171
179
  # @param [Hash] opts the optional parameters
172
- # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
173
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
180
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
181
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
182
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
174
183
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
175
184
  def get_webhook_with_http_info(id, opts = {})
176
185
  if @api_client.config.debugging
@@ -180,7 +189,11 @@ module KlaviyoAPI
180
189
  if @api_client.config.client_side_validation && id.nil?
181
190
  fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook"
182
191
  end
183
- allowable_values = ["created_at", "description", "enabled", "endpoint_url", "name", "updated_at"]
192
+ allowable_values = ["id"]
193
+ if @api_client.config.client_side_validation && opts[:'fields_webhook_topic'] && !opts[:'fields_webhook_topic'].all? { |item| allowable_values.include?(item) }
194
+ fail ArgumentError, "invalid value for \"fields_webhook_topic\", must include one of #{allowable_values}"
195
+ end
196
+ allowable_values = ["created_at", "description", "enabled", "endpoint_url", "id", "name", "updated_at"]
184
197
  if @api_client.config.client_side_validation && opts[:'fields_webhook'] && !opts[:'fields_webhook'].all? { |item| allowable_values.include?(item) }
185
198
  fail ArgumentError, "invalid value for \"fields_webhook\", must include one of #{allowable_values}"
186
199
  end
@@ -193,13 +206,14 @@ module KlaviyoAPI
193
206
 
194
207
  # query parameters
195
208
  query_params = opts[:query_params] || {}
209
+ query_params[:'fields[webhook-topic]'] = @api_client.build_collection_param(opts[:'fields_webhook_topic'], :csv) if !opts[:'fields_webhook_topic'].nil?
196
210
  query_params[:'fields[webhook]'] = @api_client.build_collection_param(opts[:'fields_webhook'], :csv) if !opts[:'fields_webhook'].nil?
197
211
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
198
212
 
199
213
  # header parameters
200
214
  header_params = opts[:header_params] || {}
201
215
  # klaviyo api revision
202
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
216
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
203
217
  # HTTP header 'Accept' (if needed)
204
218
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
205
219
 
@@ -233,9 +247,10 @@ module KlaviyoAPI
233
247
  end
234
248
 
235
249
  # Get Webhook Topic
236
- # Get the webhook topic with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read`
250
+ # Get the webhook topic with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook_topic.json)
237
251
  # @param id [String] The ID of the webhook topic.
238
252
  # @param [Hash] opts the optional parameters
253
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
239
254
  # @return [Hash<String, Object>]
240
255
  def get_webhook_topic(id, opts = {})
241
256
  data, _status_code, _headers = get_webhook_topic_with_http_info(id, opts)
@@ -243,9 +258,10 @@ module KlaviyoAPI
243
258
  end
244
259
 
245
260
  # Get Webhook Topic
246
- # Get the webhook topic with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60;
261
+ # Get the webhook topic with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook_topic.json)
247
262
  # @param id [String] The ID of the webhook topic.
248
263
  # @param [Hash] opts the optional parameters
264
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
249
265
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
250
266
  def get_webhook_topic_with_http_info(id, opts = {})
251
267
  if @api_client.config.debugging
@@ -255,16 +271,21 @@ module KlaviyoAPI
255
271
  if @api_client.config.client_side_validation && id.nil?
256
272
  fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook_topic"
257
273
  end
274
+ allowable_values = ["id"]
275
+ if @api_client.config.client_side_validation && opts[:'fields_webhook_topic'] && !opts[:'fields_webhook_topic'].all? { |item| allowable_values.include?(item) }
276
+ fail ArgumentError, "invalid value for \"fields_webhook_topic\", must include one of #{allowable_values}"
277
+ end
258
278
  # resource path
259
279
  local_var_path = '/api/webhook-topics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
260
280
 
261
281
  # query parameters
262
282
  query_params = opts[:query_params] || {}
283
+ query_params[:'fields[webhook-topic]'] = @api_client.build_collection_param(opts[:'fields_webhook_topic'], :csv) if !opts[:'fields_webhook_topic'].nil?
263
284
 
264
285
  # header parameters
265
286
  header_params = opts[:header_params] || {}
266
287
  # klaviyo api revision
267
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
288
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
268
289
  # HTTP header 'Accept' (if needed)
269
290
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
270
291
 
@@ -298,8 +319,9 @@ module KlaviyoAPI
298
319
  end
299
320
 
300
321
  # Get Webhook Topics
301
- # Get all webhook topics in a Klaviyo account.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read`
322
+ # Get all webhook topics in a Klaviyo account.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook_topics.json)
302
323
  # @param [Hash] opts the optional parameters
324
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
303
325
  # @return [Hash<String, Object>]
304
326
  def get_webhook_topics(opts = {})
305
327
  data, _status_code, _headers = get_webhook_topics_with_http_info(opts)
@@ -307,23 +329,29 @@ module KlaviyoAPI
307
329
  end
308
330
 
309
331
  # Get Webhook Topics
310
- # Get all webhook topics in a Klaviyo account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60;
332
+ # Get all webhook topics in a Klaviyo account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhook_topics.json)
311
333
  # @param [Hash] opts the optional parameters
334
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
312
335
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
313
336
  def get_webhook_topics_with_http_info(opts = {})
314
337
  if @api_client.config.debugging
315
338
  @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_topics ...'
316
339
  end
340
+ allowable_values = ["id"]
341
+ if @api_client.config.client_side_validation && opts[:'fields_webhook_topic'] && !opts[:'fields_webhook_topic'].all? { |item| allowable_values.include?(item) }
342
+ fail ArgumentError, "invalid value for \"fields_webhook_topic\", must include one of #{allowable_values}"
343
+ end
317
344
  # resource path
318
345
  local_var_path = '/api/webhook-topics'
319
346
 
320
347
  # query parameters
321
348
  query_params = opts[:query_params] || {}
349
+ query_params[:'fields[webhook-topic]'] = @api_client.build_collection_param(opts[:'fields_webhook_topic'], :csv) if !opts[:'fields_webhook_topic'].nil?
322
350
 
323
351
  # header parameters
324
352
  header_params = opts[:header_params] || {}
325
353
  # klaviyo api revision
326
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
354
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
327
355
  # HTTP header 'Accept' (if needed)
328
356
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
329
357
 
@@ -357,10 +385,11 @@ module KlaviyoAPI
357
385
  end
358
386
 
359
387
  # Get Webhooks
360
- # Get all webhooks in an account.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read`
388
+ # Get all webhooks in an account.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhooks.json)
361
389
  # @param [Hash] opts the optional parameters
362
- # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
363
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
390
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
391
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
392
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
364
393
  # @return [Hash<String, Object>]
365
394
  def get_webhooks(opts = {})
366
395
  data, _status_code, _headers = get_webhooks_with_http_info(opts)
@@ -368,16 +397,21 @@ module KlaviyoAPI
368
397
  end
369
398
 
370
399
  # Get Webhooks
371
- # Get all webhooks in an account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60;
400
+ # Get all webhooks in an account.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:read&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_webhooks.json)
372
401
  # @param [Hash] opts the optional parameters
373
- # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
374
- # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
402
+ # @option opts [Array<String>] :fields_webhook_topic For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
403
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
404
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
375
405
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
376
406
  def get_webhooks_with_http_info(opts = {})
377
407
  if @api_client.config.debugging
378
408
  @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhooks ...'
379
409
  end
380
- allowable_values = ["created_at", "description", "enabled", "endpoint_url", "name", "updated_at"]
410
+ allowable_values = ["id"]
411
+ if @api_client.config.client_side_validation && opts[:'fields_webhook_topic'] && !opts[:'fields_webhook_topic'].all? { |item| allowable_values.include?(item) }
412
+ fail ArgumentError, "invalid value for \"fields_webhook_topic\", must include one of #{allowable_values}"
413
+ end
414
+ allowable_values = ["created_at", "description", "enabled", "endpoint_url", "id", "name", "updated_at"]
381
415
  if @api_client.config.client_side_validation && opts[:'fields_webhook'] && !opts[:'fields_webhook'].all? { |item| allowable_values.include?(item) }
382
416
  fail ArgumentError, "invalid value for \"fields_webhook\", must include one of #{allowable_values}"
383
417
  end
@@ -390,13 +424,14 @@ module KlaviyoAPI
390
424
 
391
425
  # query parameters
392
426
  query_params = opts[:query_params] || {}
427
+ query_params[:'fields[webhook-topic]'] = @api_client.build_collection_param(opts[:'fields_webhook_topic'], :csv) if !opts[:'fields_webhook_topic'].nil?
393
428
  query_params[:'fields[webhook]'] = @api_client.build_collection_param(opts[:'fields_webhook'], :csv) if !opts[:'fields_webhook'].nil?
394
429
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
395
430
 
396
431
  # header parameters
397
432
  header_params = opts[:header_params] || {}
398
433
  # klaviyo api revision
399
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
434
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
400
435
  # HTTP header 'Accept' (if needed)
401
436
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
402
437
 
@@ -430,10 +465,11 @@ module KlaviyoAPI
430
465
  end
431
466
 
432
467
  # Update Webhook
433
- # Update the webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write`
468
+ # Update the webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_webhook.json)
434
469
  # @param id [String] The ID of the webhook.
435
470
  # @param webhook_partial_update_query [WebhookPartialUpdateQuery]
436
471
  # @param [Hash] opts the optional parameters
472
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
437
473
  # @return [Hash<String, Object>]
438
474
  def update_webhook(id, webhook_partial_update_query, opts = {})
439
475
  data, _status_code, _headers = update_webhook_with_http_info(id, webhook_partial_update_query, opts)
@@ -441,10 +477,11 @@ module KlaviyoAPI
441
477
  end
442
478
 
443
479
  # Update Webhook
444
- # Update the webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60;
480
+ # Update the webhook with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;webhooks:write&#x60; [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_webhook.json)
445
481
  # @param id [String] The ID of the webhook.
446
482
  # @param webhook_partial_update_query [WebhookPartialUpdateQuery]
447
483
  # @param [Hash] opts the optional parameters
484
+ # @option opts [Array<String>] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
448
485
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
449
486
  def update_webhook_with_http_info(id, webhook_partial_update_query, opts = {})
450
487
  if @api_client.config.debugging
@@ -458,16 +495,21 @@ module KlaviyoAPI
458
495
  if @api_client.config.client_side_validation && webhook_partial_update_query.nil?
459
496
  fail ArgumentError, "Missing the required parameter 'webhook_partial_update_query' when calling WebhooksApi.update_webhook"
460
497
  end
498
+ allowable_values = ["created_at", "description", "enabled", "endpoint_url", "id", "name", "updated_at"]
499
+ if @api_client.config.client_side_validation && opts[:'fields_webhook'] && !opts[:'fields_webhook'].all? { |item| allowable_values.include?(item) }
500
+ fail ArgumentError, "invalid value for \"fields_webhook\", must include one of #{allowable_values}"
501
+ end
461
502
  # resource path
462
503
  local_var_path = '/api/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
463
504
 
464
505
  # query parameters
465
506
  query_params = opts[:query_params] || {}
507
+ query_params[:'fields[webhook]'] = @api_client.build_collection_param(opts[:'fields_webhook'], :csv) if !opts[:'fields_webhook'].nil?
466
508
 
467
509
  # header parameters
468
510
  header_params = opts[:header_params] || {}
469
511
  # klaviyo api revision
470
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-04-15"
512
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
471
513
  # HTTP header 'Accept' (if needed)
472
514
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
473
515
  # HTTP header 'Content-Type'
@@ -31,7 +31,7 @@ module KlaviyoAPI
31
31
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
32
  def initialize(config = Configuration.default)
33
33
  @config = config
34
- @user_agent = "klaviyo-api-ruby/17.0.0"
34
+ @user_agent = "klaviyo-api-ruby/18.0.0"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -65,7 +65,7 @@ module KlaviyoAPI
65
65
  :'type' => :'String',
66
66
  :'output_config_id' => :'Integer',
67
67
  :'field' => :'String',
68
- :'filter' => :'ActionOutputConditionFilter2'
68
+ :'filter' => :'ActionOutputConditionFilter'
69
69
  }
70
70
  end
71
71
 
@@ -13,213 +13,96 @@ require 'date'
13
13
  require 'time'
14
14
 
15
15
  module KlaviyoAPI
16
- class ActionOutputConditionFilter
17
- attr_accessor :condition_groups
18
-
19
- # Attribute mapping from ruby-style variable name to JSON key.
20
- def self.attribute_map
21
- {
22
- :'condition_groups' => :'condition_groups'
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
- :'condition_groups' => :'Array<ActionOutputConditionConditionGroup>'
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::ActionOutputConditionFilter` initialize method"
16
+ module ActionOutputConditionFilter
17
+ class << self
18
+ # List of class defined in oneOf (OpenAPI v3)
19
+ def openapi_one_of
20
+ [
21
+ :'BooleanFilter',
22
+ :'ExistenceOperatorExistenceFilter',
23
+ :'NumericOperatorNumericFilter',
24
+ :'NumericRangeFilter',
25
+ :'StringArrayOperatorStringArrayFilter',
26
+ :'StringOperatorStringFilter'
27
+ ]
49
28
  end
50
29
 
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::ActionOutputConditionFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
30
+ # Builds the object
31
+ # @param [Mixed] Data to be matched against the list of oneOf items
32
+ # @return [Object] Returns the model or the data itself
33
+ def build(data)
34
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
35
+ # Note:
36
+ # - We do not attempt to check whether exactly one item matches.
37
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
38
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
39
+ # - TODO: scalar values are de facto behaving as if they were nullable.
40
+ # - TODO: logging when debugging is set.
41
+ openapi_one_of.each do |klass|
42
+ begin
43
+ next if klass == :AnyType # "nullable: true"
44
+ typed_data = find_and_cast_into_type(klass, data)
45
+ return typed_data if typed_data
46
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
47
+ end
55
48
  end
56
- h[k.to_sym] = v
57
- }
58
49
 
59
- if attributes.key?(:'condition_groups')
60
- if (value = attributes[:'condition_groups']).is_a?(Array)
61
- self.condition_groups = value
62
- end
50
+ openapi_one_of.include?(:AnyType) ? data : nil
63
51
  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
- if @condition_groups.nil?
71
- invalid_properties.push('invalid value for "condition_groups", condition_groups cannot be nil.')
72
- end
73
-
74
- invalid_properties
75
- end
76
-
77
- # Check to see if the all the properties in the model are valid
78
- # @return true if the model is valid
79
- def valid?
80
- return false if @condition_groups.nil?
81
- true
82
- end
83
-
84
- # Checks equality by comparing each attribute.
85
- # @param [Object] Object to be compared
86
- def ==(o)
87
- return true if self.equal?(o)
88
- self.class == o.class &&
89
- condition_groups == o.condition_groups
90
- end
91
-
92
- # @see the `==` method
93
- # @param [Object] Object to be compared
94
- def eql?(o)
95
- self == o
96
- end
97
-
98
- # Calculates hash code according to all attributes.
99
- # @return [Integer] Hash code
100
- def hash
101
- [condition_groups].hash
102
- end
103
-
104
- # Builds the object from hash
105
- # @param [Hash] attributes Model attributes in the form of hash
106
- # @return [Object] Returns the model itself
107
- def self.build_from_hash(attributes)
108
- new.build_from_hash(attributes)
109
- end
110
52
 
111
- # Builds the object from hash
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- # @return [Object] Returns the model itself
114
- def build_from_hash(attributes)
115
- return nil unless attributes.is_a?(Hash)
116
- attributes = attributes.transform_keys(&:to_sym)
117
- self.class.openapi_types.each_pair do |key, type|
118
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
119
- self.send("#{key}=", nil)
120
- elsif type =~ /\AArray<(.*)>/i
121
- # check to ensure the input is an array given that the attribute
122
- # is documented as an array but the input is not
123
- if attributes[self.class.attribute_map[key]].is_a?(Array)
124
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
53
+ private
54
+
55
+ SchemaMismatchError = Class.new(StandardError)
56
+
57
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
58
+ def find_and_cast_into_type(klass, data)
59
+ return if data.nil?
60
+
61
+ case klass.to_s
62
+ when 'Boolean'
63
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
64
+ when 'Float'
65
+ return data if data.instance_of?(Float)
66
+ when 'Integer'
67
+ return data if data.instance_of?(Integer)
68
+ when 'Time'
69
+ return Time.parse(data)
70
+ when 'Date'
71
+ return Date.parse(data)
72
+ when 'String'
73
+ return data if data.instance_of?(String)
74
+ when 'Object' # "type: object"
75
+ return data if data.instance_of?(Hash)
76
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
77
+ if data.instance_of?(Array)
78
+ sub_type = Regexp.last_match[:sub_type]
79
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
125
80
  end
126
- elsif !attributes[self.class.attribute_map[key]].nil?
127
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
- end
129
- end
130
-
131
- self
132
- end
133
-
134
- # Deserializes the data based on type
135
- # @param string type Data type
136
- # @param string value Value to be deserialized
137
- # @return [Object] Deserialized data
138
- def _deserialize(type, value)
139
- case type.to_sym
140
- when :Time
141
- Time.parse(value)
142
- when :Date
143
- Date.parse(value)
144
- when :String
145
- value.to_s
146
- when :Integer
147
- value.to_i
148
- when :Float
149
- value.to_f
150
- when :Boolean
151
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
- true
153
- else
154
- false
155
- end
156
- when :Object
157
- # generic object (usually a Hash), return directly
158
- value
159
- when /\AArray<(?<inner_type>.+)>\z/
160
- inner_type = Regexp.last_match[:inner_type]
161
- value.map { |v| _deserialize(inner_type, v) }
162
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
- k_type = Regexp.last_match[:k_type]
164
- v_type = Regexp.last_match[:v_type]
165
- {}.tap do |hash|
166
- value.each do |k, v|
167
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
81
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
82
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
83
+ sub_type = Regexp.last_match[:sub_type]
84
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
85
+ end
86
+ else # model
87
+ const = KlaviyoAPI.const_get(klass)
88
+ if const
89
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
90
+ model = const.build(data)
91
+ return model if model
92
+ else
93
+ # raise if data contains keys that are not known to the model
94
+ raise unless (data.keys - const.acceptable_attributes).empty?
95
+ model = const.build_from_hash(data)
96
+ return model if model && model.valid?
97
+ end
168
98
  end
169
- end
170
- else # model
171
- # models (e.g. Pet) or oneOf
172
- klass = KlaviyoAPI.const_get(type)
173
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
- end
175
- end
176
-
177
- # Returns the string representation of the object
178
- # @return [String] String presentation of the object
179
- def to_s
180
- to_hash.to_s
181
- end
182
-
183
- # to_body is an alias to to_hash (backward compatibility)
184
- # @return [Hash] Returns the object in the form of hash
185
- def to_body
186
- to_hash
187
- end
188
-
189
- # Returns the object in the form of hash
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_hash
192
- hash = {}
193
- self.class.attribute_map.each_pair do |attr, param|
194
- value = self.send(attr)
195
- if value.nil?
196
- is_nullable = self.class.openapi_nullable.include?(attr)
197
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
99
  end
199
100
 
200
- hash[param] = _to_hash(value)
101
+ raise # if no match by now, raise
102
+ rescue
103
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
201
104
  end
202
- hash
203
105
  end
204
-
205
- # Outputs non-array value in the form of hash
206
- # For object, use to_hash. Otherwise, just return the value
207
- # @param [Object] value Any valid value
208
- # @return [Hash] Returns the value in the form of hash
209
- def _to_hash(value)
210
- if value.is_a?(Array)
211
- value.compact.map { |v| _to_hash(v) }
212
- elsif value.is_a?(Hash)
213
- {}.tap do |hash|
214
- value.each { |k, v| hash[k] = _to_hash(v) }
215
- end
216
- elsif value.respond_to? :to_hash
217
- value.to_hash
218
- else
219
- value
220
- end
221
- end
222
-
223
106
  end
224
107
 
225
108
  end