klaviyo_sdk 1.0.0.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +1121 -0
  4. data/klaviyo_sdk.gemspec +35 -0
  5. data/lib/klaviyo_sdk/api/campaigns_api.rb +717 -0
  6. data/lib/klaviyo_sdk/api/data_privacy_api.rb +86 -0
  7. data/lib/klaviyo_sdk/api/lists_segments_api.rb +1101 -0
  8. data/lib/klaviyo_sdk/api/metrics_api.rb +343 -0
  9. data/lib/klaviyo_sdk/api/profiles_api.rb +381 -0
  10. data/lib/klaviyo_sdk/api/templates_api.rb +555 -0
  11. data/lib/klaviyo_sdk/api/track_identify_api.rb +288 -0
  12. data/lib/klaviyo_sdk/api_client.rb +389 -0
  13. data/lib/klaviyo_sdk/api_error.rb +57 -0
  14. data/lib/klaviyo_sdk/configuration.rb +278 -0
  15. data/lib/klaviyo_sdk/models/campaign.rb +310 -0
  16. data/lib/klaviyo_sdk/models/check_membership_request.rb +244 -0
  17. data/lib/klaviyo_sdk/models/delete_email.rb +218 -0
  18. data/lib/klaviyo_sdk/models/delete_person.rb +218 -0
  19. data/lib/klaviyo_sdk/models/delete_phone.rb +219 -0
  20. data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +298 -0
  21. data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +263 -0
  22. data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +274 -0
  23. data/lib/klaviyo_sdk/models/identify_payload.rb +237 -0
  24. data/lib/klaviyo_sdk/models/identify_payload_properties.rb +327 -0
  25. data/lib/klaviyo_sdk/models/inline_object.rb +220 -0
  26. data/lib/klaviyo_sdk/models/inline_object3.rb +226 -0
  27. data/lib/klaviyo_sdk/models/inline_object4.rb +254 -0
  28. data/lib/klaviyo_sdk/models/inline_object5.rb +288 -0
  29. data/lib/klaviyo_sdk/models/metric.rb +265 -0
  30. data/lib/klaviyo_sdk/models/metric_export.rb +285 -0
  31. data/lib/klaviyo_sdk/models/metric_timeline.rb +271 -0
  32. data/lib/klaviyo_sdk/models/metric_timeline_data.rb +294 -0
  33. data/lib/klaviyo_sdk/models/person.rb +389 -0
  34. data/lib/klaviyo_sdk/models/person.rb.bak +389 -0
  35. data/lib/klaviyo_sdk/models/privacy_email.rb +218 -0
  36. data/lib/klaviyo_sdk/models/privacy_id.rb +218 -0
  37. data/lib/klaviyo_sdk/models/privacy_phone.rb +218 -0
  38. data/lib/klaviyo_sdk/models/rendered_template.rb +247 -0
  39. data/lib/klaviyo_sdk/models/template.rb +272 -0
  40. data/lib/klaviyo_sdk/models/track_payload.rb +261 -0
  41. data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +227 -0
  42. data/lib/klaviyo_sdk/models/track_payload_properties.rb +237 -0
  43. data/lib/klaviyo_sdk/version.rb +15 -0
  44. data/lib/klaviyo_sdk.rb +124 -0
  45. metadata +120 -0
@@ -0,0 +1,1101 @@
1
+ =begin
2
+ #Klaviyo API
3
+
4
+ #Empowering creators to own their destiny
5
+
6
+ The version of the OpenAPI document: 2022.03.29
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Client
16
+ class ListsSegmentsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add Members to a List
23
+ # Adds profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list. If you would like to subscribe profiles to a list and use the double opt-in settings for the list, please use the subscribe endpoint.
24
+ # @param list_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [InlineObject4] :inline_object4
27
+ # @return [Array<Hash<String, Object>>]
28
+ def add_members(list_id, opts = {})
29
+ data, _status_code, _headers = add_members_with_http_info(list_id, opts)
30
+ data
31
+ end
32
+
33
+ # Add Members to a List
34
+ # Adds profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list. If you would like to subscribe profiles to a list and use the double opt-in settings for the list, please use the subscribe endpoint.
35
+ # @param list_id [String]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [InlineObject4] :inline_object4
38
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
39
+ def add_members_with_http_info(list_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.add_members ...'
42
+ end
43
+ # verify the required parameter 'list_id' is set
44
+ if @api_client.config.client_side_validation && list_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.add_members"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v2/list/{list_id}/members'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'inline_object4'])
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"ListsSegmentsApi.add_members",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#add_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Create List
93
+ # Creates a new list.
94
+ # @param list_name [String]
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [Hash<String, Object>]
97
+ def create_list(list_name, opts = {})
98
+ data, _status_code, _headers = create_list_with_http_info(list_name, opts)
99
+ data
100
+ end
101
+
102
+ # Create List
103
+ # Creates a new list.
104
+ # @param list_name [String]
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
107
+ def create_list_with_http_info(list_name, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.create_list ...'
110
+ end
111
+ # verify the required parameter 'list_name' is set
112
+ if @api_client.config.client_side_validation && list_name.nil?
113
+ fail ArgumentError, "Missing the required parameter 'list_name' when calling ListsSegmentsApi.create_list"
114
+ end
115
+ # resource path
116
+ local_var_path = '/v2/lists'
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
125
+ # HTTP header 'Content-Type'
126
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
127
+ if !content_type.nil?
128
+ header_params['Content-Type'] = content_type
129
+ end
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+ form_params['list_name'] = list_name
134
+
135
+ # http body (model)
136
+ post_body = opts[:body]
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
140
+
141
+ # auth_names
142
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
143
+
144
+ new_options = opts.merge(
145
+ :operation => :"ListsSegmentsApi.create_list",
146
+ :header_params => header_params,
147
+ :query_params => query_params,
148
+ :form_params => form_params,
149
+ :body => post_body,
150
+ :auth_names => auth_names,
151
+ :return_type => return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+
161
+ # Delete List
162
+ # Deletes a list from an account. This is a destructive operation and cannot be undone. It will also remove flow triggers associated with the list.
163
+ # @param list_id [String]
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [nil]
166
+ def delete_list(list_id, opts = {})
167
+ delete_list_with_http_info(list_id, opts)
168
+ nil
169
+ end
170
+
171
+ # Delete List
172
+ # Deletes a list from an account. This is a destructive operation and cannot be undone. It will also remove flow triggers associated with the list.
173
+ # @param list_id [String]
174
+ # @param [Hash] opts the optional parameters
175
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
176
+ def delete_list_with_http_info(list_id, opts = {})
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.delete_list ...'
179
+ end
180
+ # verify the required parameter 'list_id' is set
181
+ if @api_client.config.client_side_validation && list_id.nil?
182
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.delete_list"
183
+ end
184
+ # resource path
185
+ local_var_path = '/v2/list/{list_id}'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type]
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"ListsSegmentsApi.delete_list",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
222
+ # Exclude Profile From All Email
223
+ # Marks a person as excluded from all email. This works the same way as manually excluding someone via the excluded people page. Someone who is excluded will no longer receive any campaigns or flow emails.
224
+ # @param email [String]
225
+ # @param [Hash] opts the optional parameters
226
+ # @return [Hash<String, Object>]
227
+ def exclude_globally(email, opts = {})
228
+ data, _status_code, _headers = exclude_globally_with_http_info(email, opts)
229
+ data
230
+ end
231
+
232
+ # Exclude Profile From All Email
233
+ # Marks a person as excluded from all email. This works the same way as manually excluding someone via the excluded people page. Someone who is excluded will no longer receive any campaigns or flow emails.
234
+ # @param email [String]
235
+ # @param [Hash] opts the optional parameters
236
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
237
+ def exclude_globally_with_http_info(email, opts = {})
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.exclude_globally ...'
240
+ end
241
+ # verify the required parameter 'email' is set
242
+ if @api_client.config.client_side_validation && email.nil?
243
+ fail ArgumentError, "Missing the required parameter 'email' when calling ListsSegmentsApi.exclude_globally"
244
+ end
245
+ # resource path
246
+ local_var_path = '/v1/people/exclusions'
247
+
248
+ # query parameters
249
+ query_params = opts[:query_params] || {}
250
+
251
+ # header parameters
252
+ header_params = opts[:header_params] || {}
253
+ # HTTP header 'Accept' (if needed)
254
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
255
+ # HTTP header 'Content-Type'
256
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
257
+ if !content_type.nil?
258
+ header_params['Content-Type'] = content_type
259
+ end
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+ form_params['email'] = email
264
+
265
+ # http body (model)
266
+ post_body = opts[:body]
267
+
268
+ # return_type
269
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
270
+
271
+ # auth_names
272
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
273
+
274
+ new_options = opts.merge(
275
+ :operation => :"ListsSegmentsApi.exclude_globally",
276
+ :header_params => header_params,
277
+ :query_params => query_params,
278
+ :form_params => form_params,
279
+ :body => post_body,
280
+ :auth_names => auth_names,
281
+ :return_type => return_type
282
+ )
283
+
284
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#exclude_globally\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ end
288
+ return data, status_code, headers
289
+ end
290
+
291
+ # Get Global Exclusions & Unsubscribes
292
+ # Returns global exclusions/unsubscribes. Global exclusions are distinct from list exclusions in that these email addresses will not receive any emails from any list. Typically, when someone unsubscribes from a campaign, they are only unsubscribed from that list and are not globally unsubscribed.
293
+ # @param [Hash] opts the optional parameters
294
+ # @option opts [String] :reason Filter results based on the reason for someone being excluded. The possible values are &#x60;unsubscribed&#x60;, &#x60;bounced&#x60;, &#x60;invalid_email&#x60;, &#x60;reported_spam&#x60; and &#x60;manually_excluded&#x60;. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason.
295
+ # @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are &#x60;asc&#x60; or &#x60;desc&#x60;. Defaults to &#x60;asc&#x60;. (default to 'asc')
296
+ # @option opts [Integer] :count For pagination, the number of results to return. Default &#x3D; 500 (default to 500)
297
+ # @option opts [Integer] :page For pagination, which page of results to return. Default &#x3D; 0 (default to 0)
298
+ # @return [GlobalExclusionResponseData]
299
+ def get_global_exclusions(opts = {})
300
+ data, _status_code, _headers = get_global_exclusions_with_http_info(opts)
301
+ data
302
+ end
303
+
304
+ # Get Global Exclusions &amp; Unsubscribes
305
+ # Returns global exclusions/unsubscribes. Global exclusions are distinct from list exclusions in that these email addresses will not receive any emails from any list. Typically, when someone unsubscribes from a campaign, they are only unsubscribed from that list and are not globally unsubscribed.
306
+ # @param [Hash] opts the optional parameters
307
+ # @option opts [String] :reason Filter results based on the reason for someone being excluded. The possible values are &#x60;unsubscribed&#x60;, &#x60;bounced&#x60;, &#x60;invalid_email&#x60;, &#x60;reported_spam&#x60; and &#x60;manually_excluded&#x60;. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason.
308
+ # @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are &#x60;asc&#x60; or &#x60;desc&#x60;. Defaults to &#x60;asc&#x60;.
309
+ # @option opts [Integer] :count For pagination, the number of results to return. Default &#x3D; 500
310
+ # @option opts [Integer] :page For pagination, which page of results to return. Default &#x3D; 0
311
+ # @return [Array<(GlobalExclusionResponseData, Integer, Hash)>] GlobalExclusionResponseData data, response status code and response headers
312
+ def get_global_exclusions_with_http_info(opts = {})
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_global_exclusions ...'
315
+ end
316
+ # resource path
317
+ local_var_path = '/v1/people/exclusions'
318
+
319
+ # query parameters
320
+ query_params = opts[:query_params] || {}
321
+ query_params[:'reason'] = opts[:'reason'] if !opts[:'reason'].nil?
322
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
323
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
324
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
325
+
326
+ # header parameters
327
+ header_params = opts[:header_params] || {}
328
+ # HTTP header 'Accept' (if needed)
329
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
330
+
331
+ # form parameters
332
+ form_params = opts[:form_params] || {}
333
+
334
+ # http body (model)
335
+ post_body = opts[:body]
336
+
337
+ # return_type
338
+ return_type = opts[:debug_return_type] || 'GlobalExclusionResponseData'
339
+
340
+ # auth_names
341
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
342
+
343
+ new_options = opts.merge(
344
+ :operation => :"ListsSegmentsApi.get_global_exclusions",
345
+ :header_params => header_params,
346
+ :query_params => query_params,
347
+ :form_params => form_params,
348
+ :body => post_body,
349
+ :auth_names => auth_names,
350
+ :return_type => return_type
351
+ )
352
+
353
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
354
+ if @api_client.config.debugging
355
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_global_exclusions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
356
+ end
357
+ return data, status_code, headers
358
+ end
359
+
360
+ # Get All Exclusions for a List
361
+ # Gets all of the emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time. This endpoint uses batching to return the records, so for a large list multiple calls will need to be made to get all of the records.
362
+ # @param list_id [String]
363
+ # @param [Hash] opts the optional parameters
364
+ # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
365
+ # @return [Hash<String, Object>]
366
+ def get_list_exclusions(list_id, opts = {})
367
+ data, _status_code, _headers = get_list_exclusions_with_http_info(list_id, opts)
368
+ data
369
+ end
370
+
371
+ # Get All Exclusions for a List
372
+ # Gets all of the emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time. This endpoint uses batching to return the records, so for a large list multiple calls will need to be made to get all of the records.
373
+ # @param list_id [String]
374
+ # @param [Hash] opts the optional parameters
375
+ # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
376
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
377
+ def get_list_exclusions_with_http_info(list_id, opts = {})
378
+ if @api_client.config.debugging
379
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_list_exclusions ...'
380
+ end
381
+ # verify the required parameter 'list_id' is set
382
+ if @api_client.config.client_side_validation && list_id.nil?
383
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.get_list_exclusions"
384
+ end
385
+ # resource path
386
+ local_var_path = '/v2/list/{list_id}/exclusions/all'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
387
+
388
+ # query parameters
389
+ query_params = opts[:query_params] || {}
390
+ query_params[:'marker'] = opts[:'marker'] if !opts[:'marker'].nil?
391
+
392
+ # header parameters
393
+ header_params = opts[:header_params] || {}
394
+ # HTTP header 'Accept' (if needed)
395
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
396
+
397
+ # form parameters
398
+ form_params = opts[:form_params] || {}
399
+
400
+ # http body (model)
401
+ post_body = opts[:body]
402
+
403
+ # return_type
404
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
405
+
406
+ # auth_names
407
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
408
+
409
+ new_options = opts.merge(
410
+ :operation => :"ListsSegmentsApi.get_list_exclusions",
411
+ :header_params => header_params,
412
+ :query_params => query_params,
413
+ :form_params => form_params,
414
+ :body => post_body,
415
+ :auth_names => auth_names,
416
+ :return_type => return_type
417
+ )
418
+
419
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
420
+ if @api_client.config.debugging
421
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_list_exclusions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
422
+ end
423
+ return data, status_code, headers
424
+ end
425
+
426
+ # Get List Info
427
+ # Returns information about a list.
428
+ # @param list_id [String]
429
+ # @param [Hash] opts the optional parameters
430
+ # @return [Hash<String, Object>]
431
+ def get_list_info(list_id, opts = {})
432
+ data, _status_code, _headers = get_list_info_with_http_info(list_id, opts)
433
+ data
434
+ end
435
+
436
+ # Get List Info
437
+ # Returns information about a list.
438
+ # @param list_id [String]
439
+ # @param [Hash] opts the optional parameters
440
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
441
+ def get_list_info_with_http_info(list_id, opts = {})
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_list_info ...'
444
+ end
445
+ # verify the required parameter 'list_id' is set
446
+ if @api_client.config.client_side_validation && list_id.nil?
447
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.get_list_info"
448
+ end
449
+ # resource path
450
+ local_var_path = '/v2/list/{list_id}'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
451
+
452
+ # query parameters
453
+ query_params = opts[:query_params] || {}
454
+
455
+ # header parameters
456
+ header_params = opts[:header_params] || {}
457
+ # HTTP header 'Accept' (if needed)
458
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
459
+
460
+ # form parameters
461
+ form_params = opts[:form_params] || {}
462
+
463
+ # http body (model)
464
+ post_body = opts[:body]
465
+
466
+ # return_type
467
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
468
+
469
+ # auth_names
470
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
471
+
472
+ new_options = opts.merge(
473
+ :operation => :"ListsSegmentsApi.get_list_info",
474
+ :header_params => header_params,
475
+ :query_params => query_params,
476
+ :form_params => form_params,
477
+ :body => post_body,
478
+ :auth_names => auth_names,
479
+ :return_type => return_type
480
+ )
481
+
482
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
483
+ if @api_client.config.debugging
484
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_list_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
485
+ end
486
+ return data, status_code, headers
487
+ end
488
+
489
+ # Check if Profiles Are in a List
490
+ # Checks if one or more emails, phone numbers, or push tokens are in a given list. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
491
+ # @param list_id [String]
492
+ # @param [Hash] opts the optional parameters
493
+ # @option opts [CheckMembershipRequest] :check_membership_request
494
+ # @return [Array<Hash<String, Object>>]
495
+ def get_list_members(list_id, opts = {})
496
+ data, _status_code, _headers = get_list_members_with_http_info(list_id, opts)
497
+ data
498
+ end
499
+
500
+ # Check if Profiles Are in a List
501
+ # Checks if one or more emails, phone numbers, or push tokens are in a given list. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
502
+ # @param list_id [String]
503
+ # @param [Hash] opts the optional parameters
504
+ # @option opts [CheckMembershipRequest] :check_membership_request
505
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
506
+ def get_list_members_with_http_info(list_id, opts = {})
507
+ if @api_client.config.debugging
508
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_list_members ...'
509
+ end
510
+ # verify the required parameter 'list_id' is set
511
+ if @api_client.config.client_side_validation && list_id.nil?
512
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.get_list_members"
513
+ end
514
+ # resource path
515
+ local_var_path = '/v2/list/{list_id}/get-members'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
516
+
517
+ # query parameters
518
+ query_params = opts[:query_params] || {}
519
+
520
+ # header parameters
521
+ header_params = opts[:header_params] || {}
522
+ # HTTP header 'Accept' (if needed)
523
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
524
+ # HTTP header 'Content-Type'
525
+ content_type = @api_client.select_header_content_type(['application/json'])
526
+ if !content_type.nil?
527
+ header_params['Content-Type'] = content_type
528
+ end
529
+
530
+ # form parameters
531
+ form_params = opts[:form_params] || {}
532
+
533
+ # http body (model)
534
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'check_membership_request'])
535
+
536
+ # return_type
537
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
538
+
539
+ # auth_names
540
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
541
+
542
+ new_options = opts.merge(
543
+ :operation => :"ListsSegmentsApi.get_list_members",
544
+ :header_params => header_params,
545
+ :query_params => query_params,
546
+ :form_params => form_params,
547
+ :body => post_body,
548
+ :auth_names => auth_names,
549
+ :return_type => return_type
550
+ )
551
+
552
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
553
+ if @api_client.config.debugging
554
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
555
+ end
556
+ return data, status_code, headers
557
+ end
558
+
559
+ # Check if Profiles Are in a List and not Suppressed
560
+ # Checks if one or more emails are in a given list and not suppressed. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
561
+ # @param list_id [String]
562
+ # @param [Hash] opts the optional parameters
563
+ # @option opts [CheckMembershipRequest] :check_membership_request
564
+ # @return [Array<Hash<String, Object>>]
565
+ def get_list_subscriptions(list_id, opts = {})
566
+ data, _status_code, _headers = get_list_subscriptions_with_http_info(list_id, opts)
567
+ data
568
+ end
569
+
570
+ # Check if Profiles Are in a List and not Suppressed
571
+ # Checks if one or more emails are in a given list and not suppressed. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
572
+ # @param list_id [String]
573
+ # @param [Hash] opts the optional parameters
574
+ # @option opts [CheckMembershipRequest] :check_membership_request
575
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
576
+ def get_list_subscriptions_with_http_info(list_id, opts = {})
577
+ if @api_client.config.debugging
578
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_list_subscriptions ...'
579
+ end
580
+ # verify the required parameter 'list_id' is set
581
+ if @api_client.config.client_side_validation && list_id.nil?
582
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.get_list_subscriptions"
583
+ end
584
+ # resource path
585
+ local_var_path = '/v2/list/{list_id}/get-list-subscriptions'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
586
+
587
+ # query parameters
588
+ query_params = opts[:query_params] || {}
589
+
590
+ # header parameters
591
+ header_params = opts[:header_params] || {}
592
+ # HTTP header 'Accept' (if needed)
593
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
594
+ # HTTP header 'Content-Type'
595
+ content_type = @api_client.select_header_content_type(['application/json'])
596
+ if !content_type.nil?
597
+ header_params['Content-Type'] = content_type
598
+ end
599
+
600
+ # form parameters
601
+ form_params = opts[:form_params] || {}
602
+
603
+ # http body (model)
604
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'check_membership_request'])
605
+
606
+ # return_type
607
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
608
+
609
+ # auth_names
610
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
611
+
612
+ new_options = opts.merge(
613
+ :operation => :"ListsSegmentsApi.get_list_subscriptions",
614
+ :header_params => header_params,
615
+ :query_params => query_params,
616
+ :form_params => form_params,
617
+ :body => post_body,
618
+ :auth_names => auth_names,
619
+ :return_type => return_type
620
+ )
621
+
622
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
623
+ if @api_client.config.debugging
624
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_list_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
625
+ end
626
+ return data, status_code, headers
627
+ end
628
+
629
+ # Get Lists
630
+ # Returns a listing of all of the lists in an account.
631
+ # @param [Hash] opts the optional parameters
632
+ # @return [Array<Hash<String, Object>>]
633
+ def get_lists(opts = {})
634
+ data, _status_code, _headers = get_lists_with_http_info(opts)
635
+ data
636
+ end
637
+
638
+ # Get Lists
639
+ # Returns a listing of all of the lists in an account.
640
+ # @param [Hash] opts the optional parameters
641
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
642
+ def get_lists_with_http_info(opts = {})
643
+ if @api_client.config.debugging
644
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_lists ...'
645
+ end
646
+ # resource path
647
+ local_var_path = '/v2/lists'
648
+
649
+ # query parameters
650
+ query_params = opts[:query_params] || {}
651
+
652
+ # header parameters
653
+ header_params = opts[:header_params] || {}
654
+ # HTTP header 'Accept' (if needed)
655
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
656
+
657
+ # form parameters
658
+ form_params = opts[:form_params] || {}
659
+
660
+ # http body (model)
661
+ post_body = opts[:body]
662
+
663
+ # return_type
664
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
665
+
666
+ # auth_names
667
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
668
+
669
+ new_options = opts.merge(
670
+ :operation => :"ListsSegmentsApi.get_lists",
671
+ :header_params => header_params,
672
+ :query_params => query_params,
673
+ :form_params => form_params,
674
+ :body => post_body,
675
+ :auth_names => auth_names,
676
+ :return_type => return_type
677
+ )
678
+
679
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
680
+ if @api_client.config.debugging
681
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
682
+ end
683
+ return data, status_code, headers
684
+ end
685
+
686
+ # Get List and Segment Members
687
+ # Gets all of the emails, phone numbers, and push tokens for profiles in a given list or segment
688
+ # @param list_or_segment_id [String]
689
+ # @param [Hash] opts the optional parameters
690
+ # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
691
+ # @return [Hash<String, Object>]
692
+ def get_members(list_or_segment_id, opts = {})
693
+ data, _status_code, _headers = get_members_with_http_info(list_or_segment_id, opts)
694
+ data
695
+ end
696
+
697
+ # Get List and Segment Members
698
+ # Gets all of the emails, phone numbers, and push tokens for profiles in a given list or segment
699
+ # @param list_or_segment_id [String]
700
+ # @param [Hash] opts the optional parameters
701
+ # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
702
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
703
+ def get_members_with_http_info(list_or_segment_id, opts = {})
704
+ if @api_client.config.debugging
705
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_members ...'
706
+ end
707
+ # verify the required parameter 'list_or_segment_id' is set
708
+ if @api_client.config.client_side_validation && list_or_segment_id.nil?
709
+ fail ArgumentError, "Missing the required parameter 'list_or_segment_id' when calling ListsSegmentsApi.get_members"
710
+ end
711
+ # resource path
712
+ local_var_path = '/v2/group/{list_or_segment_id}/members/all'.sub('{' + 'list_or_segment_id' + '}', CGI.escape(list_or_segment_id.to_s))
713
+
714
+ # query parameters
715
+ query_params = opts[:query_params] || {}
716
+ query_params[:'marker'] = opts[:'marker'] if !opts[:'marker'].nil?
717
+
718
+ # header parameters
719
+ header_params = opts[:header_params] || {}
720
+ # HTTP header 'Accept' (if needed)
721
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
722
+
723
+ # form parameters
724
+ form_params = opts[:form_params] || {}
725
+
726
+ # http body (model)
727
+ post_body = opts[:body]
728
+
729
+ # return_type
730
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
731
+
732
+ # auth_names
733
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
734
+
735
+ new_options = opts.merge(
736
+ :operation => :"ListsSegmentsApi.get_members",
737
+ :header_params => header_params,
738
+ :query_params => query_params,
739
+ :form_params => form_params,
740
+ :body => post_body,
741
+ :auth_names => auth_names,
742
+ :return_type => return_type
743
+ )
744
+
745
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
746
+ if @api_client.config.debugging
747
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
748
+ end
749
+ return data, status_code, headers
750
+ end
751
+
752
+ # Check if Profiles Are in a Segment
753
+ # Checks if one or more emails, phone numbers, or push tokens are in a given segment. No distinction is made between a person not being in a given segment, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
754
+ # @param segment_id [String]
755
+ # @param [Hash] opts the optional parameters
756
+ # @option opts [CheckMembershipRequest] :check_membership_request
757
+ # @return [Array<Hash<String, Object>>]
758
+ def get_segment_members(segment_id, opts = {})
759
+ data, _status_code, _headers = get_segment_members_with_http_info(segment_id, opts)
760
+ data
761
+ end
762
+
763
+ # Check if Profiles Are in a Segment
764
+ # Checks if one or more emails, phone numbers, or push tokens are in a given segment. No distinction is made between a person not being in a given segment, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
765
+ # @param segment_id [String]
766
+ # @param [Hash] opts the optional parameters
767
+ # @option opts [CheckMembershipRequest] :check_membership_request
768
+ # @return [Array<(Array<Hash<String, Object>>, Integer, Hash)>] Array<Hash<String, Object>> data, response status code and response headers
769
+ def get_segment_members_with_http_info(segment_id, opts = {})
770
+ if @api_client.config.debugging
771
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.get_segment_members ...'
772
+ end
773
+ # verify the required parameter 'segment_id' is set
774
+ if @api_client.config.client_side_validation && segment_id.nil?
775
+ fail ArgumentError, "Missing the required parameter 'segment_id' when calling ListsSegmentsApi.get_segment_members"
776
+ end
777
+ # resource path
778
+ local_var_path = '/v2/segment/{segment_id}/get-members'.sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s))
779
+
780
+ # query parameters
781
+ query_params = opts[:query_params] || {}
782
+
783
+ # header parameters
784
+ header_params = opts[:header_params] || {}
785
+ # HTTP header 'Accept' (if needed)
786
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
787
+ # HTTP header 'Content-Type'
788
+ content_type = @api_client.select_header_content_type(['application/json'])
789
+ if !content_type.nil?
790
+ header_params['Content-Type'] = content_type
791
+ end
792
+
793
+ # form parameters
794
+ form_params = opts[:form_params] || {}
795
+
796
+ # http body (model)
797
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'check_membership_request'])
798
+
799
+ # return_type
800
+ return_type = opts[:debug_return_type] || 'Array<Hash<String, Object>>'
801
+
802
+ # auth_names
803
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
804
+
805
+ new_options = opts.merge(
806
+ :operation => :"ListsSegmentsApi.get_segment_members",
807
+ :header_params => header_params,
808
+ :query_params => query_params,
809
+ :form_params => form_params,
810
+ :body => post_body,
811
+ :auth_names => auth_names,
812
+ :return_type => return_type
813
+ )
814
+
815
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
816
+ if @api_client.config.debugging
817
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#get_segment_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
818
+ end
819
+ return data, status_code, headers
820
+ end
821
+
822
+ # Remove Profiles From List
823
+ # Removes profiles from a list.
824
+ # @param list_id [String]
825
+ # @param [Hash] opts the optional parameters
826
+ # @option opts [InlineObject5] :inline_object5
827
+ # @return [nil]
828
+ def remove_members(list_id, opts = {})
829
+ remove_members_with_http_info(list_id, opts)
830
+ nil
831
+ end
832
+
833
+ # Remove Profiles From List
834
+ # Removes profiles from a list.
835
+ # @param list_id [String]
836
+ # @param [Hash] opts the optional parameters
837
+ # @option opts [InlineObject5] :inline_object5
838
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
839
+ def remove_members_with_http_info(list_id, opts = {})
840
+ if @api_client.config.debugging
841
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.remove_members ...'
842
+ end
843
+ # verify the required parameter 'list_id' is set
844
+ if @api_client.config.client_side_validation && list_id.nil?
845
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.remove_members"
846
+ end
847
+ # resource path
848
+ local_var_path = '/v2/list/{list_id}/members'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
849
+
850
+ # query parameters
851
+ query_params = opts[:query_params] || {}
852
+
853
+ # header parameters
854
+ header_params = opts[:header_params] || {}
855
+ # HTTP header 'Content-Type'
856
+ content_type = @api_client.select_header_content_type(['application/json'])
857
+ if !content_type.nil?
858
+ header_params['Content-Type'] = content_type
859
+ end
860
+
861
+ # form parameters
862
+ form_params = opts[:form_params] || {}
863
+
864
+ # http body (model)
865
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'inline_object5'])
866
+
867
+ # return_type
868
+ return_type = opts[:debug_return_type]
869
+
870
+ # auth_names
871
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
872
+
873
+ new_options = opts.merge(
874
+ :operation => :"ListsSegmentsApi.remove_members",
875
+ :header_params => header_params,
876
+ :query_params => query_params,
877
+ :form_params => form_params,
878
+ :body => post_body,
879
+ :auth_names => auth_names,
880
+ :return_type => return_type
881
+ )
882
+
883
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
884
+ if @api_client.config.debugging
885
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#remove_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
886
+ end
887
+ return data, status_code, headers
888
+ end
889
+
890
+ # Subscribe Profiles to List
891
+ # Subscribes profiles to a list. Profiles will be single or double opted into the specified list in accordance with that list’s settings. **Note:** If you have double opt-in enabled (default behavior), users will not be added to list until they opt-in, and so API will respond with an empty list: `[]`
892
+ # @param list_id [String]
893
+ # @param [Hash] opts the optional parameters
894
+ # @option opts [InlineObject3] :inline_object3
895
+ # @return [Array<Object>]
896
+ def subscribe(list_id, opts = {})
897
+ data, _status_code, _headers = subscribe_with_http_info(list_id, opts)
898
+ data
899
+ end
900
+
901
+ # Subscribe Profiles to List
902
+ # Subscribes profiles to a list. Profiles will be single or double opted into the specified list in accordance with that list’s settings. **Note:** If you have double opt-in enabled (default behavior), users will not be added to list until they opt-in, and so API will respond with an empty list: &#x60;[]&#x60;
903
+ # @param list_id [String]
904
+ # @param [Hash] opts the optional parameters
905
+ # @option opts [InlineObject3] :inline_object3
906
+ # @return [Array<(Array<Object>, Integer, Hash)>] Array<Object> data, response status code and response headers
907
+ def subscribe_with_http_info(list_id, opts = {})
908
+ if @api_client.config.debugging
909
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.subscribe ...'
910
+ end
911
+ # verify the required parameter 'list_id' is set
912
+ if @api_client.config.client_side_validation && list_id.nil?
913
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.subscribe"
914
+ end
915
+ # resource path
916
+ local_var_path = '/v2/list/{list_id}/subscribe'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
917
+
918
+ # query parameters
919
+ query_params = opts[:query_params] || {}
920
+
921
+ # header parameters
922
+ header_params = opts[:header_params] || {}
923
+ # HTTP header 'Accept' (if needed)
924
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
925
+ # HTTP header 'Content-Type'
926
+ content_type = @api_client.select_header_content_type(['application/json'])
927
+ if !content_type.nil?
928
+ header_params['Content-Type'] = content_type
929
+ end
930
+
931
+ # form parameters
932
+ form_params = opts[:form_params] || {}
933
+
934
+ # http body (model)
935
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'inline_object3'])
936
+
937
+ # return_type
938
+ return_type = opts[:debug_return_type] || 'Array<Object>'
939
+
940
+ # auth_names
941
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
942
+
943
+ new_options = opts.merge(
944
+ :operation => :"ListsSegmentsApi.subscribe",
945
+ :header_params => header_params,
946
+ :query_params => query_params,
947
+ :form_params => form_params,
948
+ :body => post_body,
949
+ :auth_names => auth_names,
950
+ :return_type => return_type
951
+ )
952
+
953
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
954
+ if @api_client.config.debugging
955
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#subscribe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
956
+ end
957
+ return data, status_code, headers
958
+ end
959
+
960
+ # Unsubscribe Profiles From List
961
+ # Unsubscribes and removes profiles from a list.
962
+ # @param list_id [String]
963
+ # @param [Hash] opts the optional parameters
964
+ # @option opts [Hash<String, Object>] :request_body Unsubscribe and remove profiles from a list.
965
+ # @return [nil]
966
+ def unsubscribe(list_id, opts = {})
967
+ unsubscribe_with_http_info(list_id, opts)
968
+ nil
969
+ end
970
+
971
+ # Unsubscribe Profiles From List
972
+ # Unsubscribes and removes profiles from a list.
973
+ # @param list_id [String]
974
+ # @param [Hash] opts the optional parameters
975
+ # @option opts [Hash<String, Object>] :request_body Unsubscribe and remove profiles from a list.
976
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
977
+ def unsubscribe_with_http_info(list_id, opts = {})
978
+ if @api_client.config.debugging
979
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.unsubscribe ...'
980
+ end
981
+ # verify the required parameter 'list_id' is set
982
+ if @api_client.config.client_side_validation && list_id.nil?
983
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.unsubscribe"
984
+ end
985
+ # resource path
986
+ local_var_path = '/v2/list/{list_id}/subscribe'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
987
+
988
+ # query parameters
989
+ query_params = opts[:query_params] || {}
990
+
991
+ # header parameters
992
+ header_params = opts[:header_params] || {}
993
+ # HTTP header 'Content-Type'
994
+ content_type = @api_client.select_header_content_type(['application/json'])
995
+ if !content_type.nil?
996
+ header_params['Content-Type'] = content_type
997
+ end
998
+
999
+ # form parameters
1000
+ form_params = opts[:form_params] || {}
1001
+
1002
+ # http body (model)
1003
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'request_body'])
1004
+
1005
+ # return_type
1006
+ return_type = opts[:debug_return_type]
1007
+
1008
+ # auth_names
1009
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1010
+
1011
+ new_options = opts.merge(
1012
+ :operation => :"ListsSegmentsApi.unsubscribe",
1013
+ :header_params => header_params,
1014
+ :query_params => query_params,
1015
+ :form_params => form_params,
1016
+ :body => post_body,
1017
+ :auth_names => auth_names,
1018
+ :return_type => return_type
1019
+ )
1020
+
1021
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1022
+ if @api_client.config.debugging
1023
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#unsubscribe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1024
+ end
1025
+ return data, status_code, headers
1026
+ end
1027
+
1028
+ # Update List Name
1029
+ # Updates a list's name.
1030
+ # @param list_id [String]
1031
+ # @param list_name [String]
1032
+ # @param [Hash] opts the optional parameters
1033
+ # @return [nil]
1034
+ def update_list_name(list_id, list_name, opts = {})
1035
+ update_list_name_with_http_info(list_id, list_name, opts)
1036
+ nil
1037
+ end
1038
+
1039
+ # Update List Name
1040
+ # Updates a list&#39;s name.
1041
+ # @param list_id [String]
1042
+ # @param list_name [String]
1043
+ # @param [Hash] opts the optional parameters
1044
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1045
+ def update_list_name_with_http_info(list_id, list_name, opts = {})
1046
+ if @api_client.config.debugging
1047
+ @api_client.config.logger.debug 'Calling API: ListsSegmentsApi.update_list_name ...'
1048
+ end
1049
+ # verify the required parameter 'list_id' is set
1050
+ if @api_client.config.client_side_validation && list_id.nil?
1051
+ fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsSegmentsApi.update_list_name"
1052
+ end
1053
+ # verify the required parameter 'list_name' is set
1054
+ if @api_client.config.client_side_validation && list_name.nil?
1055
+ fail ArgumentError, "Missing the required parameter 'list_name' when calling ListsSegmentsApi.update_list_name"
1056
+ end
1057
+ # resource path
1058
+ local_var_path = '/v2/list/{list_id}'.sub('{' + 'list_id' + '}', CGI.escape(list_id.to_s))
1059
+
1060
+ # query parameters
1061
+ query_params = opts[:query_params] || {}
1062
+
1063
+ # header parameters
1064
+ header_params = opts[:header_params] || {}
1065
+ # HTTP header 'Content-Type'
1066
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
1067
+ if !content_type.nil?
1068
+ header_params['Content-Type'] = content_type
1069
+ end
1070
+
1071
+ # form parameters
1072
+ form_params = opts[:form_params] || {}
1073
+ form_params['list_name'] = list_name
1074
+
1075
+ # http body (model)
1076
+ post_body = opts[:body]
1077
+
1078
+ # return_type
1079
+ return_type = opts[:debug_return_type]
1080
+
1081
+ # auth_names
1082
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
1083
+
1084
+ new_options = opts.merge(
1085
+ :operation => :"ListsSegmentsApi.update_list_name",
1086
+ :header_params => header_params,
1087
+ :query_params => query_params,
1088
+ :form_params => form_params,
1089
+ :body => post_body,
1090
+ :auth_names => auth_names,
1091
+ :return_type => return_type
1092
+ )
1093
+
1094
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1095
+ if @api_client.config.debugging
1096
+ @api_client.config.logger.debug "API called: ListsSegmentsApi#update_list_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1097
+ end
1098
+ return data, status_code, headers
1099
+ end
1100
+ end
1101
+ end