Class: SibApiV3Sdk::CRMApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CRMApi

Returns a new instance of CRMApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/crm_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/crm_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#crm_files_id_data_get(id, opts = {}) ⇒ FileData

Get file details.

Parameters:

  • id

    File id to get file data.

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

    the optional parameters

Returns:



37
38
39
40
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 37

def crm_files_id_data_get(id, opts = {})
  data, _status_code, _headers = crm_files_id_data_get_with_http_info(id, opts)
  data
end

#crm_files_id_data_get_with_http_info(id, opts = {}) ⇒ Array<(FileData, Fixnum, Hash)>

Get file details

Parameters:

  • id

    File id to get file data.

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

    the optional parameters

Returns:

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

    FileData data, response status code and response headers



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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 46

def crm_files_id_data_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_files_id_data_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_files_id_data_get"
  end
  # resource path
  local_var_path = '/crm/files/{id}/data'.sub('{' + 'id' + '}', 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 => 'FileData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_files_id_data_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_files_id_delete(id, opts = {}) ⇒ nil

Delete a file

Parameters:

  • id

    File id to delete.

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

    the optional parameters

Returns:

  • (nil)


89
90
91
92
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 89

def crm_files_id_delete(id, opts = {})
  crm_files_id_delete_with_http_info(id, opts)
  nil
end

#crm_files_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a file

Parameters:

  • id

    File id to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
132
133
134
135
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 98

def crm_files_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_files_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_files_id_delete"
  end
  # resource path
  local_var_path = '/crm/files/{id}'.sub('{' + 'id' + '}', 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: CRMApi#crm_files_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_files_id_get(id, opts = {}) ⇒ nil

Download a file

Parameters:

  • id

    File id to download.

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

    the optional parameters

Returns:

  • (nil)


140
141
142
143
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 140

def crm_files_id_get(id, opts = {})
  crm_files_id_get_with_http_info(id, opts)
  nil
end

#crm_files_id_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Download a file

Parameters:

  • id

    File id to download.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
183
184
185
186
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 149

def crm_files_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_files_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_files_id_get"
  end
  # resource path
  local_var_path = '/crm/files/{id}'.sub('{' + 'id' + '}', 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_files_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_files_post(file, opts = {}) ⇒ FileData

Upload a file

Parameters:

  • file

    File data to create a file.

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

    the optional parameters

Options Hash (opts):

  • :deals_ids (Array<String>)

    Deal ids linked to a file

Returns:



192
193
194
195
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 192

def crm_files_post(file, opts = {})
  data, _status_code, _headers = crm_files_post_with_http_info(file, opts)
  data
end

#crm_files_post_with_http_info(file, opts = {}) ⇒ Array<(FileData, Fixnum, Hash)>

Upload a file

Parameters:

  • file

    File data to create a file.

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

    the optional parameters

Options Hash (opts):

  • :deals_ids (Array<String>)

    Deal ids linked to a file

Returns:

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

    FileData 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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 202

def crm_files_post_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_files_post ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling CRMApi.crm_files_post"
  end
  # resource path
  local_var_path = '/crm/files'

  # 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(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file
  form_params['dealsIds'] = @api_client.build_collection_param(opts[:'deals_ids'], :csv) if !opts[:'deals_ids'].nil?

  # http body (model)
  post_body = nil
  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 => 'FileData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_files_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_notes_id_delete(id, opts = {}) ⇒ nil

Delete a note

Parameters:

  • id

    Note ID to delete

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

    the optional parameters

Returns:

  • (nil)


247
248
249
250
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 247

def crm_notes_id_delete(id, opts = {})
  crm_notes_id_delete_with_http_info(id, opts)
  nil
end

#crm_notes_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a note

Parameters:

  • id

    Note ID to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
288
289
290
291
292
293
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 256

def crm_notes_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_notes_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_notes_id_delete"
  end
  # resource path
  local_var_path = '/crm/notes/{id}'.sub('{' + 'id' + '}', 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: CRMApi#crm_notes_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_notes_id_get(id, opts = {}) ⇒ Note

Get a note

Parameters:

  • id

    Note ID to get

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

    the optional parameters

Returns:



298
299
300
301
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 298

def crm_notes_id_get(id, opts = {})
  data, _status_code, _headers = crm_notes_id_get_with_http_info(id, opts)
  data
end

#crm_notes_id_get_with_http_info(id, opts = {}) ⇒ Array<(Note, Fixnum, Hash)>

Get a note

Parameters:

  • id

    Note ID to get

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

    the optional parameters

Returns:

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

    Note data, response status code and response headers



307
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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 307

def crm_notes_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_notes_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_notes_id_get"
  end
  # resource path
  local_var_path = '/crm/notes/{id}'.sub('{' + 'id' + '}', 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 => 'Note')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_notes_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_notes_id_patch(id, body, opts = {}) ⇒ Note

Update a note

Parameters:

  • id

    Note ID to update

  • body

    Note data to update a note

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

    the optional parameters

Returns:



351
352
353
354
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 351

def crm_notes_id_patch(id, body, opts = {})
  data, _status_code, _headers = crm_notes_id_patch_with_http_info(id, body, opts)
  data
end

#crm_notes_id_patch_with_http_info(id, body, opts = {}) ⇒ Array<(Note, Fixnum, Hash)>

Update a note

Parameters:

  • id

    Note ID to update

  • body

    Note data to update a note

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

    the optional parameters

Returns:

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

    Note data, response status code and response headers



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 361

def crm_notes_id_patch_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_notes_id_patch ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_notes_id_patch"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.crm_notes_id_patch"
  end
  # resource path
  local_var_path = '/crm/notes/{id}'.sub('{' + 'id' + '}', 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(body)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Note')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_notes_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_notes_post(body, opts = {}) ⇒ Note

Create a note

Parameters:

  • body

    Note data to create a note.

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

    the optional parameters

Returns:



408
409
410
411
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 408

def crm_notes_post(body, opts = {})
  data, _status_code, _headers = crm_notes_post_with_http_info(body, opts)
  data
end

#crm_notes_post_with_http_info(body, opts = {}) ⇒ Array<(Note, Fixnum, Hash)>

Create a note

Parameters:

  • body

    Note data to create a note.

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

    the optional parameters

Returns:

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

    Note data, response status code and response headers



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 417

def crm_notes_post_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_notes_post ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.crm_notes_post"
  end
  # resource path
  local_var_path = '/crm/notes'

  # 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(body)
  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 => 'Note')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_notes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_tasks_id_delete(id, opts = {}) ⇒ nil

Delete a task

Parameters:

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

    the optional parameters

Returns:

  • (nil)


460
461
462
463
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 460

def crm_tasks_id_delete(id, opts = {})
  crm_tasks_id_delete_with_http_info(id, opts)
  nil
end

#crm_tasks_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a task

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 469

def crm_tasks_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_tasks_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_tasks_id_delete"
  end
  # resource path
  local_var_path = '/crm/tasks/{id}'.sub('{' + 'id' + '}', 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: CRMApi#crm_tasks_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_tasks_id_get(id, opts = {}) ⇒ Task

Get a task

Parameters:

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

    the optional parameters

Returns:



511
512
513
514
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 511

def crm_tasks_id_get(id, opts = {})
  data, _status_code, _headers = crm_tasks_id_get_with_http_info(id, opts)
  data
end

#crm_tasks_id_get_with_http_info(id, opts = {}) ⇒ Array<(Task, Fixnum, Hash)>

Get a task

Parameters:

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

    the optional parameters

Returns:

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

    Task data, response status code and response headers



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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 520

def crm_tasks_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_tasks_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_tasks_id_get"
  end
  # resource path
  local_var_path = '/crm/tasks/{id}'.sub('{' + 'id' + '}', 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 => 'Task')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_tasks_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_tasks_id_patch(id, body, opts = {}) ⇒ Task

Update a task

Parameters:

  • id
  • body

    Updated task details.

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

    the optional parameters

Returns:



564
565
566
567
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 564

def crm_tasks_id_patch(id, body, opts = {})
  data, _status_code, _headers = crm_tasks_id_patch_with_http_info(id, body, opts)
  data
end

#crm_tasks_id_patch_with_http_info(id, body, opts = {}) ⇒ Array<(Task, Fixnum, Hash)>

Update a task

Parameters:

  • id
  • body

    Updated task details.

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

    the optional parameters

Returns:

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

    Task data, response status code and response headers



574
575
576
577
578
579
580
581
582
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
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 574

def crm_tasks_id_patch_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_tasks_id_patch ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling CRMApi.crm_tasks_id_patch"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.crm_tasks_id_patch"
  end
  # resource path
  local_var_path = '/crm/tasks/{id}'.sub('{' + 'id' + '}', 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(body)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Task')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_tasks_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_tasks_post(body, opts = {}) ⇒ Task

Create a task

Parameters:

  • body

    Task name.

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

    the optional parameters

Returns:



621
622
623
624
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 621

def crm_tasks_post(body, opts = {})
  data, _status_code, _headers = crm_tasks_post_with_http_info(body, opts)
  data
end

#crm_tasks_post_with_http_info(body, opts = {}) ⇒ Array<(Task, Fixnum, Hash)>

Create a task

Parameters:

  • body

    Task name.

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

    the optional parameters

Returns:

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

    Task data, response status code and response headers



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 630

def crm_tasks_post_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_tasks_post ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.crm_tasks_post"
  end
  # resource path
  local_var_path = '/crm/tasks'

  # 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(body)
  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 => 'Task')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_tasks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crm_tasktypes_get(opts = {}) ⇒ TaskTypes

Get all task types

Parameters:

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

    the optional parameters

Returns:



672
673
674
675
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 672

def crm_tasktypes_get(opts = {})
  data, _status_code, _headers = crm_tasktypes_get_with_http_info(opts)
  data
end

#crm_tasktypes_get_with_http_info(opts = {}) ⇒ Array<(TaskTypes, Fixnum, Hash)>

Get all task types

Parameters:

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

    the optional parameters

Returns:

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

    TaskTypes data, response status code and response headers



680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/sib-api-v3-sdk/api/crm_api.rb', line 680

def crm_tasktypes_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.crm_tasktypes_get ...'
  end
  # resource path
  local_var_path = '/crm/tasktypes'

  # 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 => 'TaskTypes')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#crm_tasktypes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#setUserAgent(user_agent) ⇒ Object

Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#VERSION/ruby



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

def setUserAgent(user_agent)
  @user_agent = user_agent
  if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_')
    @api_client.default_headers['User-Agent'] = @user_agent
  end
end