bandwidth-sdk 11.3.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +18 -16
  3. data/README.md +15 -9
  4. data/Rakefile +4 -12
  5. data/bandwidth.yml +243 -28
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1412 -1009
  8. data/coverage/index.html +16274 -11823
  9. data/custom_templates/README.mustache +4 -4
  10. data/docs/AnswerCallback.md +1 -1
  11. data/docs/BridgeCompleteCallback.md +1 -1
  12. data/docs/BridgeTargetCompleteCallback.md +1 -1
  13. data/docs/CallRecordingMetadata.md +3 -3
  14. data/docs/CallTranscription.md +24 -0
  15. data/docs/CallTranscriptionMetadata.md +20 -0
  16. data/docs/CallTranscriptionResponse.md +24 -0
  17. data/docs/CallsApi.md +1 -1
  18. data/docs/ConferenceMemberExitCallback.md +1 -1
  19. data/docs/ConferenceMemberJoinCallback.md +1 -1
  20. data/docs/CreateCall.md +5 -3
  21. data/docs/DisconnectCallback.md +1 -1
  22. data/docs/DtmfCallback.md +2 -2
  23. data/docs/GatherCallback.md +2 -2
  24. data/docs/InitiateCallback.md +1 -1
  25. data/docs/MachineDetectionCompleteCallback.md +1 -1
  26. data/docs/RecordingAvailableCallback.md +4 -4
  27. data/docs/RecordingCompleteCallback.md +2 -2
  28. data/docs/RecordingTranscriptionMetadata.md +24 -0
  29. data/docs/RecordingTranscriptions.md +18 -0
  30. data/docs/RecordingsApi.md +49 -49
  31. data/docs/RedirectCallback.md +2 -2
  32. data/docs/TranscriptionAvailableCallback.md +2 -2
  33. data/docs/TranscriptionsApi.md +229 -0
  34. data/docs/TransferAnswerCallback.md +2 -2
  35. data/docs/TransferCompleteCallback.md +2 -2
  36. data/docs/TransferDisconnectCallback.md +2 -2
  37. data/lib/bandwidth-sdk/api/recordings_api.rb +56 -56
  38. data/lib/bandwidth-sdk/api/transcriptions_api.rb +241 -0
  39. data/lib/bandwidth-sdk/configuration.rb +22 -4
  40. data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
  41. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
  42. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
  43. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +3 -3
  44. data/lib/bandwidth-sdk/models/call_transcription.rb +317 -0
  45. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +223 -0
  46. data/lib/bandwidth-sdk/models/call_transcription_response.rb +244 -0
  47. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
  48. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
  49. data/lib/bandwidth-sdk/models/create_call.rb +14 -3
  50. data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
  51. data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
  52. data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
  53. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  54. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
  55. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
  56. data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
  57. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
  58. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +244 -0
  59. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +214 -0
  60. data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
  61. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
  62. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
  63. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
  64. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
  65. data/lib/bandwidth-sdk/version.rb +1 -1
  66. data/lib/bandwidth-sdk.rb +6 -2
  67. data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +9 -7
  68. data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +9 -9
  69. data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +7 -7
  70. data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +3 -3
  71. data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +3 -3
  72. data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +2 -2
  73. data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +14 -14
  74. data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +1 -1
  75. data/spec/smoke/transcriptions_api_spec.rb +84 -0
  76. data/spec/spec_helper.rb +2 -2
  77. data/spec/{api → unit/api}/calls_api_spec.rb +6 -4
  78. data/spec/{api → unit/api}/conferences_api_spec.rb +12 -12
  79. data/spec/{api → unit/api}/media_api_spec.rb +6 -6
  80. data/spec/{api → unit/api}/messages_api_spec.rb +2 -2
  81. data/spec/{api → unit/api}/mfa_api_spec.rb +6 -6
  82. data/spec/{api → unit/api}/phone_number_lookup_api_spec.rb +2 -2
  83. data/spec/{api → unit/api}/recordings_api_spec.rb +30 -30
  84. data/spec/{api → unit/api}/statistics_api_spec.rb +1 -1
  85. data/spec/unit/api/transcriptions_api_spec.rb +130 -0
  86. data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +2 -2
  87. metadata +130 -114
  88. /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
  89. /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
  90. /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
  91. /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
  92. /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
  93. /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
  94. /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
  95. /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
  96. /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
  97. /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
  98. /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
  99. /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
  100. /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
  101. /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
  102. /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
  103. /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
  104. /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
  105. /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
  106. /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
  107. /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
  108. /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
  109. /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
  110. /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
  111. /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
  112. /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
  113. /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
  114. /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
  115. /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
  116. /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
  117. /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
  118. /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
  119. /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
  120. /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
  121. /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
  122. /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
  123. /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
  124. /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
  125. /data/spec/{models → unit/models}/message_spec.rb +0 -0
  126. /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -31,7 +31,7 @@ describe 'ConferencesApi Integration Tests' do
31
31
  }
32
32
 
33
33
  sleep(SLEEP_TIME_S)
34
- data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
34
+ data, status_code = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
35
35
 
36
36
  expect(status_code).to eq(200)
37
37
  expect(data).to be_instance_of(Array)
@@ -44,7 +44,7 @@ describe 'ConferencesApi Integration Tests' do
44
44
  # Get Conference Information
45
45
  describe 'get_conference' do
46
46
  it 'get a conference by id' do
47
- data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
47
+ data, status_code = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, $conference_id)
48
48
 
49
49
  expect(status_code).to eq(200)
50
50
  expect(data).to be_instance_of(Bandwidth::Conference)
@@ -57,7 +57,7 @@ describe 'ConferencesApi Integration Tests' do
57
57
  # Get Conference Member
58
58
  describe 'get_conference_member' do
59
59
  it 'gets a conference member by call id' do
60
- data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
60
+ data, status_code = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id)
61
61
 
62
62
  expect(status_code).to eq(200)
63
63
  expect(data).to be_instance_of(Bandwidth::ConferenceMember)
@@ -73,7 +73,7 @@ describe 'ConferencesApi Integration Tests' do
73
73
  mute: false
74
74
  )
75
75
 
76
- data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
76
+ _data, status_code = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, $conference_id, $manteca_call_id, update_conference_member)
77
77
  expect(status_code).to eq(204)
78
78
  end
79
79
  end
@@ -93,7 +93,7 @@ describe 'ConferencesApi Integration Tests' do
93
93
  fallback_password: 'password'
94
94
  )
95
95
 
96
- data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
96
+ _data, status_code = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, $conference_id, update_conference_body)
97
97
  expect(status_code).to eq(204)
98
98
  end
99
99
  end
@@ -103,7 +103,7 @@ describe 'ConferencesApi Integration Tests' do
103
103
  it 'updates a conference using bxml' do
104
104
  update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><StartRecording/><SpeakSentence locale="en_US" gender="female" voice="susan">This should be a conference recording.</SpeakSentence><StopRecording/></Bxml>'
105
105
 
106
- data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
106
+ _data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, $conference_id, update_bxml)
107
107
  expect(status_code).to eq(204)
108
108
 
109
109
  retries = 0
@@ -125,7 +125,7 @@ describe 'ConferencesApi Integration Tests' do
125
125
  # Get Conference Recordings
126
126
  describe 'list_conference_recordings' do
127
127
  it 'lists recordings for a conference' do
128
- data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
128
+ data, status_code = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, $conference_id)
129
129
 
130
130
  expect(status_code).to eq(200)
131
131
  expect(data).to be_instance_of(Array)
@@ -144,7 +144,7 @@ describe 'ConferencesApi Integration Tests' do
144
144
  # Get Conference Recording Information
145
145
  describe 'get_conference_recording' do
146
146
  it 'gets a conference recording by id' do
147
- data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
147
+ data, status_code = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
148
148
 
149
149
  expect(status_code).to eq(200)
150
150
  expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
@@ -160,7 +160,7 @@ describe 'ConferencesApi Integration Tests' do
160
160
  # Download Conference Recording
161
161
  describe 'download_conference_recording test' do
162
162
  it 'should work' do
163
- data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
163
+ data, status_code = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, $conference_id, $recording_id)
164
164
 
165
165
  expect(status_code).to eq(200)
166
166
  expect(data).to be_instance_of(String)
@@ -26,12 +26,12 @@ describe 'MediaApi Integration Tests' do
26
26
  # Upload Media
27
27
  describe 'upload_media' do
28
28
  it 'uploads binary media' do
29
- data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data)
29
+ _data, status_code = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name, binary_media_data)
30
30
  expect(status_code).to eq(204)
31
31
  end
32
32
 
33
33
  it 'uploads media file' do
34
- data, status_code, headers = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data)
34
+ _data, status_code = @api_instance_media.upload_media_with_http_info(BW_ACCOUNT_ID, @media_file_name, media_file_data)
35
35
  expect(status_code).to eq(204)
36
36
  end
37
37
  end
@@ -39,7 +39,7 @@ describe 'MediaApi Integration Tests' do
39
39
  # List Media
40
40
  describe 'list_media' do
41
41
  it 'lists media' do
42
- data, status_code, headers = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
42
+ data, status_code = @api_instance_media.list_media_with_http_info(BW_ACCOUNT_ID)
43
43
  expect(status_code).to eq(200)
44
44
  expect(data).to be_instance_of(Array)
45
45
  expect(data[0]).to be_instance_of(Bandwidth::Media)
@@ -51,13 +51,13 @@ describe 'MediaApi Integration Tests' do
51
51
  # Get Media
52
52
  describe 'get_media' do
53
53
  it 'gets uploaded binary media' do
54
- data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
54
+ data, status_code = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
55
55
  expect(status_code).to eq(200)
56
56
  expect(data).to eq(binary_media_data)
57
57
  end
58
58
 
59
59
  it 'gets uploaded media file' do
60
- data, status_code, headers = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
60
+ data, status_code = @api_instance_media.get_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
61
61
  response_md5 = Digest::MD5.hexdigest(data)
62
62
 
63
63
  expect(status_code).to eq(200)
@@ -68,12 +68,12 @@ describe 'MediaApi Integration Tests' do
68
68
  # Delete Media
69
69
  describe 'delete_media' do
70
70
  it 'deletes the binary media' do
71
- data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
71
+ _data, status_code = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @binary_media_name)
72
72
  expect(status_code).to eq(204)
73
73
  end
74
74
 
75
75
  it 'deletes the media file' do
76
- data, status_code, headers = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
76
+ _data, status_code = @api_instance_media.delete_media_with_http_info(BW_ACCOUNT_ID, @media_file_name)
77
77
  expect(status_code).to eq(204)
78
78
  end
79
79
  end
@@ -37,7 +37,7 @@ describe 'MessagesApi Integration Tests' do
37
37
  tag: mms_tag
38
38
  )
39
39
 
40
- data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
40
+ data, status_code = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
41
41
 
42
42
  expect(status_code).to eq(202)
43
43
  expect(data).to be_instance_of(Bandwidth::Message)
@@ -61,7 +61,7 @@ describe 'MessagesApi Integration Tests' do
61
61
  expiration: @expiration_time
62
62
  )
63
63
 
64
- data, status_code, headers = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
64
+ data, status_code = @messaging_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request)
65
65
 
66
66
  expect(status_code).to eq(202)
67
67
  expect(data).to be_instance_of(Bandwidth::Message)
@@ -83,7 +83,7 @@ describe 'MessagesApi Integration Tests' do
83
83
  source_tn: BW_NUMBER,
84
84
  message_direction: list_message_direction
85
85
  }
86
- data, status_code, headers = @messaging_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts)
86
+ data, status_code = @messaging_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID, get_opts)
87
87
 
88
88
  expect(status_code).to eq(200)
89
89
  expect(data).to be_instance_of(Bandwidth::MessagesList)
@@ -28,7 +28,7 @@ describe 'MFAApi Integration Tests' do
28
28
  digits: digits
29
29
  )
30
30
 
31
- data, status_code, headers = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
31
+ data, status_code = @mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
32
32
 
33
33
  expect(status_code).to eq(200)
34
34
  expect(data).to be_instance_of(Bandwidth::MessagingCodeResponse)
@@ -47,7 +47,7 @@ describe 'MFAApi Integration Tests' do
47
47
  digits: digits
48
48
  )
49
49
 
50
- data, status_code, headers = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema)
50
+ data, status_code = @mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, req_schema)
51
51
 
52
52
  expect(status_code).to eq(200)
53
53
  expect(data).to be_instance_of(Bandwidth::VoiceCodeResponse)
@@ -65,7 +65,7 @@ describe 'MFAApi Integration Tests' do
65
65
  code: '12345'
66
66
  )
67
67
 
68
- data, status_code, headers = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema)
68
+ data, status_code = @mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, req_schema)
69
69
 
70
70
  expect(status_code).to eq(200)
71
71
  expect(data).to be_instance_of(Bandwidth::VerifyCodeResponse)
@@ -22,7 +22,7 @@ describe 'PhoneNumberLookupApi Integration Tests' do
22
22
  tn_body = Bandwidth::LookupRequest.new(
23
23
  tns: [BW_NUMBER]
24
24
  )
25
- data, status_code, headers = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
25
+ data, status_code = @api_instance_tnlookup.create_lookup_with_http_info(BW_ACCOUNT_ID, tn_body)
26
26
 
27
27
  expect(status_code).to eq(202)
28
28
  expect(data).to be_instance_of(Bandwidth::CreateLookupResponse)
@@ -37,7 +37,7 @@ describe 'PhoneNumberLookupApi Integration Tests' do
37
37
  # Get Lookup Status
38
38
  describe 'get_lookup_status' do
39
39
  it 'gets lookup status' do
40
- data, status_code, headers = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id)
40
+ data, status_code = @api_instance_tnlookup.get_lookup_status_with_http_info(BW_ACCOUNT_ID, $lookup_request_id)
41
41
 
42
42
  expect(status_code).to eq(200)
43
43
  expect(data).to be_instance_of(Bandwidth::LookupStatus)
@@ -34,14 +34,14 @@ describe 'RecordingsApi Integration Tests' do
34
34
  )
35
35
 
36
36
  sleep(SLEEP_TIME_S * 2)
37
- pause_data, pause_status_code, pause_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording)
37
+ _pause_data, pause_status_code = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, pause_recording)
38
38
  expect(pause_status_code).to eq(200)
39
39
 
40
40
  sleep(SLEEP_TIME_S)
41
- record_data, record_status_code, record_headers = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording)
41
+ _record_data, record_status_code = @recordings_api_instance.update_call_recording_state_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_recording)
42
42
  expect(record_status_code).to eq(200)
43
43
 
44
- complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
44
+ _complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
45
45
  expect(complete_status_code).to eq(200)
46
46
 
47
47
  retries = 0
@@ -63,7 +63,7 @@ describe 'RecordingsApi Integration Tests' do
63
63
  # Get Call Recordings
64
64
  describe 'list_account_call_recordings' do
65
65
  it 'lists account call recordings' do
66
- data, status_code, headers = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
66
+ data, status_code = @recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID)
67
67
 
68
68
  expect(status_code).to eq(200)
69
69
  expect(data).to be_instance_of(Array)
@@ -76,7 +76,7 @@ describe 'RecordingsApi Integration Tests' do
76
76
  # List Call Recordings
77
77
  describe 'list_call_recordings' do
78
78
  it 'lists all recordings for a single call' do
79
- data, status_code, headers = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
79
+ data, status_code = @recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
80
80
 
81
81
  expect(status_code).to eq(200)
82
82
  expect(data).to be_instance_of(Array)
@@ -94,7 +94,7 @@ describe 'RecordingsApi Integration Tests' do
94
94
  # Get Call Recording
95
95
  describe 'get_call_recording' do
96
96
  it 'gets a call recording by id' do
97
- data, status_code, headers = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
97
+ data, status_code = @recordings_api_instance.get_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
98
98
 
99
99
  expect(status_code).to eq(200)
100
100
  expect(data).to be_instance_of(Bandwidth::CallRecordingMetadata)
@@ -109,7 +109,7 @@ describe 'RecordingsApi Integration Tests' do
109
109
  # Download Recording
110
110
  describe 'download_call_recording' do
111
111
  it 'downloads a call recording by id' do
112
- data, status_code, headers = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
112
+ data, status_code = @recordings_api_instance.download_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
113
113
 
114
114
  expect(status_code).to eq(200)
115
115
  expect(data).to be_instance_of(String)
@@ -118,13 +118,13 @@ describe 'RecordingsApi Integration Tests' do
118
118
 
119
119
  # Create Transcription Request
120
120
  describe 'transcribe_call_recording' do
121
- it 'creates a transcription request' do
121
+ it 'creates a recording transcription request' do
122
122
  transcribe_recording = Bandwidth::TranscribeRecording.new(
123
123
  callback_url: MANTECA_BASE_URL + '/transcriptions',
124
124
  tag: $manteca_test_id
125
125
  )
126
126
 
127
- data, status_code, headers = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording)
127
+ _data, status_code = @recordings_api_instance.transcribe_call_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id, transcribe_recording)
128
128
  expect(status_code).to eq(204)
129
129
 
130
130
  retries = 0
@@ -147,10 +147,10 @@ describe 'RecordingsApi Integration Tests' do
147
147
  # Get Transcription
148
148
  describe 'get_call_transcription' do
149
149
  it 'gets the completed call recording transcription' do
150
- data, status_code, headers = @recordings_api_instance.get_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
150
+ data, status_code = @recordings_api_instance.get_recording_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
151
151
 
152
152
  expect(status_code).to eq(200)
153
- expect(data).to be_instance_of(Bandwidth::TranscriptionList)
153
+ expect(data).to be_instance_of(Bandwidth::RecordingTranscriptions)
154
154
  expect(data.transcripts).to be_instance_of(Array)
155
155
  expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
156
156
  expect(data.transcripts[0].text).to be_instance_of(String)
@@ -161,7 +161,7 @@ describe 'RecordingsApi Integration Tests' do
161
161
  # Delete Transcription
162
162
  describe 'delete_call_transcription' do
163
163
  it 'deletes the completed call recording transcription' do
164
- data, status_code, headers = @recordings_api_instance.delete_call_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
164
+ _data, status_code = @recordings_api_instance.delete_recording_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
165
165
  expect(status_code).to eq(204)
166
166
  end
167
167
  end
@@ -169,7 +169,7 @@ describe 'RecordingsApi Integration Tests' do
169
169
  # Delete Recording Media
170
170
  describe 'delete_recording_media' do
171
171
  it 'deletes the completed call recording media' do
172
- data, status_code, headers = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
172
+ _data, status_code = @recordings_api_instance.delete_recording_media_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
173
173
  expect(status_code).to eq(204)
174
174
  end
175
175
  end
@@ -177,7 +177,7 @@ describe 'RecordingsApi Integration Tests' do
177
177
  # Delete Recording
178
178
  describe 'delete_recording' do
179
179
  it 'deletes the completed call recording data' do
180
- data, status_code, headers = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
180
+ _data, status_code = @recordings_api_instance.delete_recording_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $recording_id)
181
181
  expect(status_code).to eq(204)
182
182
  end
183
183
  end
@@ -16,7 +16,7 @@ describe 'StatisticsApi Integration Tests' do
16
16
  # Get Account Statistics
17
17
  describe 'get_statistics' do
18
18
  it 'gets account statistics' do
19
- data, status_code, headers = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
19
+ data, status_code = @statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
20
20
 
21
21
  expect(status_code).to eq(200)
22
22
  expect(data).to be_instance_of(Bandwidth::AccountStatistics)
@@ -0,0 +1,84 @@
1
+ require_relative '../call_utils'
2
+
3
+ # Integration Tests for Bandwidth::TranscriptionsApi
4
+ describe 'TranscriptionsApi Integration Tests' do
5
+ before(:all) do
6
+ WebMock.allow_net_connect!
7
+ Bandwidth.configure do |config|
8
+ config.username = BW_USERNAME
9
+ config.password = BW_PASSWORD
10
+ end
11
+ @transcriptions_api_instance = Bandwidth::TranscriptionsApi.new
12
+ @calls_api_instance = Bandwidth::CallsApi.new
13
+
14
+ # transcription info
15
+ $manteca_test_id = setup_manteca('CALL')
16
+ $manteca_call_id = create_manteca_call($manteca_test_id, '/bxml/idle', @calls_api_instance)
17
+ $transcription_id = ''
18
+ end
19
+
20
+ after(:all) do
21
+ WebMock.disable_net_connect!
22
+ end
23
+
24
+ # Create Call Transcription
25
+ describe 'create_call_transcription' do
26
+ it 'creates a call transcription' do
27
+ sleep(SLEEP_TIME_S)
28
+
29
+ start_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StartTranscription name=\"#{$manteca_call_id}\" tracks=\"inbound\"></StartTranscription><Pause duration=\"6\"/></Response>"
30
+ _start_data, start_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, start_transcription_bxml)
31
+ expect(start_status_code).to eq(204)
32
+ sleep(SLEEP_TIME_S)
33
+
34
+ stop_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StopTranscription name=\"#{$manteca_call_id}\"></StopTranscription></Response>"
35
+ _stop_data, stop_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, stop_transcription_bxml)
36
+ expect(stop_status_code).to eq(204)
37
+ sleep(SLEEP_TIME_S)
38
+
39
+ _complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $complete_call_body)
40
+ expect(complete_status_code).to eq(200)
41
+ end
42
+ end
43
+
44
+ # List Real Time Call Transcriptions
45
+ describe 'list_real_time_transcriptions' do
46
+ it 'lists call transcriptions' do
47
+ sleep(SLEEP_TIME_S * 20)
48
+ data, status_code, _headers = @transcriptions_api_instance.list_real_time_transcriptions_with_http_info(BW_ACCOUNT_ID, $manteca_call_id)
49
+
50
+ expect(status_code).to eq(200)
51
+ expect(data).to be_instance_of(Array)
52
+ expect(data[0]).to be_instance_of(Bandwidth::CallTranscriptionMetadata)
53
+ expect(data[0].transcription_id).to be_instance_of(String)
54
+ expect(data[0].transcription_url).to be_instance_of(String)
55
+ $transcription_id = data[0].transcription_id
56
+ end
57
+ end
58
+
59
+ # Get Real Time Call Transcription
60
+ describe 'get_real_time_transcription' do
61
+ it 'gets the specified call transcription' do
62
+ data, status_code, _headers = @transcriptions_api_instance.get_real_time_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $transcription_id)
63
+
64
+ expect(status_code).to eq(200)
65
+ expect(data).to be_instance_of(Bandwidth::CallTranscriptionResponse)
66
+ expect(data.account_id).to eq(BW_ACCOUNT_ID)
67
+ expect(data.call_id).to eq($manteca_call_id)
68
+ expect(data.transcription_id).to eq($transcription_id)
69
+ expect(data.tracks).to be_instance_of(Array)
70
+ expect(data.tracks[0]).to be_instance_of(Bandwidth::CallTranscription)
71
+ expect(data.tracks[0].track).to eq('inbound')
72
+ expect(data.tracks[0].confidence).to be_instance_of(Float)
73
+ end
74
+ end
75
+
76
+ # Delete Real Time Call Transcription
77
+ describe 'delete_real_time_transcription' do
78
+ it 'deletes the specified call transcription' do
79
+ _data, status_code = @transcriptions_api_instance.delete_real_time_transcription_with_http_info(BW_ACCOUNT_ID, $manteca_call_id, $transcription_id)
80
+
81
+ expect(status_code).to eq(200) # This is a bug in the API, it should return 204. VAPI-1863 should fix this.
82
+ end
83
+ end
84
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # Test Coverage Configuration
2
2
  require 'simplecov'
3
3
  SimpleCov.start do
4
- add_filter 'spec/integration'
4
+ add_filter 'spec/smoke'
5
5
  add_filter 'spec/call_utils.rb'
6
6
  add_filter do |source_file|
7
7
  if !source_file.filename.include? 'bandwidth-sdk/models' then
@@ -89,7 +89,7 @@ RSpec.configure do |config|
89
89
  config.password = BW_PASSWORD
90
90
  end
91
91
  calls_api = Bandwidth::CallsApi.new
92
- # cleanup_calls($active_calls, calls_api)
92
+ cleanup_calls($active_calls, calls_api)
93
93
  }
94
94
 
95
95
  # rspec-expectations config goes here. You can use an alternate
@@ -6,6 +6,7 @@ describe 'CallsApi' do
6
6
  let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" }
7
7
  let(:call_timeout) { 30.0 }
8
8
  let(:callback_timeout) { 15.0 }
9
+ let(:privacy) { false }
9
10
  let(:display_name) { 'Ruby SDK' }
10
11
  let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
11
12
  let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
@@ -72,6 +73,7 @@ describe 'CallsApi' do
72
73
  application_id: BW_VOICE_APPLICATION_ID,
73
74
  to: USER_NUMBER,
74
75
  from: BW_NUMBER,
76
+ privacy: privacy,
75
77
  display_name: display_name,
76
78
  answer_url: answer_url,
77
79
  answer_fallback_url: answer_fallback_url,
@@ -180,7 +182,7 @@ describe 'CallsApi' do
180
182
 
181
183
  it 'causes an ArgumentError for a missing account_id' do
182
184
  expect {
183
- resp = @calls_api_instance.get_call_state(nil, '')
185
+ @calls_api_instance.get_call_state(nil, '')
184
186
  }.to raise_error(ArgumentError)
185
187
  end
186
188
 
@@ -202,7 +204,7 @@ describe 'CallsApi' do
202
204
  redirect_url: MANTECA_BASE_URL + '/bxml/pause'
203
205
  )
204
206
 
205
- data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
207
+ _data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
206
208
 
207
209
  expect(status_code).to eq(200)
208
210
  expect(headers).to eq(update_call_headers_stub)
@@ -210,7 +212,7 @@ describe 'CallsApi' do
210
212
 
211
213
  it 'causes an ArgumentError for a missing account_id' do
212
214
  expect {
213
- resp = @calls_api_instance.update_call(nil, '', {})
215
+ @calls_api_instance.update_call(nil, '', {})
214
216
  }.to raise_error(ArgumentError)
215
217
  end
216
218
 
@@ -235,7 +237,7 @@ describe 'CallsApi' do
235
237
 
236
238
  update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence locale="en_US" gender="female" voice="susan">This is a test bxml response</SpeakSentence><Pause duration="3"/></Bxml>'
237
239
 
238
- data, status_code, headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
240
+ _data, status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
239
241
 
240
242
  expect(status_code).to eq(204)
241
243
  end
@@ -61,7 +61,7 @@ describe 'ConferencesApi' do
61
61
 
62
62
  it 'causes an ArgumentError for a missing account_id' do
63
63
  expect {
64
- resp = @conferences_api_instance.download_conference_recording(nil, '', '')
64
+ @conferences_api_instance.download_conference_recording(nil, '', '')
65
65
  }.to raise_error(ArgumentError)
66
66
  end
67
67
 
@@ -107,7 +107,7 @@ describe 'ConferencesApi' do
107
107
 
108
108
  it 'causes an ArgumentError for a missing account_id' do
109
109
  expect {
110
- resp = @conferences_api_instance.get_conference(nil, '')
110
+ @conferences_api_instance.get_conference(nil, '')
111
111
  }.to raise_error(ArgumentError)
112
112
  end
113
113
 
@@ -139,7 +139,7 @@ describe 'ConferencesApi' do
139
139
 
140
140
  it 'causes an ArgumentError for a missing account_id' do
141
141
  expect {
142
- resp = @conferences_api_instance.get_conference_member(nil, '', '')
142
+ @conferences_api_instance.get_conference_member(nil, '', '')
143
143
  }.to raise_error(ArgumentError)
144
144
  end
145
145
 
@@ -182,7 +182,7 @@ describe 'ConferencesApi' do
182
182
 
183
183
  it 'causes an ArgumentError for a missing account_id' do
184
184
  expect {
185
- resp = @conferences_api_instance.get_conference_recording(nil, '', '')
185
+ @conferences_api_instance.get_conference_recording(nil, '', '')
186
186
  }.to raise_error(ArgumentError)
187
187
  end
188
188
 
@@ -226,7 +226,7 @@ describe 'ConferencesApi' do
226
226
 
227
227
  it 'causes an ArgumentError for a missing account_id' do
228
228
  expect {
229
- resp = @conferences_api_instance.list_conference_recordings(nil, '')
229
+ @conferences_api_instance.list_conference_recordings(nil, '')
230
230
  }.to raise_error(ArgumentError)
231
231
  end
232
232
 
@@ -263,7 +263,7 @@ describe 'ConferencesApi' do
263
263
 
264
264
  it 'causes an ArgumentError for a missing account_id' do
265
265
  expect {
266
- resp = @conferences_api_instance.list_conferences(nil, {})
266
+ @conferences_api_instance.list_conferences(nil, {})
267
267
  }.to raise_error(ArgumentError)
268
268
  end
269
269
 
@@ -298,13 +298,13 @@ describe 'ConferencesApi' do
298
298
  fallback_password: 'password'
299
299
  )
300
300
 
301
- data, status_code, headers = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, conference_id, update_conference_body)
301
+ _data, status_code = @conferences_api_instance.update_conference_with_http_info(BW_ACCOUNT_ID, conference_id, update_conference_body)
302
302
  expect(status_code).to eq(204)
303
303
  end
304
304
 
305
305
  it 'causes an ArgumentError for a missing account_id' do
306
306
  expect {
307
- resp = @conferences_api_instance.update_conference(nil, '', '')
307
+ @conferences_api_instance.update_conference(nil, '', '')
308
308
  }.to raise_error(ArgumentError)
309
309
  end
310
310
 
@@ -329,13 +329,13 @@ describe 'ConferencesApi' do
329
329
 
330
330
  update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><StartRecording/><SpeakSentence locale="en_US" gender="female" voice="susan">This should be a conference recording.</SpeakSentence><StopRecording/></Bxml>'
331
331
 
332
- data, status_code, headers = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml)
332
+ _data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml)
333
333
  expect(status_code).to eq(204)
334
334
  end
335
335
 
336
336
  it 'causes an ArgumentError for a missing account_id' do
337
337
  expect {
338
- resp = @conferences_api_instance.update_conference_bxml(nil, '', '')
338
+ @conferences_api_instance.update_conference_bxml(nil, '', '')
339
339
  }.to raise_error(ArgumentError)
340
340
  end
341
341
 
@@ -362,13 +362,13 @@ describe 'ConferencesApi' do
362
362
  mute: false
363
363
  )
364
364
 
365
- data, status_code, headers = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id, update_conference_member)
365
+ _data, status_code = @conferences_api_instance.update_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id, update_conference_member)
366
366
  expect(status_code).to eq(204)
367
367
  end
368
368
 
369
369
  it 'causes an ArgumentError for a missing account_id' do
370
370
  expect {
371
- resp = @conferences_api_instance.update_conference_member(nil, '', '', {})
371
+ @conferences_api_instance.update_conference_member(nil, '', '', {})
372
372
  }.to raise_error(ArgumentError)
373
373
  end
374
374
 
@@ -30,14 +30,14 @@ describe 'MediaApi' do
30
30
  stub_request(:delete, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}").
31
31
  to_return(status: 204)
32
32
 
33
- data, status_code, headers = @media_api_instance.delete_media_with_http_info(BW_ACCOUNT_ID, media_name)
33
+ _data, status_code = @media_api_instance.delete_media_with_http_info(BW_ACCOUNT_ID, media_name)
34
34
 
35
35
  expect(status_code).to eq(204)
36
36
  end
37
37
 
38
38
  it 'causes an ArgumentError for a missing account_id' do
39
39
  expect {
40
- resp = @media_api_instance.delete_media(nil, '')
40
+ @media_api_instance.delete_media(nil, '')
41
41
  }.to raise_error(ArgumentError)
42
42
  end
43
43
 
@@ -63,7 +63,7 @@ describe 'MediaApi' do
63
63
 
64
64
  it 'causes an ArgumentError for a missing account_id' do
65
65
  expect {
66
- resp = @media_api_instance.get_media(nil, '')
66
+ @media_api_instance.get_media(nil, '')
67
67
  }.to raise_error(ArgumentError)
68
68
  end
69
69
 
@@ -93,7 +93,7 @@ describe 'MediaApi' do
93
93
 
94
94
  it 'causes an ArgumentError for a missing account_id' do
95
95
  expect {
96
- resp = @media_api_instance.list_media(nil)
96
+ @media_api_instance.list_media(nil)
97
97
  }.to raise_error(ArgumentError)
98
98
  end
99
99
  end
@@ -104,13 +104,13 @@ describe 'MediaApi' do
104
104
  stub_request(:put, "https://messaging.bandwidth.com/api/v2/users/#{BW_ACCOUNT_ID}/media/#{media_name}").
105
105
  to_return(status: 204)
106
106
 
107
- data, status_code, headers = @media_api_instance.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data)
107
+ _data, status_code = @media_api_instance.upload_media_with_http_info(BW_ACCOUNT_ID, media_name, media_data)
108
108
  expect(status_code).to eq(204)
109
109
  end
110
110
 
111
111
  it 'causes an ArgumentError for a missing account_id' do
112
112
  expect {
113
- resp = @media_api_instance.upload_media(nil, '', '')
113
+ @media_api_instance.upload_media(nil, '', '')
114
114
  }.to raise_error(ArgumentError)
115
115
  end
116
116
 
@@ -114,7 +114,7 @@ describe 'MessagesApi' do
114
114
 
115
115
  it 'causes an ArgumentError for a missing account_id' do
116
116
  expect {
117
- resp = @messaging_api_instance.create_message(nil, {})
117
+ @messaging_api_instance.create_message(nil, {})
118
118
  }.to raise_error(ArgumentError)
119
119
  end
120
120
 
@@ -186,7 +186,7 @@ describe 'MessagesApi' do
186
186
 
187
187
  it 'causes an ArgumentError for a missing account_id' do
188
188
  expect {
189
- resp = @messaging_api_instance.list_messages(nil)
189
+ @messaging_api_instance.list_messages(nil)
190
190
  }.to raise_error(ArgumentError)
191
191
  end
192
192
  end