Class: SibApiV3Sdk::ListsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/sib-api-v3-sdk/api/lists_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ListsApi

Returns a new instance of ListsApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_contact_to_list(list_id, contact_emails, opts = {}) ⇒ PostContactInfo

Add existing contacts to a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 27

def add_contact_to_list(list_id, contact_emails, opts = {})
  data, _status_code, _headers = add_contact_to_list_with_http_info(list_id, contact_emails, opts)
  data
end

#add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) ⇒ Array<(PostContactInfo, Fixnum, Hash)>

Add existing contacts to a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PostContactInfo, Fixnum, Hash)>)

    PostContactInfo data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 37

def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.add_contact_to_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.add_contact_to_list"
  end
  # verify the required parameter 'contact_emails' is set
  if @api_client.config.client_side_validation && contact_emails.nil?
    fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.add_contact_to_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(contact_emails)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PostContactInfo')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_list(create_list, opts = {}) ⇒ CreateModel

Create a list

Parameters:

  • create_list

    Values to create a list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



84
85
86
87
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 84

def create_list(create_list, opts = {})
  data, _status_code, _headers = create_list_with_http_info(create_list, opts)
  data
end

#create_list_with_http_info(create_list, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>

Create a list

Parameters:

  • create_list

    Values to create a list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateModel, Fixnum, Hash)>)

    CreateModel data, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 93

def create_list_with_http_info(create_list, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.create_list ...'
  end
  # verify the required parameter 'create_list' is set
  if @api_client.config.client_side_validation && create_list.nil?
    fail ArgumentError, "Missing the required parameter 'create_list' when calling ListsApi.create_list"
  end
  # resource path
  local_var_path = '/contacts/lists'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_list)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_list(list_id, opts = {}) ⇒ nil

Delete a list

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


136
137
138
139
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 136

def delete_list(list_id, opts = {})
  delete_list_with_http_info(list_id, opts)
  nil
end

#delete_list_with_http_info(list_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a list

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 145

def delete_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.delete_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.delete_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contacts_from_list(list_id, opts = {}) ⇒ GetContacts

Get contacts in a list

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



190
191
192
193
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 190

def get_contacts_from_list(list_id, opts = {})
  data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts)
  data
end

#get_contacts_from_list_with_http_info(list_id, opts = {}) ⇒ Array<(GetContacts, Fixnum, Hash)>

Get contacts in a list

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

  • (Array<(GetContacts, Fixnum, Hash)>)

    GetContacts data, response status code and response headers



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 202

def get_contacts_from_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_contacts_from_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.get_contacts_from_list"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_contacts_from_list, must be smaller than or equal to 500.'
  end

  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetContacts')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder_lists(folder_id, opts = {}) ⇒ GetFolderLists

Get lists in a folder

Parameters:

  • folder_id

    Id of the folder

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 10)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



254
255
256
257
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 254

def get_folder_lists(folder_id, opts = {})
  data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts)
  data
end

#get_folder_lists_with_http_info(folder_id, opts = {}) ⇒ Array<(GetFolderLists, Fixnum, Hash)>

Get lists in a folder

Parameters:

  • folder_id

    Id of the folder

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

  • (Array<(GetFolderLists, Fixnum, Hash)>)

    GetFolderLists data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 265

def get_folder_lists_with_http_info(folder_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_folder_lists ...'
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling ListsApi.get_folder_lists"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_folder_lists, must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetFolderLists')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list(list_id, opts = {}) ⇒ GetExtendedList

Get a list’s details

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



314
315
316
317
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 314

def get_list(list_id, opts = {})
  data, _status_code, _headers = get_list_with_http_info(list_id, opts)
  data
end

#get_list_with_http_info(list_id, opts = {}) ⇒ Array<(GetExtendedList, Fixnum, Hash)>

Get a list&#39;s details

Parameters:

  • list_id

    Id of the list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetExtendedList, Fixnum, Hash)>)

    GetExtendedList data, response status code and response headers



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 323

def get_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.get_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetExtendedList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_lists(opts = {}) ⇒ GetLists

Get all the lists

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 10)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



367
368
369
370
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 367

def get_lists(opts = {})
  data, _status_code, _headers = get_lists_with_http_info(opts)
  data
end

#get_lists_with_http_info(opts = {}) ⇒ Array<(GetLists, Fixnum, Hash)>

Get all the lists

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

  • (Array<(GetLists, Fixnum, Hash)>)

    GetLists data, response status code and response headers



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 377

def get_lists_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_lists ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_lists, must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/contacts/lists'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetLists')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_contact_from_list(list_id, contact_emails, opts = {}) ⇒ PostContactInfo

Delete a contact from a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



423
424
425
426
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 423

def remove_contact_from_list(list_id, contact_emails, opts = {})
  data, _status_code, _headers = remove_contact_from_list_with_http_info(list_id, contact_emails, opts)
  data
end

#remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) ⇒ Array<(PostContactInfo, Fixnum, Hash)>

Delete a contact from a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PostContactInfo, Fixnum, Hash)>)

    PostContactInfo data, response status code and response headers



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 433

def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.remove_contact_from_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.remove_contact_from_list"
  end
  # verify the required parameter 'contact_emails' is set
  if @api_client.config.client_side_validation && contact_emails.nil?
    fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.remove_contact_from_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(contact_emails)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PostContactInfo')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_list(list_id, update_list, opts = {}) ⇒ nil

Update a list

Parameters:

  • list_id

    Id of the list

  • update_list

    Values to update a list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


481
482
483
484
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 481

def update_list(list_id, update_list, opts = {})
  update_list_with_http_info(list_id, update_list, opts)
  nil
end

#update_list_with_http_info(list_id, update_list, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a list

Parameters:

  • list_id

    Id of the list

  • update_list

    Values to update a list

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/sib-api-v3-sdk/api/lists_api.rb', line 491

def update_list_with_http_info(list_id, update_list, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.update_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.update_list"
  end
  # verify the required parameter 'update_list' is set
  if @api_client.config.client_side_validation && update_list.nil?
    fail ArgumentError, "Missing the required parameter 'update_list' when calling ListsApi.update_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_list)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end