Class: Pingram::VoiceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pingram/api/voice_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VoiceApi

Returns a new instance of VoiceApi.



19
20
21
# File 'lib/pingram/api/voice_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/pingram/api/voice_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#voice_bind_number(agent_id, bind_number_request, opts = {}) ⇒ BindNumberResponse

Bind a phone number to a deployed agent for inbound routing

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/pingram/api/voice_api.rb', line 27

def voice_bind_number(agent_id, bind_number_request, opts = {})
  data, _status_code, _headers = voice_bind_number_with_http_info(agent_id, bind_number_request, opts)
  data
end

#voice_bind_number_with_http_info(agent_id, bind_number_request, opts = {}) ⇒ Array<(BindNumberResponse, Integer, Hash)>

Bind a phone number to a deployed agent for inbound routing

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:

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

    BindNumberResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/pingram/api/voice_api.rb', line 37

def voice_bind_number_with_http_info(agent_id, bind_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_bind_number ...'
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling VoiceApi.voice_bind_number"
  end
  # verify the required parameter 'bind_number_request' is set
  if @api_client.config.client_side_validation && bind_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'bind_number_request' when calling VoiceApi.voice_bind_number"
  end
  # resource path
  local_var_path = '/voice/agents/{agentId}/numbers'.sub('{' + 'agentId' + '}', CGI.escape(agent_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(bind_number_request)

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

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_call(voice_call_request, opts = {}) ⇒ VoiceCallResponse

Place an outbound call with an inline agent spec (ephemeral)

Parameters:

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

    the optional parameters

Returns:



98
99
100
101
# File 'lib/pingram/api/voice_api.rb', line 98

def voice_call(voice_call_request, opts = {})
  data, _status_code, _headers = voice_call_with_http_info(voice_call_request, opts)
  data
end

#voice_call_with_http_info(voice_call_request, opts = {}) ⇒ Array<(VoiceCallResponse, Integer, Hash)>

Place an outbound call with an inline agent spec (ephemeral)

Parameters:

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

    the optional parameters

Returns:

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

    VoiceCallResponse 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/pingram/api/voice_api.rb', line 107

def voice_call_with_http_info(voice_call_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_call ...'
  end
  # verify the required parameter 'voice_call_request' is set
  if @api_client.config.client_side_validation && voice_call_request.nil?
    fail ArgumentError, "Missing the required parameter 'voice_call_request' when calling VoiceApi.voice_call"
  end
  # resource path
  local_var_path = '/voice/call'

  # 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(voice_call_request)

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

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_create_agent(create_voice_agent_request, opts = {}) ⇒ CreateVoiceAgentResponse

Deploy a voice agent (persist spec for production routing)

Parameters:

Returns:



164
165
166
167
# File 'lib/pingram/api/voice_api.rb', line 164

def voice_create_agent(create_voice_agent_request, opts = {})
  data, _status_code, _headers = voice_create_agent_with_http_info(create_voice_agent_request, opts)
  data
end

#voice_create_agent_with_http_info(create_voice_agent_request, opts = {}) ⇒ Array<(CreateVoiceAgentResponse, Integer, Hash)>

Deploy a voice agent (persist spec for production routing)

Parameters:

Returns:

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

    CreateVoiceAgentResponse 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/pingram/api/voice_api.rb', line 173

def voice_create_agent_with_http_info(create_voice_agent_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_create_agent ...'
  end
  # verify the required parameter 'create_voice_agent_request' is set
  if @api_client.config.client_side_validation && create_voice_agent_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_voice_agent_request' when calling VoiceApi.voice_create_agent"
  end
  # resource path
  local_var_path = '/voice/agents'

  # 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_voice_agent_request)

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

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_create_browser_call(voice_browser_call_request, opts = {}) ⇒ VoiceBrowserCallResponse

Place an ephemeral browser playground call with an inline agent spec

Parameters:

Returns:



230
231
232
233
# File 'lib/pingram/api/voice_api.rb', line 230

def voice_create_browser_call(voice_browser_call_request, opts = {})
  data, _status_code, _headers = voice_create_browser_call_with_http_info(voice_browser_call_request, opts)
  data
end

#voice_create_browser_call_with_http_info(voice_browser_call_request, opts = {}) ⇒ Array<(VoiceBrowserCallResponse, Integer, Hash)>

Place an ephemeral browser playground call with an inline agent spec

Parameters:

Returns:

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

    VoiceBrowserCallResponse data, 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
286
287
288
289
290
# File 'lib/pingram/api/voice_api.rb', line 239

def voice_create_browser_call_with_http_info(voice_browser_call_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_create_browser_call ...'
  end
  # verify the required parameter 'voice_browser_call_request' is set
  if @api_client.config.client_side_validation && voice_browser_call_request.nil?
    fail ArgumentError, "Missing the required parameter 'voice_browser_call_request' when calling VoiceApi.voice_create_browser_call"
  end
  # resource path
  local_var_path = '/voice/browser-call'

  # 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(voice_browser_call_request)

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

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_delete_agent(agent_id, opts = {}) ⇒ DeleteVoiceAgentResponse

Remove a deployed voice agent and unbind its numbers

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:



296
297
298
299
# File 'lib/pingram/api/voice_api.rb', line 296

def voice_delete_agent(agent_id, opts = {})
  data, _status_code, _headers = voice_delete_agent_with_http_info(agent_id, opts)
  data
end

#voice_delete_agent_with_http_info(agent_id, opts = {}) ⇒ Array<(DeleteVoiceAgentResponse, Integer, Hash)>

Remove a deployed voice agent and unbind its numbers

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:

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

    DeleteVoiceAgentResponse data, response status code and response headers



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
347
348
349
350
351
# File 'lib/pingram/api/voice_api.rb', line 305

def voice_delete_agent_with_http_info(agent_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_delete_agent ...'
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling VoiceApi.voice_delete_agent"
  end
  # resource path
  local_var_path = '/voice/agents/{agentId}'.sub('{' + 'agentId' + '}', CGI.escape(agent_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] || 'DeleteVoiceAgentResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_get_agent(agent_id, opts = {}) ⇒ GetVoiceAgentResponse

Get a deployed voice agent

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:



357
358
359
360
# File 'lib/pingram/api/voice_api.rb', line 357

def voice_get_agent(agent_id, opts = {})
  data, _status_code, _headers = voice_get_agent_with_http_info(agent_id, opts)
  data
end

#voice_get_agent_with_http_info(agent_id, opts = {}) ⇒ Array<(GetVoiceAgentResponse, Integer, Hash)>

Get a deployed voice agent

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:

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

    GetVoiceAgentResponse data, response status code and response headers



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
408
409
410
411
412
# File 'lib/pingram/api/voice_api.rb', line 366

def voice_get_agent_with_http_info(agent_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_get_agent ...'
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling VoiceApi.voice_get_agent"
  end
  # resource path
  local_var_path = '/voice/agents/{agentId}'.sub('{' + 'agentId' + '}', CGI.escape(agent_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] || 'GetVoiceAgentResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_get_call(tracking_id, opts = {}) ⇒ GetVoiceCallResponse

Get a call with transcript timeline and recording playback URL

Parameters:

  • tracking_id (String)

    Call tracking id

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

    the optional parameters

Returns:



418
419
420
421
# File 'lib/pingram/api/voice_api.rb', line 418

def voice_get_call(tracking_id, opts = {})
  data, _status_code, _headers = voice_get_call_with_http_info(tracking_id, opts)
  data
end

#voice_get_call_with_http_info(tracking_id, opts = {}) ⇒ Array<(GetVoiceCallResponse, Integer, Hash)>

Get a call with transcript timeline and recording playback URL

Parameters:

  • tracking_id (String)

    Call tracking id

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

    the optional parameters

Returns:

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

    GetVoiceCallResponse data, response status code and response headers



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
470
471
472
473
# File 'lib/pingram/api/voice_api.rb', line 427

def voice_get_call_with_http_info(tracking_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_get_call ...'
  end
  # verify the required parameter 'tracking_id' is set
  if @api_client.config.client_side_validation && tracking_id.nil?
    fail ArgumentError, "Missing the required parameter 'tracking_id' when calling VoiceApi.voice_get_call"
  end
  # resource path
  local_var_path = '/voice/calls/{trackingId}'.sub('{' + 'trackingId' + '}', CGI.escape(tracking_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] || 'GetVoiceCallResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_list_agents(opts = {}) ⇒ ListVoiceAgentsResponse

List deployed voice agents for the account

Parameters:

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

    the optional parameters

Returns:



478
479
480
481
# File 'lib/pingram/api/voice_api.rb', line 478

def voice_list_agents(opts = {})
  data, _status_code, _headers = voice_list_agents_with_http_info(opts)
  data
end

#voice_list_agents_with_http_info(opts = {}) ⇒ Array<(ListVoiceAgentsResponse, Integer, Hash)>

List deployed voice agents for the account

Parameters:

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

    the optional parameters

Returns:

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

    ListVoiceAgentsResponse data, response status code and response headers



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
525
526
527
528
# File 'lib/pingram/api/voice_api.rb', line 486

def voice_list_agents_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_list_agents ...'
  end
  # resource path
  local_var_path = '/voice/agents'

  # 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] || 'ListVoiceAgentsResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_list_calls(opts = {}) ⇒ ListVoiceCallsResponse

List recent calls newest-first (30-day retention)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :agent_id (String)

    Only calls handled by this agent

  • :limit (Float)

    Page size (default 25, max 100)

  • :cursor (String)

    Pagination cursor from a previous response

Returns:



536
537
538
539
# File 'lib/pingram/api/voice_api.rb', line 536

def voice_list_calls(opts = {})
  data, _status_code, _headers = voice_list_calls_with_http_info(opts)
  data
end

#voice_list_calls_with_http_info(opts = {}) ⇒ Array<(ListVoiceCallsResponse, Integer, Hash)>

List recent calls newest-first (30-day retention)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :agent_id (String)

    Only calls handled by this agent

  • :limit (Float)

    Page size (default 25, max 100)

  • :cursor (String)

    Pagination cursor from a previous response

Returns:

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

    ListVoiceCallsResponse data, response status code and response headers



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
589
590
591
592
# File 'lib/pingram/api/voice_api.rb', line 547

def voice_list_calls_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_list_calls ...'
  end
  # resource path
  local_var_path = '/voice/calls'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'agentId'] = opts[:'agent_id'] if !opts[:'agent_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].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] || 'ListVoiceCallsResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_unbind_number(agent_id, phone_number, opts = {}) ⇒ UnbindNumberResponse

Unbind a phone number from a deployed agent

Parameters:

  • agent_id (String)

    Agent id

  • phone_number (String)

    E.164 phone number

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

    the optional parameters

Returns:



599
600
601
602
# File 'lib/pingram/api/voice_api.rb', line 599

def voice_unbind_number(agent_id, phone_number, opts = {})
  data, _status_code, _headers = voice_unbind_number_with_http_info(agent_id, phone_number, opts)
  data
end

#voice_unbind_number_with_http_info(agent_id, phone_number, opts = {}) ⇒ Array<(UnbindNumberResponse, Integer, Hash)>

Unbind a phone number from a deployed agent

Parameters:

  • agent_id (String)

    Agent id

  • phone_number (String)

    E.164 phone number

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

    the optional parameters

Returns:

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

    UnbindNumberResponse data, response status code and response headers



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
656
657
658
659
# File 'lib/pingram/api/voice_api.rb', line 609

def voice_unbind_number_with_http_info(agent_id, phone_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_unbind_number ...'
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling VoiceApi.voice_unbind_number"
  end
  # verify the required parameter 'phone_number' is set
  if @api_client.config.client_side_validation && phone_number.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number' when calling VoiceApi.voice_unbind_number"
  end
  # resource path
  local_var_path = '/voice/agents/{agentId}/numbers/{phoneNumber}'.sub('{' + 'agentId' + '}', CGI.escape(agent_id.to_s)).sub('{' + 'phoneNumber' + '}', CGI.escape(phone_number.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] || 'UnbindNumberResponse'

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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

#voice_update_agent(agent_id, update_voice_agent_request, opts = {}) ⇒ UpdateVoiceAgentResponse

Publish changes to a deployed voice agent

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:



666
667
668
669
# File 'lib/pingram/api/voice_api.rb', line 666

def voice_update_agent(agent_id, update_voice_agent_request, opts = {})
  data, _status_code, _headers = voice_update_agent_with_http_info(agent_id, update_voice_agent_request, opts)
  data
end

#voice_update_agent_with_http_info(agent_id, update_voice_agent_request, opts = {}) ⇒ Array<(UpdateVoiceAgentResponse, Integer, Hash)>

Publish changes to a deployed voice agent

Parameters:

  • agent_id (String)

    Agent id

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

    the optional parameters

Returns:

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

    UpdateVoiceAgentResponse data, response status code and response headers



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
728
729
730
731
# File 'lib/pingram/api/voice_api.rb', line 676

def voice_update_agent_with_http_info(agent_id, update_voice_agent_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoiceApi.voice_update_agent ...'
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling VoiceApi.voice_update_agent"
  end
  # verify the required parameter 'update_voice_agent_request' is set
  if @api_client.config.client_side_validation && update_voice_agent_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_voice_agent_request' when calling VoiceApi.voice_update_agent"
  end
  # resource path
  local_var_path = '/voice/agents/{agentId}'.sub('{' + 'agentId' + '}', CGI.escape(agent_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_voice_agent_request)

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

  # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
  auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']

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