Class: Spatio::ContactsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/spatio-sdk/api/contacts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ContactsApi

Returns a new instance of ContactsApi.



19
20
21
# File 'lib/spatio-sdk/api/contacts_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/spatio-sdk/api/contacts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#assign_contact_category(id, assign_contact_category_request, opts = {}) ⇒ nil

Assign a category to a contact.

Parameters:

Returns:

  • (nil)


27
28
29
30
# File 'lib/spatio-sdk/api/contacts_api.rb', line 27

def assign_contact_category(id, assign_contact_category_request, opts = {})
  assign_contact_category_with_http_info(id, assign_contact_category_request, opts)
  nil
end

#assign_contact_category_with_http_info(id, assign_contact_category_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Assign a category to a contact.

Parameters:

Returns:

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

    nil, 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
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/spatio-sdk/api/contacts_api.rb', line 37

def assign_contact_category_with_http_info(id, assign_contact_category_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.assign_contact_category ...'
  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 ContactsApi.assign_contact_category"
  end
  # verify the required parameter 'assign_contact_category_request' is set
  if @api_client.config.client_side_validation && assign_contact_category_request.nil?
    fail ArgumentError, "Missing the required parameter 'assign_contact_category_request' when calling ContactsApi.assign_contact_category"
  end
  # resource path
  local_var_path = '/v1/contacts/{id}/categories'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['Accept']
  # 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(assign_contact_category_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"ContactsApi.assign_contact_category",
    :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: ContactsApi#assign_contact_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_contact(create_contact_request, opts = {}) ⇒ Contact

Create a contact.

Parameters:

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

    the optional parameters

Returns:



98
99
100
101
# File 'lib/spatio-sdk/api/contacts_api.rb', line 98

def create_contact(create_contact_request, opts = {})
  data, _status_code, _headers = create_contact_with_http_info(create_contact_request, opts)
  data
end

#create_contact_category(create_contact_category_request, opts = {}) ⇒ ContactCategory

Create a contact category.

Parameters:

Returns:



164
165
166
167
# File 'lib/spatio-sdk/api/contacts_api.rb', line 164

def create_contact_category(create_contact_category_request, opts = {})
  data, _status_code, _headers = create_contact_category_with_http_info(create_contact_category_request, opts)
  data
end

#create_contact_category_with_http_info(create_contact_category_request, opts = {}) ⇒ Array<(ContactCategory, Integer, Hash)>

Create a contact category.

Parameters:

Returns:

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

    ContactCategory data, response status code and response headers



173
174
175
176
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
222
223
224
# File 'lib/spatio-sdk/api/contacts_api.rb', line 173

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

  # 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']) unless header_params['Accept']
  # 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(create_contact_category_request)

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.create_contact_category",
    :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: ContactsApi#create_contact_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_contact_with_http_info(create_contact_request, opts = {}) ⇒ Array<(Contact, Integer, Hash)>

Create a contact.

Parameters:

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

    the optional parameters

Returns:

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

    Contact 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/spatio-sdk/api/contacts_api.rb', line 107

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

  # 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']) unless header_params['Accept']
  # 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(create_contact_request)

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.create_contact",
    :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: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete a contact.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


230
231
232
233
# File 'lib/spatio-sdk/api/contacts_api.rb', line 230

def delete_contact(id, opts = {})
  delete_contact_with_http_info(id, opts)
  nil
end

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

Delete a category.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


291
292
293
294
# File 'lib/spatio-sdk/api/contacts_api.rb', line 291

def delete_contact_category(id, opts = {})
  delete_contact_category_with_http_info(id, opts)
  nil
end

#delete_contact_category_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a category.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



300
301
302
303
304
305
306
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
346
# File 'lib/spatio-sdk/api/contacts_api.rb', line 300

def delete_contact_category_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact_category ...'
  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 ContactsApi.delete_contact_category"
  end
  # resource path
  local_var_path = '/v1/contacts/categories/{id}'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['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] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ContactsApi.delete_contact_category",
    :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: ContactsApi#delete_contact_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_contact_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a contact.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



239
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
# File 'lib/spatio-sdk/api/contacts_api.rb', line 239

def delete_contact_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact ...'
  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 ContactsApi.delete_contact"
  end
  # resource path
  local_var_path = '/v1/contacts/{id}'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['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] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ContactsApi.delete_contact",
    :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: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contact(id, opts = {}) ⇒ Contact

Fetch a contact.

Parameters:

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

    the optional parameters

Returns:



352
353
354
355
# File 'lib/spatio-sdk/api/contacts_api.rb', line 352

def get_contact(id, opts = {})
  data, _status_code, _headers = get_contact_with_http_info(id, opts)
  data
end

#get_contact_with_http_info(id, opts = {}) ⇒ Array<(Contact, Integer, Hash)>

Fetch a contact.

Parameters:

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

    the optional parameters

Returns:

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

    Contact 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
404
405
406
407
# File 'lib/spatio-sdk/api/contacts_api.rb', line 361

def get_contact_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact ...'
  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 ContactsApi.get_contact"
  end
  # resource path
  local_var_path = '/v1/contacts/{id}'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['Accept']

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

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

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.get_contact",
    :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: ContactsApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_contact_categories(organization_id, opts = {}) ⇒ ContactCategoryListResponse

List contact categories. Requires ‘organization_id` query param.

Parameters:

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

    the optional parameters

Returns:



413
414
415
416
# File 'lib/spatio-sdk/api/contacts_api.rb', line 413

def list_contact_categories(organization_id, opts = {})
  data, _status_code, _headers = list_contact_categories_with_http_info(organization_id, opts)
  data
end

#list_contact_categories_with_http_info(organization_id, opts = {}) ⇒ Array<(ContactCategoryListResponse, Integer, Hash)>

List contact categories. Requires &#x60;organization_id&#x60; query param.

Parameters:

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

    the optional parameters

Returns:

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

    ContactCategoryListResponse data, response status code and response headers



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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/spatio-sdk/api/contacts_api.rb', line 422

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

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.list_contact_categories",
    :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: ContactsApi#list_contact_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_contact_providers(opts = {}) ⇒ ContactProviderListResponse

List supported contact providers (native + OAuth-connected).

Parameters:

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

    the optional parameters

Returns:



474
475
476
477
# File 'lib/spatio-sdk/api/contacts_api.rb', line 474

def list_contact_providers(opts = {})
  data, _status_code, _headers = list_contact_providers_with_http_info(opts)
  data
end

#list_contact_providers_with_http_info(opts = {}) ⇒ Array<(ContactProviderListResponse, Integer, Hash)>

List supported contact providers (native + OAuth-connected).

Parameters:

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

    the optional parameters

Returns:

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

    ContactProviderListResponse data, response status code and response headers



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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/spatio-sdk/api/contacts_api.rb', line 482

def list_contact_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.list_contact_providers ...'
  end
  # resource path
  local_var_path = '/v1/contacts/providers'

  # 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']) unless header_params['Accept']

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

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

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.list_contact_providers",
    :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: ContactsApi#list_contact_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_contacts(opts = {}) ⇒ ContactListResponse

List the caller’s contacts (across providers).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)
  • :provider (String)
  • :search (String)

Returns:



532
533
534
535
# File 'lib/spatio-sdk/api/contacts_api.rb', line 532

def list_contacts(opts = {})
  data, _status_code, _headers = list_contacts_with_http_info(opts)
  data
end

#list_contacts_with_http_info(opts = {}) ⇒ Array<(ContactListResponse, Integer, Hash)>

List the caller&#39;s contacts (across providers).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)
  • :provider (String)
  • :search (String)

Returns:

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

    ContactListResponse data, response status code and response headers



543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/spatio-sdk/api/contacts_api.rb', line 543

def list_contacts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.list_contacts ...'
  end
  # resource path
  local_var_path = '/v1/contacts'

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.list_contacts",
    :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: ContactsApi#list_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unassign_contact_category(id, category_id, opts = {}) ⇒ nil

Remove a category from a contact.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


595
596
597
598
# File 'lib/spatio-sdk/api/contacts_api.rb', line 595

def unassign_contact_category(id, category_id, opts = {})
  unassign_contact_category_with_http_info(id, category_id, opts)
  nil
end

#unassign_contact_category_with_http_info(id, category_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a category from a contact.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/spatio-sdk/api/contacts_api.rb', line 605

def unassign_contact_category_with_http_info(id, category_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.unassign_contact_category ...'
  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 ContactsApi.unassign_contact_category"
  end
  # verify the required parameter 'category_id' is set
  if @api_client.config.client_side_validation && category_id.nil?
    fail ArgumentError, "Missing the required parameter 'category_id' when calling ContactsApi.unassign_contact_category"
  end
  # resource path
  local_var_path = '/v1/contacts/{id}/categories/{categoryId}'.sub('{id}', CGI.escape(id.to_s)).sub('{categoryId}', CGI.escape(category_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(['application/json']) unless header_params['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] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ContactsApi.unassign_contact_category",
    :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: ContactsApi#unassign_contact_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_contact(id, update_contact_request, opts = {}) ⇒ Contact

Update a contact.

Parameters:

  • id (String)
  • update_contact_request (UpdateContactRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



662
663
664
665
# File 'lib/spatio-sdk/api/contacts_api.rb', line 662

def update_contact(id, update_contact_request, opts = {})
  data, _status_code, _headers = update_contact_with_http_info(id, update_contact_request, opts)
  data
end

#update_contact_category(id, update_contact_category_request, opts = {}) ⇒ ContactCategory

Update a category.

Parameters:

Returns:



734
735
736
737
# File 'lib/spatio-sdk/api/contacts_api.rb', line 734

def update_contact_category(id, update_contact_category_request, opts = {})
  data, _status_code, _headers = update_contact_category_with_http_info(id, update_contact_category_request, opts)
  data
end

#update_contact_category_with_http_info(id, update_contact_category_request, opts = {}) ⇒ Array<(ContactCategory, Integer, Hash)>

Update a category.

Parameters:

Returns:

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

    ContactCategory data, response status code and response headers



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/spatio-sdk/api/contacts_api.rb', line 744

def update_contact_category_with_http_info(id, update_contact_category_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_contact_category ...'
  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 ContactsApi.update_contact_category"
  end
  # verify the required parameter 'update_contact_category_request' is set
  if @api_client.config.client_side_validation && update_contact_category_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_contact_category_request' when calling ContactsApi.update_contact_category"
  end
  # resource path
  local_var_path = '/v1/contacts/categories/{id}'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['Accept']
  # 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(update_contact_category_request)

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.update_contact_category",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#update_contact_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_contact_with_http_info(id, update_contact_request, opts = {}) ⇒ Array<(Contact, Integer, Hash)>

Update a contact.

Parameters:

  • id (String)
  • update_contact_request (UpdateContactRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Contact data, response status code and response headers



672
673
674
675
676
677
678
679
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
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/spatio-sdk/api/contacts_api.rb', line 672

def update_contact_with_http_info(id, update_contact_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_contact ...'
  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 ContactsApi.update_contact"
  end
  # verify the required parameter 'update_contact_request' is set
  if @api_client.config.client_side_validation && update_contact_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_contact_request' when calling ContactsApi.update_contact"
  end
  # resource path
  local_var_path = '/v1/contacts/{id}'.sub('{id}', CGI.escape(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(['application/json']) unless header_params['Accept']
  # 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(update_contact_request)

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

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

  new_options = opts.merge(
    :operation => :"ContactsApi.update_contact",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end