Class: Hubspot::Crm::Lists::ListsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/crm/lists/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.



21
22
23
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 21

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



19
20
21
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#create(list_create_request, opts = {}) ⇒ ListCreateResponse

Create List Create a new list with the provided object list definition.

Parameters:

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 29

def create(list_create_request, opts = {})
  data, _status_code, _headers = create_with_http_info(list_create_request, opts)
  data
end

#create_with_http_info(list_create_request, opts = {}) ⇒ Array<(ListCreateResponse, Integer, Hash)>

Create List Create a new list with the provided object list definition.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ListCreateResponse, Integer, Hash)>)

    ListCreateResponse data, response status code and response headers



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
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 39

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

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(list_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ListCreateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.create",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#do_search(list_search_request, opts = {}) ⇒ ListSearchResponse

Search Lists Search lists by list name or page through all lists by providing an empty ‘query` value.

Parameters:

  • list_search_request (ListSearchRequest)

    The IDs of the records to add and/or remove from the list.

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

    the optional parameters

Returns:



97
98
99
100
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 97

def do_search(list_search_request, opts = {})
  data, _status_code, _headers = do_search_with_http_info(list_search_request, opts)
  data
end

#do_search_with_http_info(list_search_request, opts = {}) ⇒ Array<(ListSearchResponse, Integer, Hash)>

Search Lists Search lists by list name or page through all lists by providing an empty &#x60;query&#x60; value.

Parameters:

  • list_search_request (ListSearchRequest)

    The IDs of the records to add and/or remove from the list.

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

    the optional parameters

Returns:

  • (Array<(ListSearchResponse, Integer, Hash)>)

    ListSearchResponse data, response status code and response headers



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 107

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

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(list_search_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ListSearchResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.do_search",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#do_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all(opts = {}) ⇒ ListsByIdResponse

Fetch Multiple Lists Fetch multiple lists in a single request by **ILS list ID**. The response will include the definitions of all lists that exist for the ‘listIds` provided.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :list_ids (Array<Integer>)

    The **ILS IDs** of the lists to fetch.

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definitions should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:



166
167
168
169
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 166

def get_all(opts = {})
  data, _status_code, _headers = get_all_with_http_info(opts)
  data
end

#get_all_with_http_info(opts = {}) ⇒ Array<(ListsByIdResponse, Integer, Hash)>

Fetch Multiple Lists Fetch multiple lists in a single request by **ILS list ID**. The response will include the definitions of all lists that exist for the &#x60;listIds&#x60; provided.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :list_ids (Array<Integer>)

    The **ILS IDs** of the lists to fetch.

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definitions should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:

  • (Array<(ListsByIdResponse, Integer, Hash)>)

    ListsByIdResponse data, response status code and response headers



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 177

def get_all_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_all ...'
  end
  # resource path
  local_var_path = '/crm/v3/lists/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'listIds'] = @api_client.build_collection_param(opts[:'list_ids'], :multi) if !opts[:'list_ids'].nil?
  query_params[:'includeFilters'] = opts[:'include_filters'] if !opts[:'include_filters'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListsByIdResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.get_all",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_id(list_id, opts = {}) ⇒ ListFetchResponse

Fetch List by ID Fetch a single list by **ILS list ID**.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to fetch.

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

    the optional parameters

Options Hash (opts):

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:



229
230
231
232
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 229

def get_by_id(list_id, opts = {})
  data, _status_code, _headers = get_by_id_with_http_info(list_id, opts)
  data
end

#get_by_id_with_http_info(list_id, opts = {}) ⇒ Array<(ListFetchResponse, Integer, Hash)>

Fetch List by ID Fetch a single list by **ILS list ID**.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to fetch.

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

    the optional parameters

Options Hash (opts):

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:

  • (Array<(ListFetchResponse, Integer, Hash)>)

    ListFetchResponse data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 240

def get_by_id_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_by_id ...'
  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_by_id"
  end
  # resource path
  local_var_path = '/crm/v3/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeFilters'] = opts[:'include_filters'] if !opts[:'include_filters'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFetchResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.get_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_name(list_name, object_type_id, opts = {}) ⇒ ListFetchResponse

Fetch List by Name Fetch a single list by list name and object type.

Parameters:

  • list_name (String)

    The name of the list to fetch. This is not case sensitive.

  • object_type_id (String)

    The object type ID of the object types stored by the list to fetch. For example, &#x60;0-1&#x60; for a &#x60;CONTACT&#x60; list.

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

    the optional parameters

Options Hash (opts):

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:



296
297
298
299
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 296

def get_by_name(list_name, object_type_id, opts = {})
  data, _status_code, _headers = get_by_name_with_http_info(list_name, object_type_id, opts)
  data
end

#get_by_name_with_http_info(list_name, object_type_id, opts = {}) ⇒ Array<(ListFetchResponse, Integer, Hash)>

Fetch List by Name Fetch a single list by list name and object type.

Parameters:

  • list_name (String)

    The name of the list to fetch. This is not case sensitive.

  • object_type_id (String)

    The object type ID of the object types stored by the list to fetch. For example, &#x60;0-1&#x60; for a &#x60;CONTACT&#x60; list.

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

    the optional parameters

Options Hash (opts):

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:

  • (Array<(ListFetchResponse, Integer, Hash)>)

    ListFetchResponse data, response status code and response headers



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
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
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 308

def get_by_name_with_http_info(list_name, object_type_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.get_by_name ...'
  end
  # verify the required parameter 'list_name' is set
  if @api_client.config.client_side_validation && list_name.nil?
    fail ArgumentError, "Missing the required parameter 'list_name' when calling ListsApi.get_by_name"
  end
  # verify the required parameter 'object_type_id' is set
  if @api_client.config.client_side_validation && object_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'object_type_id' when calling ListsApi.get_by_name"
  end
  # resource path
  local_var_path = '/crm/v3/lists/object-type-id/{objectTypeId}/name/{listName}'.sub('{' + 'listName' + '}', CGI.escape(list_name.to_s)).sub('{' + 'objectTypeId' + '}', CGI.escape(object_type_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeFilters'] = opts[:'include_filters'] if !opts[:'include_filters'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFetchResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.get_by_name",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#get_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete a List Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to delete.

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

    the optional parameters

Returns:

  • (nil)


366
367
368
369
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 366

def remove(list_id, opts = {})
  remove_with_http_info(list_id, opts)
  nil
end

#remove_with_http_info(list_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a List Delete a list by **ILS list ID**. Lists deleted through this endpoint can be restored up to 90-days following the delete. After 90-days, the list is purged and can no longer be restored.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



376
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
418
419
420
421
422
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 376

def remove_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.remove ...'
  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"
  end
  # resource path
  local_var_path = '/crm/v3/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.remove",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Restore a List Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to restore.

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

    the optional parameters

Returns:

  • (nil)


429
430
431
432
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 429

def restore(list_id, opts = {})
  restore_with_http_info(list_id, opts)
  nil
end

#restore_with_http_info(list_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Restore a List Restore a previously deleted list by **ILS list ID**. Deleted lists are eligible to be restored up-to 90-days after the list has been deleted.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to restore.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
476
477
478
479
480
481
482
483
484
485
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 439

def restore_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.restore ...'
  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.restore"
  end
  # resource path
  local_var_path = '/crm/v3/lists/{listId}/restore'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.restore",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#restore\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_list_filters(list_id, list_filter_update_request, opts = {}) ⇒ ListUpdateResponse

Update List Filter Definition Update the filter branch definition of a ‘DYNAMIC` list. Once updated, the list memberships will be re-evaluated and updated to match the new definition.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to update.

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

    the optional parameters

Options Hash (opts):

  • :enroll_objects_in_workflows (Boolean)

    A flag indicating whether or not the memberships added to the list as a result of the filter change should be enrolled in workflows that are relevant to this list. (default to false)

Returns:



494
495
496
497
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 494

def update_list_filters(list_id, list_filter_update_request, opts = {})
  data, _status_code, _headers = update_list_filters_with_http_info(list_id, list_filter_update_request, opts)
  data
end

#update_list_filters_with_http_info(list_id, list_filter_update_request, opts = {}) ⇒ Array<(ListUpdateResponse, Integer, Hash)>

Update List Filter Definition Update the filter branch definition of a &#x60;DYNAMIC&#x60; list. Once updated, the list memberships will be re-evaluated and updated to match the new definition.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to update.

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

    the optional parameters

Options Hash (opts):

  • :enroll_objects_in_workflows (Boolean)

    A flag indicating whether or not the memberships added to the list as a result of the filter change should be enrolled in workflows that are relevant to this list. (default to false)

Returns:

  • (Array<(ListUpdateResponse, Integer, Hash)>)

    ListUpdateResponse data, response status code and response headers



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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 506

def update_list_filters_with_http_info(list_id, list_filter_update_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.update_list_filters ...'
  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_filters"
  end
  # verify the required parameter 'list_filter_update_request' is set
  if @api_client.config.client_side_validation && list_filter_update_request.nil?
    fail ArgumentError, "Missing the required parameter 'list_filter_update_request' when calling ListsApi.update_list_filters"
  end
  # resource path
  local_var_path = '/crm/v3/lists/{listId}/update-list-filters'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'enrollObjectsInWorkflows'] = opts[:'enroll_objects_in_workflows'] if !opts[:'enroll_objects_in_workflows'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(list_filter_update_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ListUpdateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.update_list_filters",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#update_list_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_name(list_id, opts = {}) ⇒ ListUpdateResponse

Update List Name Update the name of a list. The name must be globally unique relative to all other public lists in the portal.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to update.

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

    the optional parameters

Options Hash (opts):

  • :list_name (String)

    The name to update the list to.

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:



571
572
573
574
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 571

def update_name(list_id, opts = {})
  data, _status_code, _headers = update_name_with_http_info(list_id, opts)
  data
end

#update_name_with_http_info(list_id, opts = {}) ⇒ Array<(ListUpdateResponse, Integer, Hash)>

Update List Name Update the name of a list. The name must be globally unique relative to all other public lists in the portal.

Parameters:

  • list_id (Integer)

    The **ILS ID** of the list to update.

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

    the optional parameters

Options Hash (opts):

  • :list_name (String)

    The name to update the list to.

  • :include_filters (Boolean)

    A flag indicating whether or not the response object list definition should include a filter branch definition. By default, object list definitions will not have their filter branch definitions included in the response. (default to false)

Returns:

  • (Array<(ListUpdateResponse, Integer, Hash)>)

    ListUpdateResponse data, response status code and response headers



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/hubspot/codegen/crm/lists/api/lists_api.rb', line 583

def update_name_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ListsApi.update_name ...'
  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_name"
  end
  # resource path
  local_var_path = '/crm/v3/lists/{listId}/update-list-name'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'listName'] = opts[:'list_name'] if !opts[:'list_name'].nil?
  query_params[:'includeFilters'] = opts[:'include_filters'] if !opts[:'include_filters'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListUpdateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ListsApi.update_name",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ListsApi#update_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end