klaviyo-api-sdk 10.0.0 → 11.1.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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +382 -136
  4. data/klaviyo-api-sdk.gemspec +1 -1
  5. data/lib/klaviyo-api-sdk/api/accounts_api.rb +2 -2
  6. data/lib/klaviyo-api-sdk/api/campaigns_api.rb +41 -23
  7. data/lib/klaviyo-api-sdk/api/catalogs_api.rb +82 -76
  8. data/lib/klaviyo-api-sdk/api/coupons_api.rb +111 -93
  9. data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +1 -1
  10. data/lib/klaviyo-api-sdk/api/events_api.rb +128 -116
  11. data/lib/klaviyo-api-sdk/api/flows_api.rb +199 -169
  12. data/lib/klaviyo-api-sdk/api/forms_api.rb +19 -7
  13. data/lib/klaviyo-api-sdk/api/images_api.rb +5 -5
  14. data/lib/klaviyo-api-sdk/api/lists_api.rb +391 -337
  15. data/lib/klaviyo-api-sdk/api/metrics_api.rb +151 -115
  16. data/lib/klaviyo-api-sdk/api/profiles_api.rb +170 -119
  17. data/lib/klaviyo-api-sdk/api/reporting_api.rb +49 -7
  18. data/lib/klaviyo-api-sdk/api/reviews_api.rb +2 -2
  19. data/lib/klaviyo-api-sdk/api/segments_api.rb +170 -146
  20. data/lib/klaviyo-api-sdk/api/tags_api.rb +108 -42
  21. data/lib/klaviyo-api-sdk/api/templates_api.rb +12 -12
  22. data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +3 -3
  23. data/lib/klaviyo-api-sdk/api/webhooks_api.rb +7 -7
  24. data/lib/klaviyo-api-sdk/api_client.rb +1 -1
  25. data/lib/klaviyo-api-sdk/configuration.rb +18 -9
  26. data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb +34 -0
  27. data/lib/klaviyo-api-sdk/models/device_metadata.rb +2 -2
  28. data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +224 -0
  29. data/lib/klaviyo-api-sdk/models/html_block_data.rb +4 -14
  30. data/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb +14 -5
  31. data/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb +13 -4
  32. data/lib/klaviyo-api-sdk/models/sms_unsubscription_parameters.rb +228 -0
  33. data/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb +1 -1
  34. data/lib/klaviyo-api-sdk/models/unsubscription_channels.rb +228 -0
  35. data/lib/klaviyo-api-sdk/models/unsubscription_parameters.rb +259 -0
  36. data/lib/klaviyo-api-sdk.rb +36 -19
  37. metadata +6 -2
@@ -33,6 +33,9 @@ module KlaviyoAPI
33
33
  # alias of `query_campaign_values`
34
34
  alias create_campaign_value_report query_campaign_values
35
35
 
36
+ # alias of `query_campaign_values`
37
+ alias create_campaign_values_report query_campaign_values
38
+
36
39
  # Query Campaign Values
37
40
  # Returns the requested campaign analytics values data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `campaigns:read`
38
41
  # @param campaign_values_request_dto [CampaignValuesRequestDTO]
@@ -76,7 +79,7 @@ module KlaviyoAPI
76
79
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
77
80
 
78
81
  # auth_names
79
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
82
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
80
83
 
81
84
  new_options = opts.merge(
82
85
  :operation => :"ReportingApi.query_campaign_values",
@@ -98,6 +101,9 @@ module KlaviyoAPI
98
101
  # alias of `query_campaign_values_with_http_info`
99
102
  alias create_campaign_value_report_with_http_info query_campaign_values_with_http_info
100
103
 
104
+ # alias of `query_campaign_values_with_http_info`
105
+ alias create_campaign_values_report_with_http_info query_campaign_values_with_http_info
106
+
101
107
  # Query Flow Series
102
108
  # Returns the requested flow analytics series data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `flows:read`
103
109
  # @param flow_series_request_dto [FlowSeriesRequestDTO]
@@ -112,6 +118,9 @@ module KlaviyoAPI
112
118
  # alias of `query_flow_series`
113
119
  alias create_flow_sery_report query_flow_series
114
120
 
121
+ # alias of `query_flow_series`
122
+ alias create_flow_series_report query_flow_series
123
+
115
124
  # Query Flow Series
116
125
  # Returns the requested flow analytics series data&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;flows:read&#x60;
117
126
  # @param flow_series_request_dto [FlowSeriesRequestDTO]
@@ -155,7 +164,7 @@ module KlaviyoAPI
155
164
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
156
165
 
157
166
  # auth_names
158
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
167
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
159
168
 
160
169
  new_options = opts.merge(
161
170
  :operation => :"ReportingApi.query_flow_series",
@@ -177,6 +186,9 @@ module KlaviyoAPI
177
186
  # alias of `query_flow_series_with_http_info`
178
187
  alias create_flow_sery_report_with_http_info query_flow_series_with_http_info
179
188
 
189
+ # alias of `query_flow_series_with_http_info`
190
+ alias create_flow_series_report_with_http_info query_flow_series_with_http_info
191
+
180
192
  # Query Flow Values
181
193
  # Returns the requested flow analytics values data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `flows:read`
182
194
  # @param flow_values_request_dto [FlowValuesRequestDTO]
@@ -191,6 +203,9 @@ module KlaviyoAPI
191
203
  # alias of `query_flow_values`
192
204
  alias create_flow_value_report query_flow_values
193
205
 
206
+ # alias of `query_flow_values`
207
+ alias create_flow_values_report query_flow_values
208
+
194
209
  # Query Flow Values
195
210
  # Returns the requested flow analytics values data&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;flows:read&#x60;
196
211
  # @param flow_values_request_dto [FlowValuesRequestDTO]
@@ -234,7 +249,7 @@ module KlaviyoAPI
234
249
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
235
250
 
236
251
  # auth_names
237
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
252
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
238
253
 
239
254
  new_options = opts.merge(
240
255
  :operation => :"ReportingApi.query_flow_values",
@@ -256,6 +271,9 @@ module KlaviyoAPI
256
271
  # alias of `query_flow_values_with_http_info`
257
272
  alias create_flow_value_report_with_http_info query_flow_values_with_http_info
258
273
 
274
+ # alias of `query_flow_values_with_http_info`
275
+ alias create_flow_values_report_with_http_info query_flow_values_with_http_info
276
+
259
277
  # Query Form Series
260
278
  # Returns the requested form analytics series data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `forms:read`
261
279
  # @param form_series_request_dto [FormSeriesRequestDTO]
@@ -269,6 +287,9 @@ module KlaviyoAPI
269
287
  # alias of `query_form_series`
270
288
  alias create_form_sery_report query_form_series
271
289
 
290
+ # alias of `query_form_series`
291
+ alias create_form_series_report query_form_series
292
+
272
293
  # Query Form Series
273
294
  # Returns the requested form analytics series data.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;forms:read&#x60;
274
295
  # @param form_series_request_dto [FormSeriesRequestDTO]
@@ -310,7 +331,7 @@ module KlaviyoAPI
310
331
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
311
332
 
312
333
  # auth_names
313
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
334
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
314
335
 
315
336
  new_options = opts.merge(
316
337
  :operation => :"ReportingApi.query_form_series",
@@ -332,6 +353,9 @@ module KlaviyoAPI
332
353
  # alias of `query_form_series_with_http_info`
333
354
  alias create_form_sery_report_with_http_info query_form_series_with_http_info
334
355
 
356
+ # alias of `query_form_series_with_http_info`
357
+ alias create_form_series_report_with_http_info query_form_series_with_http_info
358
+
335
359
  # Query Form Values
336
360
  # Returns the requested form analytics values data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `forms:read`
337
361
  # @param form_values_request_dto [FormValuesRequestDTO]
@@ -345,6 +369,9 @@ module KlaviyoAPI
345
369
  # alias of `query_form_values`
346
370
  alias create_form_value_report query_form_values
347
371
 
372
+ # alias of `query_form_values`
373
+ alias create_form_values_report query_form_values
374
+
348
375
  # Query Form Values
349
376
  # Returns the requested form analytics values data.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;forms:read&#x60;
350
377
  # @param form_values_request_dto [FormValuesRequestDTO]
@@ -386,7 +413,7 @@ module KlaviyoAPI
386
413
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
387
414
 
388
415
  # auth_names
389
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
416
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
390
417
 
391
418
  new_options = opts.merge(
392
419
  :operation => :"ReportingApi.query_form_values",
@@ -408,6 +435,9 @@ module KlaviyoAPI
408
435
  # alias of `query_form_values_with_http_info`
409
436
  alias create_form_value_report_with_http_info query_form_values_with_http_info
410
437
 
438
+ # alias of `query_form_values_with_http_info`
439
+ alias create_form_values_report_with_http_info query_form_values_with_http_info
440
+
411
441
  # Query Segment Series
412
442
  # Returns the requested segment analytics series data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `segments:read`
413
443
  # @param segment_series_request_dto [SegmentSeriesRequestDTO]
@@ -421,6 +451,9 @@ module KlaviyoAPI
421
451
  # alias of `query_segment_series`
422
452
  alias create_segment_sery_report query_segment_series
423
453
 
454
+ # alias of `query_segment_series`
455
+ alias create_segment_series_report query_segment_series
456
+
424
457
  # Query Segment Series
425
458
  # Returns the requested segment analytics series data.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;segments:read&#x60;
426
459
  # @param segment_series_request_dto [SegmentSeriesRequestDTO]
@@ -462,7 +495,7 @@ module KlaviyoAPI
462
495
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
463
496
 
464
497
  # auth_names
465
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
498
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
466
499
 
467
500
  new_options = opts.merge(
468
501
  :operation => :"ReportingApi.query_segment_series",
@@ -484,6 +517,9 @@ module KlaviyoAPI
484
517
  # alias of `query_segment_series_with_http_info`
485
518
  alias create_segment_sery_report_with_http_info query_segment_series_with_http_info
486
519
 
520
+ # alias of `query_segment_series_with_http_info`
521
+ alias create_segment_series_report_with_http_info query_segment_series_with_http_info
522
+
487
523
  # Query Segment Values
488
524
  # Returns the requested segment analytics values data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `segments:read`
489
525
  # @param segment_values_request_dto [SegmentValuesRequestDTO]
@@ -497,6 +533,9 @@ module KlaviyoAPI
497
533
  # alias of `query_segment_values`
498
534
  alias create_segment_value_report query_segment_values
499
535
 
536
+ # alias of `query_segment_values`
537
+ alias create_segment_values_report query_segment_values
538
+
500
539
  # Query Segment Values
501
540
  # Returns the requested segment analytics values data.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;2/m&#x60;&lt;br&gt;Daily: &#x60;225/d&#x60; **Scopes:** &#x60;segments:read&#x60;
502
541
  # @param segment_values_request_dto [SegmentValuesRequestDTO]
@@ -538,7 +577,7 @@ module KlaviyoAPI
538
577
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
539
578
 
540
579
  # auth_names
541
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
580
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
542
581
 
543
582
  new_options = opts.merge(
544
583
  :operation => :"ReportingApi.query_segment_values",
@@ -559,5 +598,8 @@ module KlaviyoAPI
559
598
 
560
599
  # alias of `query_segment_values_with_http_info`
561
600
  alias create_segment_value_report_with_http_info query_segment_values_with_http_info
601
+
602
+ # alias of `query_segment_values_with_http_info`
603
+ alias create_segment_values_report_with_http_info query_segment_values_with_http_info
562
604
  end
563
605
  end
@@ -86,7 +86,7 @@ module KlaviyoAPI
86
86
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
87
87
 
88
88
  # auth_names
89
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
89
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
90
90
 
91
91
  new_options = opts.merge(
92
92
  :operation => :"ReviewsApi.get_review",
@@ -190,7 +190,7 @@ module KlaviyoAPI
190
190
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
191
191
 
192
192
  # auth_names
193
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
193
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
194
194
 
195
195
  new_options = opts.merge(
196
196
  :operation => :"ReviewsApi.get_reviews",
@@ -70,7 +70,7 @@ module KlaviyoAPI
70
70
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
71
71
 
72
72
  # auth_names
73
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
73
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
74
74
 
75
75
  new_options = opts.merge(
76
76
  :operation => :"SegmentsApi.create_segment",
@@ -135,7 +135,7 @@ module KlaviyoAPI
135
135
  return_type = opts[:debug_return_type]
136
136
 
137
137
  # auth_names
138
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
138
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
139
139
 
140
140
  new_options = opts.merge(
141
141
  :operation => :"SegmentsApi.delete_segment",
@@ -154,6 +154,167 @@ module KlaviyoAPI
154
154
  return data, status_code, headers
155
155
  end
156
156
 
157
+ # Get Flows Triggered by Segment
158
+ # Get all flows where the given segment ID is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read`
159
+ # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
162
+ # @return [Hash<String, Object>]
163
+ def get_flows_triggered_by_segment(id, opts = {})
164
+ data, _status_code, _headers = get_flows_triggered_by_segment_with_http_info(id, opts)
165
+ data
166
+ end
167
+
168
+ # alias of `get_flows_triggered_by_segment`
169
+ alias get_flow_triggers_for_segment get_flows_triggered_by_segment
170
+
171
+ # alias of `get_flows_triggered_by_segment`
172
+ alias get_segment_flow_triggers get_flows_triggered_by_segment
173
+
174
+ # Get Flows Triggered by Segment
175
+ # Get all flows where the given segment ID is being used as the trigger.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;flows:read&#x60; &#x60;segments:read&#x60;
176
+ # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
177
+ # @param [Hash] opts the optional parameters
178
+ # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
179
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
180
+ def get_flows_triggered_by_segment_with_http_info(id, opts = {})
181
+ if @api_client.config.debugging
182
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.get_flows_triggered_by_segment ...'
183
+ end
184
+ # verify the required parameter 'id' is set
185
+ if @api_client.config.client_side_validation && id.nil?
186
+ fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_flows_triggered_by_segment"
187
+ end
188
+ allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
189
+ if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
190
+ fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
191
+ end
192
+ # resource path
193
+ local_var_path = '/api/segments/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
194
+
195
+ # query parameters
196
+ query_params = opts[:query_params] || {}
197
+ query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
198
+
199
+ # header parameters
200
+ header_params = opts[:header_params] || {}
201
+ # klaviyo api revision
202
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
203
+ # HTTP header 'Accept' (if needed)
204
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
205
+
206
+ # form parameters
207
+ form_params = opts[:form_params] || {}
208
+
209
+ # http body (model)
210
+ post_body = opts[:debug_body]
211
+
212
+ # return_type
213
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
214
+
215
+ # auth_names
216
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
217
+
218
+ new_options = opts.merge(
219
+ :operation => :"SegmentsApi.get_flows_triggered_by_segment",
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :form_params => form_params,
223
+ :body => post_body,
224
+ :auth_names => auth_names,
225
+ :return_type => return_type
226
+ )
227
+
228
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug "API called: SegmentsApi#get_flows_triggered_by_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
231
+ end
232
+ return data, status_code, headers
233
+ end
234
+
235
+ # alias of `get_flows_triggered_by_segment_with_http_info`
236
+ alias get_flow_triggers_for_segment_with_http_info get_flows_triggered_by_segment_with_http_info
237
+
238
+ # alias of `get_flows_triggered_by_segment_with_http_info`
239
+ alias get_segment_flow_triggers_with_http_info get_flows_triggered_by_segment_with_http_info
240
+
241
+ # Get IDs for Flows Triggered by Segment
242
+ # Get the IDs of all flows where the given segment is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read`
243
+ # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
244
+ # @param [Hash] opts the optional parameters
245
+ # @return [Hash<String, Object>]
246
+ def get_ids_for_flows_triggered_by_segment(id, opts = {})
247
+ data, _status_code, _headers = get_ids_for_flows_triggered_by_segment_with_http_info(id, opts)
248
+ data
249
+ end
250
+
251
+ # alias of `get_ids_for_flows_triggered_by_segment`
252
+ alias get_flow_trigger_ids_for_segment get_ids_for_flows_triggered_by_segment
253
+
254
+ # alias of `get_ids_for_flows_triggered_by_segment`
255
+ alias get_segment_relationships_flow_triggers get_ids_for_flows_triggered_by_segment
256
+
257
+ # Get IDs for Flows Triggered by Segment
258
+ # Get the IDs of all flows where the given segment is being used as the trigger.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;flows:read&#x60; &#x60;segments:read&#x60;
259
+ # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
260
+ # @param [Hash] opts the optional parameters
261
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
262
+ def get_ids_for_flows_triggered_by_segment_with_http_info(id, opts = {})
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug 'Calling API: SegmentsApi.get_ids_for_flows_triggered_by_segment ...'
265
+ end
266
+ # verify the required parameter 'id' is set
267
+ if @api_client.config.client_side_validation && id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_ids_for_flows_triggered_by_segment"
269
+ end
270
+ # resource path
271
+ local_var_path = '/api/segments/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
272
+
273
+ # query parameters
274
+ query_params = opts[:query_params] || {}
275
+
276
+ # header parameters
277
+ header_params = opts[:header_params] || {}
278
+ # klaviyo api revision
279
+ header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
282
+
283
+ # form parameters
284
+ form_params = opts[:form_params] || {}
285
+
286
+ # http body (model)
287
+ post_body = opts[:debug_body]
288
+
289
+ # return_type
290
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
291
+
292
+ # auth_names
293
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
294
+
295
+ new_options = opts.merge(
296
+ :operation => :"SegmentsApi.get_ids_for_flows_triggered_by_segment",
297
+ :header_params => header_params,
298
+ :query_params => query_params,
299
+ :form_params => form_params,
300
+ :body => post_body,
301
+ :auth_names => auth_names,
302
+ :return_type => return_type
303
+ )
304
+
305
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug "API called: SegmentsApi#get_ids_for_flows_triggered_by_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
+ end
309
+ return data, status_code, headers
310
+ end
311
+
312
+ # alias of `get_ids_for_flows_triggered_by_segment_with_http_info`
313
+ alias get_flow_trigger_ids_for_segment_with_http_info get_ids_for_flows_triggered_by_segment_with_http_info
314
+
315
+ # alias of `get_ids_for_flows_triggered_by_segment_with_http_info`
316
+ alias get_segment_relationships_flow_triggers_with_http_info get_ids_for_flows_triggered_by_segment_with_http_info
317
+
157
318
  # Get Profile IDs for Segment
158
319
  # Get all profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for the given segment ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` `segments:read`
159
320
  # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
@@ -227,7 +388,7 @@ module KlaviyoAPI
227
388
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
228
389
 
229
390
  # auth_names
230
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
391
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
231
392
 
232
393
  new_options = opts.merge(
233
394
  :operation => :"SegmentsApi.get_profile_ids_for_segment",
@@ -336,7 +497,7 @@ module KlaviyoAPI
336
497
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
337
498
 
338
499
  # auth_names
339
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
500
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
340
501
 
341
502
  new_options = opts.merge(
342
503
  :operation => :"SegmentsApi.get_profiles_for_segment",
@@ -439,7 +600,7 @@ module KlaviyoAPI
439
600
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
440
601
 
441
602
  # auth_names
442
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
603
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
443
604
 
444
605
  new_options = opts.merge(
445
606
  :operation => :"SegmentsApi.get_segment",
@@ -458,143 +619,6 @@ module KlaviyoAPI
458
619
  return data, status_code, headers
459
620
  end
460
621
 
461
- # Get Segment Flow Triggers
462
- # Get all flows where the given segment ID is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read`
463
- # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
464
- # @param [Hash] opts the optional parameters
465
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
466
- # @return [Hash<String, Object>]
467
- def get_segment_flow_triggers(id, opts = {})
468
- data, _status_code, _headers = get_segment_flow_triggers_with_http_info(id, opts)
469
- data
470
- end
471
-
472
- # Get Segment Flow Triggers
473
- # Get all flows where the given segment ID is being used as the trigger.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;flows:read&#x60; &#x60;segments:read&#x60;
474
- # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
475
- # @param [Hash] opts the optional parameters
476
- # @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
477
- # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
478
- def get_segment_flow_triggers_with_http_info(id, opts = {})
479
- if @api_client.config.debugging
480
- @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_flow_triggers ...'
481
- end
482
- # verify the required parameter 'id' is set
483
- if @api_client.config.client_side_validation && id.nil?
484
- fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_flow_triggers"
485
- end
486
- allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
487
- if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
488
- fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
489
- end
490
- # resource path
491
- local_var_path = '/api/segments/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
492
-
493
- # query parameters
494
- query_params = opts[:query_params] || {}
495
- query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
496
-
497
- # header parameters
498
- header_params = opts[:header_params] || {}
499
- # klaviyo api revision
500
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
501
- # HTTP header 'Accept' (if needed)
502
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
503
-
504
- # form parameters
505
- form_params = opts[:form_params] || {}
506
-
507
- # http body (model)
508
- post_body = opts[:debug_body]
509
-
510
- # return_type
511
- return_type = opts[:debug_return_type] || 'Hash<String, Object>'
512
-
513
- # auth_names
514
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
515
-
516
- new_options = opts.merge(
517
- :operation => :"SegmentsApi.get_segment_flow_triggers",
518
- :header_params => header_params,
519
- :query_params => query_params,
520
- :form_params => form_params,
521
- :body => post_body,
522
- :auth_names => auth_names,
523
- :return_type => return_type
524
- )
525
-
526
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
527
- if @api_client.config.debugging
528
- @api_client.config.logger.debug "API called: SegmentsApi#get_segment_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
529
- end
530
- return data, status_code, headers
531
- end
532
-
533
- # Get Segment Relationships Flow Triggers
534
- # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given segment is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read`
535
- # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
536
- # @param [Hash] opts the optional parameters
537
- # @return [Hash<String, Object>]
538
- def get_segment_relationships_flow_triggers(id, opts = {})
539
- data, _status_code, _headers = get_segment_relationships_flow_triggers_with_http_info(id, opts)
540
- data
541
- end
542
-
543
- # Get Segment Relationships Flow Triggers
544
- # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given segment is being used as the trigger.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;flows:read&#x60; &#x60;segments:read&#x60;
545
- # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo.
546
- # @param [Hash] opts the optional parameters
547
- # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
548
- def get_segment_relationships_flow_triggers_with_http_info(id, opts = {})
549
- if @api_client.config.debugging
550
- @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_relationships_flow_triggers ...'
551
- end
552
- # verify the required parameter 'id' is set
553
- if @api_client.config.client_side_validation && id.nil?
554
- fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_relationships_flow_triggers"
555
- end
556
- # resource path
557
- local_var_path = '/api/segments/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
558
-
559
- # query parameters
560
- query_params = opts[:query_params] || {}
561
-
562
- # header parameters
563
- header_params = opts[:header_params] || {}
564
- # klaviyo api revision
565
- header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
566
- # HTTP header 'Accept' (if needed)
567
- header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
568
-
569
- # form parameters
570
- form_params = opts[:form_params] || {}
571
-
572
- # http body (model)
573
- post_body = opts[:debug_body]
574
-
575
- # return_type
576
- return_type = opts[:debug_return_type] || 'Hash<String, Object>'
577
-
578
- # auth_names
579
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
580
-
581
- new_options = opts.merge(
582
- :operation => :"SegmentsApi.get_segment_relationships_flow_triggers",
583
- :header_params => header_params,
584
- :query_params => query_params,
585
- :form_params => form_params,
586
- :body => post_body,
587
- :auth_names => auth_names,
588
- :return_type => return_type
589
- )
590
-
591
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
592
- if @api_client.config.debugging
593
- @api_client.config.logger.debug "API called: SegmentsApi#get_segment_relationships_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
594
- end
595
- return data, status_code, headers
596
- end
597
-
598
622
  # Get Segments
599
623
  # Get all segments in an account. Filter to request a subset of all segments. Segments can be filtered by `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `segments:read`
600
624
  # @param [Hash] opts the optional parameters
@@ -676,7 +700,7 @@ module KlaviyoAPI
676
700
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
677
701
 
678
702
  # auth_names
679
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
703
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
680
704
 
681
705
  new_options = opts.merge(
682
706
  :operation => :"SegmentsApi.get_segments",
@@ -744,7 +768,7 @@ module KlaviyoAPI
744
768
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
745
769
 
746
770
  # auth_names
747
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
771
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
748
772
 
749
773
  new_options = opts.merge(
750
774
  :operation => :"SegmentsApi.get_tag_ids_for_segment",
@@ -822,7 +846,7 @@ module KlaviyoAPI
822
846
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
823
847
 
824
848
  # auth_names
825
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
849
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
826
850
 
827
851
  new_options = opts.merge(
828
852
  :operation => :"SegmentsApi.get_tags_for_segment",
@@ -901,7 +925,7 @@ module KlaviyoAPI
901
925
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
902
926
 
903
927
  # auth_names
904
- auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
928
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
905
929
 
906
930
  new_options = opts.merge(
907
931
  :operation => :"SegmentsApi.update_segment",