bandwidth-sdk 12.1.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Gemfile.lock +11 -20
  4. data/README.md +2 -0
  5. data/bandwidth-sdk.gemspec +3 -1
  6. data/bandwidth.yml +28 -22
  7. data/coverage/.last_run.json +1 -1
  8. data/coverage/.resultset.json +489 -756
  9. data/coverage/index.html +5225 -8162
  10. data/custom_templates/Gemfile.mustache +1 -2
  11. data/custom_templates/gemspec.mustache +2 -0
  12. data/docs/AnswerCallback.md +1 -1
  13. data/docs/BridgeCompleteCallback.md +1 -1
  14. data/docs/BridgeTargetCompleteCallback.md +1 -1
  15. data/docs/CallRecordingMetadata.md +2 -2
  16. data/docs/CallState.md +1 -1
  17. data/docs/CallTranscription.md +6 -6
  18. data/docs/CallTranscriptionDetectedLanguageEnum.md +15 -0
  19. data/docs/CallTranscriptionResponse.md +2 -2
  20. data/docs/CallTranscriptionTrackEnum.md +15 -0
  21. data/docs/ConferenceRecordingAvailableCallback.md +1 -1
  22. data/docs/ConferenceRecordingMetadata.md +1 -1
  23. data/docs/DisconnectCallback.md +1 -1
  24. data/docs/DtmfCallback.md +2 -2
  25. data/docs/GatherCallback.md +2 -2
  26. data/docs/InitiateCallback.md +1 -1
  27. data/docs/MachineDetectionCompleteCallback.md +1 -1
  28. data/docs/MessagingCodeResponse.md +1 -1
  29. data/docs/RecordingAvailableCallback.md +2 -2
  30. data/docs/RecordingCompleteCallback.md +2 -2
  31. data/docs/RecordingTranscriptionMetadata.md +1 -1
  32. data/docs/RedirectCallback.md +2 -2
  33. data/docs/TranscriptionAvailableCallback.md +2 -2
  34. data/docs/TranscriptionsApi.md +1 -1
  35. data/docs/TransferAnswerCallback.md +2 -2
  36. data/docs/TransferCompleteCallback.md +2 -2
  37. data/docs/TransferDisconnectCallback.md +2 -2
  38. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  39. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  40. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  41. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  42. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  43. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  44. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  45. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  46. data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
  47. data/lib/bandwidth-sdk/api_client.rb +44 -41
  48. data/lib/bandwidth-sdk/api_error.rb +1 -1
  49. data/lib/bandwidth-sdk/configuration.rb +11 -1
  50. data/lib/bandwidth-sdk/models/account_statistics.rb +2 -2
  51. data/lib/bandwidth-sdk/models/answer_callback.rb +2 -2
  52. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +2 -2
  53. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +2 -2
  54. data/lib/bandwidth-sdk/models/bxml/root.rb +0 -6
  55. data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +0 -6
  56. data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +0 -6
  57. data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +0 -6
  58. data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +0 -6
  59. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  60. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +2 -2
  61. data/lib/bandwidth-sdk/models/call_state.rb +2 -2
  62. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  63. data/lib/bandwidth-sdk/models/call_transcription.rb +11 -37
  64. data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +41 -0
  65. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +2 -2
  66. data/lib/bandwidth-sdk/models/call_transcription_response.rb +2 -2
  67. data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +40 -0
  68. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  69. data/lib/bandwidth-sdk/models/code_request.rb +2 -2
  70. data/lib/bandwidth-sdk/models/conference.rb +2 -2
  71. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +2 -2
  72. data/lib/bandwidth-sdk/models/conference_created_callback.rb +2 -2
  73. data/lib/bandwidth-sdk/models/conference_member.rb +2 -2
  74. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +2 -2
  75. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +2 -2
  76. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +2 -2
  77. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -2
  78. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +2 -2
  79. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  80. data/lib/bandwidth-sdk/models/create_call.rb +2 -2
  81. data/lib/bandwidth-sdk/models/create_call_response.rb +2 -2
  82. data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -2
  83. data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -2
  84. data/lib/bandwidth-sdk/models/deferred_result.rb +2 -2
  85. data/lib/bandwidth-sdk/models/disconnect_callback.rb +2 -2
  86. data/lib/bandwidth-sdk/models/diversion.rb +2 -2
  87. data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
  88. data/lib/bandwidth-sdk/models/field_error.rb +2 -2
  89. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  90. data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
  91. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -2
  92. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +2 -2
  93. data/lib/bandwidth-sdk/models/initiate_callback.rb +2 -2
  94. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  95. data/lib/bandwidth-sdk/models/list_message_item.rb +2 -2
  96. data/lib/bandwidth-sdk/models/lookup_request.rb +2 -2
  97. data/lib/bandwidth-sdk/models/lookup_result.rb +2 -2
  98. data/lib/bandwidth-sdk/models/lookup_status.rb +2 -2
  99. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  100. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +2 -2
  101. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +2 -2
  102. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  103. data/lib/bandwidth-sdk/models/machine_detection_result.rb +2 -2
  104. data/lib/bandwidth-sdk/models/media.rb +2 -2
  105. data/lib/bandwidth-sdk/models/message.rb +2 -2
  106. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -2
  107. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +2 -2
  108. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  109. data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -2
  110. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +2 -2
  111. data/lib/bandwidth-sdk/models/message_request.rb +2 -2
  112. data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -2
  113. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +2 -2
  114. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  115. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  116. data/lib/bandwidth-sdk/models/messages_list.rb +2 -2
  117. data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -2
  118. data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -2
  119. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -2
  120. data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -2
  121. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -2
  122. data/lib/bandwidth-sdk/models/page_info.rb +2 -2
  123. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  124. data/lib/bandwidth-sdk/models/recording_available_callback.rb +2 -2
  125. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
  126. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  127. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +3 -3
  128. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +2 -2
  129. data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
  130. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  131. data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -2
  132. data/lib/bandwidth-sdk/models/tag.rb +2 -2
  133. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -2
  134. data/lib/bandwidth-sdk/models/transcribe_recording.rb +2 -2
  135. data/lib/bandwidth-sdk/models/transcription.rb +2 -2
  136. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
  137. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
  138. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
  139. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
  140. data/lib/bandwidth-sdk/models/update_call.rb +2 -2
  141. data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -2
  142. data/lib/bandwidth-sdk/models/update_conference.rb +2 -2
  143. data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -2
  144. data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -2
  145. data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -2
  146. data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -2
  147. data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -2
  148. data/lib/bandwidth-sdk/version.rb +2 -2
  149. data/lib/bandwidth-sdk.rb +3 -1
  150. data/openapitools.json +1 -1
  151. data/spec/call_utils.rb +1 -1
  152. data/spec/smoke/calls_api_spec.rb +1 -6
  153. data/spec/smoke/conferences_api_spec.rb +0 -5
  154. data/spec/smoke/media_api_spec.rb +0 -5
  155. data/spec/smoke/messages_api_spec.rb +0 -5
  156. data/spec/smoke/mfa_api_spec.rb +0 -5
  157. data/spec/smoke/phone_number_lookup_api_spec.rb +0 -5
  158. data/spec/smoke/recordings_api_spec.rb +0 -5
  159. data/spec/smoke/statistics_api_spec.rb +0 -5
  160. data/spec/smoke/transcriptions_api_spec.rb +0 -5
  161. data/spec/spec_helper.rb +11 -4
  162. data/spec/unit/api/calls_api_spec.rb +98 -128
  163. data/spec/unit/api/conferences_api_spec.rb +63 -126
  164. data/spec/unit/api/media_api_spec.rb +17 -32
  165. data/spec/unit/api/messages_api_spec.rb +46 -136
  166. data/spec/unit/api/mfa_api_spec.rb +8 -24
  167. data/spec/unit/api/phone_number_lookup_api_spec.rb +23 -37
  168. data/spec/unit/api/recordings_api_spec.rb +83 -110
  169. data/spec/unit/api/statistics_api_spec.rb +7 -15
  170. data/spec/unit/api/transcriptions_api_spec.rb +18 -37
  171. data/spec/unit/client/api_client_spec.rb +4 -4
  172. metadata +62 -44
@@ -1,47 +1,14 @@
1
1
  # Unit tests for Bandwidth::CallsApi
2
2
  describe 'CallsApi' do
3
- # call info
4
- let(:call_id) { 'c-15ac29a2-006c67ad-060f-4b98-b148-b753d6e5e2ce' }
5
- let(:enqueued_time) { '2023-06-23T18:43:51.248Z' }
6
- let(:call_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}" }
7
- let(:call_timeout) { 30.0 }
8
- let(:callback_timeout) { 15.0 }
9
- let(:privacy) { false }
10
- let(:display_name) { 'Ruby SDK' }
11
- let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
12
- let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
13
- let(:answer_fallback_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
14
- let(:answer_fallback_method) { Bandwidth::CallbackMethodEnum::POST }
15
- let(:disconnect_method) { Bandwidth::CallbackMethodEnum::GET }
16
- let(:disconnect_url) { BASE_CALLBACK_URL + '/callbacks/disconnect' }
17
- let(:priority) { 5 }
18
- let(:direction) { Bandwidth::CallDirectionEnum::OUTBOUND }
19
- let(:state) { 'disconnected' }
20
- let(:stir_shaken) { {} }
21
- let(:start_time) { '2023-06-23T19:11:06.049Z' }
22
- let(:end_time) { '2023-06-23T19:11:06.175Z' }
23
- let(:disconnect_cause) { 'rejected' }
24
- let(:error_message) { 'Destination not found' }
25
- let(:error_id) { '779941c4-6482-461d-b370-177b4ad0b5a7' }
26
- let(:last_update) { '2023-06-23T19:11:06.175Z' }
27
- let(:tag) { 'test tag' }
3
+ let(:call_id) { 'c-1234' }
28
4
 
29
- # stubs
30
- let(:create_call_headers_stub) { { 'content-type' => 'application/json' } }
31
- let(:create_call_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"enqueuedTime\":\"#{enqueued_time}\",\"callUrl\":\"#{call_url}\",\"callTimeout\":#{call_timeout},\"callbackTimeout\":#{callback_timeout},\"tag\":\"#{tag}\",\"answerMethod\":\"#{answer_method}\",\"answerUrl\":\"#{answer_url}\",\"answerFallbackUrl\":\"#{answer_fallback_url}\",\"answerFallbackMethod\":\"#{answer_fallback_method}\",\"disconnectMethod\":\"#{disconnect_method}\",\"disconnectUrl\":\"#{disconnect_url}\",\"priority\":#{priority}}" }
32
- let(:create_call_bad_request_stub) { '{"type":"validation","description":"Invalid to: must be a valid SIP URI or an E164 TN"}' }
33
- let(:get_calls_headers_stub) { { 'content-type' => 'application/json' } }
34
- let(:get_calls_body_stub) { "[{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}]" }
35
- let(:get_call_state_headers_stub) { { 'content-type' => 'application/json' } }
36
- let(:get_call_state_body_stub) { "{\"applicationId\":\"#{BW_VOICE_APPLICATION_ID}\",\"accountId\":\"#{BW_ACCOUNT_ID}\",\"callId\":\"#{call_id}\",\"to\":\"#{USER_NUMBER}\",\"from\":\"#{BW_NUMBER}\",\"direction\":\"#{direction}\",\"state\":\"#{state}\",\"stirShaken\":#{stir_shaken},\"enqueuedTime\":\"#{enqueued_time}\",\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"disconnectCause\":\"#{disconnect_cause}\",\"errorMessage\":\"#{error_message}\",\"errorId\":\"#{error_id}\",\"lastUpdate\":\"#{last_update}\"}" }
37
- let(:get_call_state_not_found_stub) { '{"type":"validation","description":"Call does-not-exist was not found."}' }
38
- let(:get_call_state_unauthorized_stub) { '{"type":"authentication-error","description":"The credentials provided were invalid"}' }
39
- let(:get_call_state_forbidden_stub) { '{"type":"authorization-error","description":"Access is denied"}' }
40
- let(:update_call_headers_stub) { { 'content-length' => '0' } }
41
-
42
5
  before(:all) do
43
6
  Bandwidth.configure do |config|
44
7
  config.debugging = true
8
+ config.username = BW_USERNAME
9
+ config.password = BW_PASSWORD
10
+ config.ignore_operation_servers = true
11
+ config.host = '127.0.0.1:4010'
45
12
  end
46
13
  @calls_api_instance = Bandwidth::CallsApi.new
47
14
  end
@@ -55,59 +22,70 @@ describe 'CallsApi' do
55
22
  # Create Call
56
23
  describe '#create_call' do
57
24
  it 'creates a call with amd' do
58
- stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
59
- to_return(status: 201, headers: create_call_headers_stub, body: create_call_body_stub)
60
-
61
25
  amd_config = Bandwidth::MachineDetectionConfiguration.new(
62
- mode: 'async',
63
- detection_timeout: 5.0,
64
- silence_timeout: 5.0,
65
- speech_threshold: 5.0,
26
+ mode: Bandwidth::MachineDetectionModeEnum::ASYNC,
27
+ detection_timeout: 15.0,
28
+ silence_timeout: 10.0,
29
+ speech_threshold: 10.0,
66
30
  speech_end_threshold: 5.0,
67
- delay_result: true,
68
- callback_url: BASE_CALLBACK_URL + '/machineDetection',
69
- callback_method: Bandwidth::CallbackMethodEnum::POST
31
+ machine_speech_end_threshold: 5.0,
32
+ delay_result: false,
33
+ callback_url: 'https://myServer.com/bandwidth/webhooks/machineDetectionComplete',
34
+ callback_method: Bandwidth::CallbackMethodEnum::POST,
35
+ username: 'mySecretUsername',
36
+ password: 'mySecretPassword1!',
37
+ fallback_url: 'https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete',
38
+ fallback_method: Bandwidth::CallbackMethodEnum::POST,
39
+ fallback_username: 'mySecretUsername',
40
+ fallback_password: 'mySecretPassword1!',
70
41
  )
71
42
 
72
43
  call_body = Bandwidth::CreateCall.new(
73
- application_id: BW_VOICE_APPLICATION_ID,
74
44
  to: USER_NUMBER,
75
45
  from: BW_NUMBER,
76
- privacy: privacy,
77
- display_name: display_name,
78
- answer_url: answer_url,
79
- answer_fallback_url: answer_fallback_url,
80
- answer_method: answer_method,
81
- disconnect_url: disconnect_url,
82
- disconnect_method: disconnect_method,
46
+ application_id: BW_VOICE_APPLICATION_ID,
47
+ answer_url: BASE_CALLBACK_URL,
48
+ answer_method: Bandwidth::CallbackMethodEnum::POST,
49
+ username: 'mySecretUsername',
50
+ password: 'mySecretPassword1!',
51
+ answer_fallback_url: 'https://www.myFallbackServer.com/webhooks/answer',
52
+ answer_fallback_method: Bandwidth::CallbackMethodEnum::POST,
53
+ fallback_username: 'mySecretUsername',
54
+ fallback_password: 'mySecretPassword1!',
55
+ disconnect_url: 'https://myServer.com/bandwidth/webhooks/disconnectUrl',
56
+ disconnect_method: Bandwidth::CallbackMethodEnum::POST,
57
+ call_timeout: 30.0,
58
+ callback_timeout: 15.0,
83
59
  machine_detection: amd_config,
84
- call_timeout: call_timeout,
85
- callback_timeout: callback_timeout,
86
- tag: tag
60
+ priority: 5,
61
+ tag: 'tag_example',
87
62
  )
88
63
 
89
- data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
64
+ data, status_code = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
90
65
 
91
66
  expect(status_code).to eq(201)
92
- expect(headers).to eq(create_call_headers_stub)
93
67
  expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
94
- expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
95
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
96
- expect(data.call_id).to eq(call_id)
97
- expect(data.to).to eq(USER_NUMBER)
98
- expect(data.from).to eq(BW_NUMBER)
99
- expect(data.enqueued_time).to eq(Time.parse(enqueued_time))
100
- expect(data.call_url).to eq(call_url)
101
- expect(data.call_timeout).to eq(call_timeout)
102
- expect(data.callback_timeout).to eq(callback_timeout)
103
- expect(data.tag).to eq(tag)
104
- expect(data.answer_method).to eq(answer_method)
105
- expect(data.answer_url).to eq(answer_url)
106
- expect(data.answer_fallback_method).to eq(answer_fallback_method)
107
- expect(data.answer_fallback_url).to eq(answer_fallback_url)
108
- expect(data.disconnect_method).to eq(disconnect_method)
109
- expect(data.disconnect_url).to eq(disconnect_url)
110
- expect(data.priority).to eq(priority)
68
+ expect(data.application_id.length).to eq(36)
69
+ expect(data.account_id.length).to eq(7)
70
+ expect(data.call_id.length).to eq(47)
71
+ expect(data.to.length).to eq(12)
72
+ expect(data.from.length).to eq(12)
73
+ expect(data.enqueued_time).to be_instance_of(Time)
74
+ expect(data.call_url).to start_with('http')
75
+ expect(data.call_timeout).to be_instance_of(Float)
76
+ expect(data.callback_timeout).to be_instance_of(Float)
77
+ expect(data.tag).to be_instance_of(String)
78
+ expect(data.answer_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
79
+ expect(data.answer_url).to start_with('http')
80
+ expect(data.answer_fallback_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
81
+ expect(data.answer_fallback_url).to start_with('http')
82
+ expect(data.disconnect_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
83
+ expect(data.disconnect_url).to start_with('http')
84
+ expect(data.username).to be_instance_of(String)
85
+ expect(data.password).to be_instance_of(String)
86
+ expect(data.fallback_username).to be_instance_of(String)
87
+ expect(data.fallback_password).to be_instance_of(String)
88
+ expect(data.priority).to be_instance_of(Integer)
111
89
  end
112
90
 
113
91
  it 'causes an ArgumentError for a missing account_id' do
@@ -126,58 +104,57 @@ describe 'CallsApi' do
126
104
  # Get Calls
127
105
  describe '#list_calls' do
128
106
  it 'gets a list of calls' do
129
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls").
130
- to_return(status: 200, headers: get_calls_headers_stub, body: get_calls_body_stub)
131
-
132
- data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
107
+ data, status_code = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
133
108
 
134
109
  expect(status_code).to eq(200)
135
- expect(headers).to eq(get_calls_headers_stub)
136
110
  expect(data).to be_instance_of(Array)
137
111
  expect(data[0]).to be_instance_of(Bandwidth::CallState)
138
- expect(data[0].application_id).to eq(BW_VOICE_APPLICATION_ID)
139
- expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
140
- expect(data[0].call_id).to eq(call_id)
141
- expect(data[0].to).to eq(USER_NUMBER)
142
- expect(data[0].from).to eq(BW_NUMBER)
143
- expect(data[0].direction).to eq(direction)
144
- expect(data[0].stir_shaken).to eq(stir_shaken)
145
- expect(data[0].state).to eq(state)
146
- expect(data[0].start_time).to eq(Time.parse(start_time))
147
- expect(data[0].end_time).to eq(Time.parse(end_time))
148
- expect(data[0].disconnect_cause).to eq(disconnect_cause)
149
- expect(data[0].error_message).to eq(error_message)
150
- expect(data[0].error_id).to eq(error_id)
151
- expect(data[0].last_update).to eq(Time.parse(last_update))
112
+ expect(data[0].application_id.length).to eq(36)
113
+ expect(data[0].account_id.length).to eq(7)
114
+ expect(data[0].call_id.length).to eq(47)
115
+ expect(data[0].parent_call_id.length).to eq(47)
116
+ expect(data[0].to.length).to eq(12)
117
+ expect(data[0].from.length).to eq(12)
118
+ expect(data[0].direction).to be_one_of(Bandwidth::CallDirectionEnum.all_vars)
119
+ expect(data[0].state).to be_instance_of(String)
120
+ expect(data[0].stir_shaken).to be_instance_of(Hash)
121
+ expect(data[0].identity).to be_instance_of(String)
122
+ expect(data[0].enqueued_time).to be_instance_of(Time)
123
+ expect(data[0].start_time).to be_instance_of(Time)
124
+ expect(data[0].answer_time).to be_instance_of(Time)
125
+ expect(data[0].end_time).to be_instance_of(Time)
126
+ expect(data[0].disconnect_cause).to be_instance_of(String)
127
+ expect(data[0]).to respond_to(:error_message)
128
+ expect(data[0]).to respond_to(:error_id)
129
+ expect(data[0].last_update).to be_instance_of(Time)
152
130
  end
153
131
  end
154
132
 
155
- # Get Call State Information
133
+ # # Get Call State Information
156
134
  describe '#get_call_state' do
157
135
  it 'gets the call state' do
158
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}").
159
- to_return(status: 200, headers: get_call_state_headers_stub, body: get_call_state_body_stub)
160
-
161
- data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
136
+ data, status_code = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
162
137
 
163
138
  expect(status_code).to eq(200)
164
- expect(headers).to eq(get_call_state_headers_stub)
165
139
  expect(data).to be_instance_of(Bandwidth::CallState)
166
- expect(data.application_id).to eq(BW_VOICE_APPLICATION_ID)
167
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
168
- expect(data.call_id).to eq(call_id)
169
- expect(data.to).to eq(USER_NUMBER)
170
- expect(data.from).to eq(BW_NUMBER)
171
- expect(data.direction).to eq(direction)
172
- expect(data.stir_shaken).to eq(stir_shaken)
173
- expect(data.state).to eq(state)
174
- expect(data.enqueued_time).to eq(Time.parse(enqueued_time))
175
- expect(data.start_time).to eq(Time.parse(start_time))
176
- expect(data.end_time).to eq(Time.parse(end_time))
177
- expect(data.disconnect_cause).to eq(disconnect_cause)
178
- expect(data.error_message).to eq(error_message)
179
- expect(data.error_id).to eq(error_id)
180
- expect(data.last_update).to eq(Time.parse(last_update))
140
+ expect(data.application_id.length).to eq(36)
141
+ expect(data.account_id.length).to eq(7)
142
+ expect(data.call_id.length).to eq(47)
143
+ expect(data.parent_call_id.length).to eq(47)
144
+ expect(data.to.length).to eq(12)
145
+ expect(data.from.length).to eq(12)
146
+ expect(data.direction).to be_one_of(Bandwidth::CallDirectionEnum.all_vars)
147
+ expect(data.state).to be_instance_of(String)
148
+ expect(data.stir_shaken).to be_instance_of(Hash)
149
+ expect(data.identity).to be_instance_of(String)
150
+ expect(data.enqueued_time).to be_instance_of(Time)
151
+ expect(data.start_time).to be_instance_of(Time)
152
+ expect(data.answer_time).to be_instance_of(Time)
153
+ expect(data.end_time).to be_instance_of(Time)
154
+ expect(data.disconnect_cause).to be_instance_of(String)
155
+ expect(data).to respond_to(:error_message)
156
+ expect(data).to respond_to(:error_id)
157
+ expect(data.last_update).to be_instance_of(Time)
181
158
  end
182
159
 
183
160
  it 'causes an ArgumentError for a missing account_id' do
@@ -193,21 +170,17 @@ describe 'CallsApi' do
193
170
  end
194
171
  end
195
172
 
196
- # Update Call
173
+ # # Update Call
197
174
  describe '#update_call' do
198
175
  it 'creates and updates a call' do
199
- stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}").
200
- to_return(status: 200, headers: update_call_headers_stub)
201
-
202
176
  update_call_body = Bandwidth::UpdateCall.new(
203
177
  state: Bandwidth::CallStateEnum::ACTIVE,
204
178
  redirect_url: MANTECA_BASE_URL + '/bxml/pause'
205
179
  )
206
180
 
207
- _data, status_code, headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
181
+ _data, status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
208
182
 
209
183
  expect(status_code).to eq(200)
210
- expect(headers).to eq(update_call_headers_stub)
211
184
  end
212
185
 
213
186
  it 'causes an ArgumentError for a missing account_id' do
@@ -232,10 +205,7 @@ describe 'CallsApi' do
232
205
  # Update Call BXML
233
206
  describe '#update_call_bxml' do
234
207
  it 'updates a call using bxml' do
235
- stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/calls/#{call_id}/bxml").
236
- to_return(status: 204)
237
-
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>'
208
+ 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>"
239
209
 
240
210
  _data, status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, update_bxml)
241
211
 
@@ -1,41 +1,16 @@
1
1
  # Unit tests for Bandwidth::ConferencesApi
2
2
  describe 'ConferencesApi' do
3
- # conference info
4
- let(:test_id) { 'ruby-3.1.3_macOS_conference_1687791527' }
5
- let(:conference_id) { 'conf-3f758f24-6711b6d2-0d44-495d-afc8-2555c3ce5f4f' }
6
- let(:created_time) { '2023-06-26T14:58:49.471Z' }
7
- let(:conference_event_url) { 'https://amazonaws.com/prod/conferenceEvents' }
8
- let(:conference_event_method) { 'POST' }
9
- let(:call_id) { 'c-3f758f24-cd77b08f-97c2-4311-965a-a1ac8ed8f340' }
10
- let(:recording_id) { 'r-fbe05094-7bf4b314-91fe-4bdd-a39b-500cdc873d3a' }
11
- let(:start_time) { '2023-06-26T14:58:51.195Z' }
12
- let(:end_time) { '2023-06-26T14:58:57.502Z' }
13
- let(:duration) { 'PT6.3S' }
14
- let(:channels) { 1 }
15
- let(:file_format) { Bandwidth::FileFormatEnum::WAV }
16
- let(:status) { 'complete' }
17
- let(:member_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}" }
18
- let(:media_url) { "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}/media" }
19
- let(:active_members) { "[{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}]" }
20
-
21
- # stubs
22
- let(:list_conferences_headers_stub) { { 'content-type' => 'application/json' } }
23
- let(:list_conferences_body_stub) { "[{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\"}]" }
24
- let(:get_conference_headers_stub) { { 'content-type' => 'application/json' } }
25
- let(:get_conference_body_stub) { "{\"id\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"createdTime\":\"#{created_time}\",\"conferenceEventUrl\":\"#{conference_event_url}\",\"conferenceEventMethod\":\"#{conference_event_method}\",\"tag\":\"#{test_id}\",\"activeMembers\":#{active_members}}" }
26
- let(:get_conference_member_headers_stub) { { 'content-type' => 'application/json' } }
27
- let(:get_conference_member_body_stub) { "{\"callId\":\"#{call_id}\",\"conferenceId\":\"#{conference_id}\",\"memberUrl\":\"#{member_url}\",\"mute\":false,\"hold\":false,\"callIdsToCoach\":[]}" }
28
- let(:list_conference_recordings_headers_stub) { { 'content-type' => 'application/json' } }
29
- let(:list_conference_recordings_body_stub) { "[{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}]" }
30
- let(:get_conference_recording_headers_stub) { { 'content-type' => 'application/json' } }
31
- let(:get_conference_recording_body_stub) { "{\"accountId\":\"#{BW_ACCOUNT_ID}\",\"conferenceId\":\"#{conference_id}\",\"name\":\"#{test_id}\",\"recordingId\":\"#{recording_id}\",\"duration\":\"#{duration}\",\"channels\":#{channels},\"startTime\":\"#{start_time}\",\"endTime\":\"#{end_time}\",\"fileFormat\":\"#{file_format}\",\"status\":\"#{status}\",\"mediaUrl\":\"#{media_url}\"}" }
32
- let(:download_conference_recording_body_stub) { 'RIFFWAVEfmtLISTINFOISFTLavf58.45.100data' }
33
- let(:download_conference_recording_headers_stub) { { 'content-type' => 'audio/vnd.wave', 'content-length' => "#{download_conference_recording_body_stub.length}" } }
34
-
3
+ let(:call_id) { 'c-1234' }
4
+ let(:conference_id) { 'c-4321' }
5
+ let(:recording_id) { 'r-1234' }
6
+
35
7
  before(:all) do
36
8
  Bandwidth.configure do |config|
37
- config.return_binary_data = true
38
9
  config.debugging = true
10
+ config.username = BW_USERNAME
11
+ config.password = BW_PASSWORD
12
+ config.ignore_operation_servers = true
13
+ config.host = '127.0.0.1:4010'
39
14
  end
40
15
  @conferences_api_instance = Bandwidth::ConferencesApi.new
41
16
  end
@@ -48,16 +23,13 @@ describe 'ConferencesApi' do
48
23
 
49
24
  # Download Conference Recording
50
25
  describe 'download_conference_recording test' do
51
- it 'should work' do
52
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}/media").
53
- to_return(status: 200, headers: download_conference_recording_headers_stub, body: download_conference_recording_body_stub)
54
-
55
- data, status_code, headers = @conferences_api_instance.download_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
26
+ it 'download a conference recording' do
27
+ data, status_code = @conferences_api_instance.download_conference_recording_with_http_info(
28
+ BW_ACCOUNT_ID, conference_id, recording_id, { header_params: { 'Accept' => 'audio/vnd.wave' } })
56
29
 
57
30
  expect(status_code).to eq(200)
58
- expect(headers).to eq(download_conference_recording_headers_stub)
59
- expect(data).to eq(download_conference_recording_body_stub)
60
- end
31
+ # expect(data).to be_instance_of(String)
32
+ end if false # skip for now due to an issue with setting the Accept header
61
33
 
62
34
  it 'causes an ArgumentError for a missing account_id' do
63
35
  expect {
@@ -81,28 +53,17 @@ describe 'ConferencesApi' do
81
53
  # Get Conference Information
82
54
  describe 'get_conference' do
83
55
  it 'get a conference by id' do
84
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}").
85
- to_return(status: 200, headers: get_conference_headers_stub, body: get_conference_body_stub)
86
-
87
- data, status_code, headers = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, conference_id)
56
+ data, status_code = @conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, conference_id)
88
57
 
89
58
  expect(status_code).to eq(200)
90
- expect(headers).to eq(get_conference_headers_stub)
91
59
  expect(data).to be_instance_of(Bandwidth::Conference)
92
- expect(data.id).to eq(conference_id)
93
- expect(data.name).to eq(test_id)
94
- expect(data.tag).to eq(test_id)
95
- expect(data.created_time).to eq(Time.parse(created_time))
96
- expect(data.conference_event_url).to eq(conference_event_url)
97
- expect(data.conference_event_method).to eq(conference_event_method)
98
- expect(data.active_members).to be_instance_of(Array)
99
- expect(data.active_members[0]).to be_instance_of(Bandwidth::ConferenceMember)
100
- expect(data.active_members[0].call_id).to eq(call_id)
101
- expect(data.active_members[0].conference_id).to eq(conference_id)
102
- expect(data.active_members[0].member_url).to eq(member_url)
103
- expect(data.active_members[0].mute).to be false
104
- expect(data.active_members[0].hold).to be false
105
- expect(data.active_members[0].call_ids_to_coach).to eq([])
60
+ expect(data.id.length).to eq(50)
61
+ expect(data.name).to be_instance_of(String)
62
+ expect(data.created_time).to be_instance_of(Time)
63
+ expect(data.completed_time).to be_instance_of(Time)
64
+ expect(data.conference_event_url).to start_with('http')
65
+ expect(data.conference_event_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
66
+ expect(data.tag).to be_instance_of(String)
106
67
  end
107
68
 
108
69
  it 'causes an ArgumentError for a missing account_id' do
@@ -121,20 +82,16 @@ describe 'ConferencesApi' do
121
82
  # Get Conference Member
122
83
  describe 'get_conference_member' do
123
84
  it 'gets a conference member by call id' do
124
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}").
125
- to_return(status: 200, headers: get_conference_member_headers_stub, body: get_conference_member_body_stub)
126
-
127
- data, status_code, headers = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id)
85
+ data, status_code = @conferences_api_instance.get_conference_member_with_http_info(BW_ACCOUNT_ID, conference_id, call_id)
128
86
 
129
87
  expect(status_code).to eq(200)
130
- expect(headers).to eq(get_conference_member_headers_stub)
131
88
  expect(data).to be_instance_of(Bandwidth::ConferenceMember)
132
- expect(data.conference_id).to eq(conference_id)
133
- expect(data.call_id).to eq(call_id)
134
- expect(data.member_url).to eq(member_url)
135
- expect(data.mute).to be false
136
- expect(data.hold).to be false
137
- expect(data.call_ids_to_coach).to eq([])
89
+ expect(data.call_id.length).to eq(47)
90
+ expect(data.conference_id.length).to eq(50)
91
+ expect(data.member_url).to start_with('http')
92
+ expect(data.mute).to be_one_of([true, false])
93
+ expect(data.hold).to be_one_of([true, false])
94
+ expect(data.call_ids_to_coach).to be_instance_of(Array)
138
95
  end
139
96
 
140
97
  it 'causes an ArgumentError for a missing account_id' do
@@ -159,25 +116,21 @@ describe 'ConferencesApi' do
159
116
  # Get Conference Recording Information
160
117
  describe 'get_conference_recording' do
161
118
  it 'gets a conference recording by id' do
162
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings/#{recording_id}").
163
- to_return(status: 200, headers: get_conference_recording_headers_stub, body: get_conference_recording_body_stub)
164
-
165
- data, status_code, headers = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
119
+ data, status_code = @conferences_api_instance.get_conference_recording_with_http_info(BW_ACCOUNT_ID, conference_id, recording_id)
166
120
 
167
121
  expect(status_code).to eq(200)
168
- expect(headers).to eq(get_conference_recording_headers_stub)
169
122
  expect(data).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
170
- expect(data.account_id).to eq(BW_ACCOUNT_ID)
171
- expect(data.conference_id).to eq(conference_id)
172
- expect(data.name).to eq(test_id)
173
- expect(data.recording_id).to eq(recording_id)
174
- expect(data.duration).to eq(duration)
175
- expect(data.channels).to eq(channels)
176
- expect(data.start_time).to eq(Time.parse(start_time))
177
- expect(data.end_time).to eq(Time.parse(end_time))
178
- expect(data.file_format).to eq(Bandwidth::FileFormatEnum::WAV)
179
- expect(data.status).to eq('complete')
180
- expect(data.media_url).to eq(media_url)
123
+ expect(data.account_id.length).to eq(7)
124
+ expect(data.conference_id.length).to eq(50)
125
+ expect(data.name).to be_instance_of(String)
126
+ expect(data.recording_id.length).to eq(47)
127
+ expect(data.duration).to start_with('PT')
128
+ expect(data.channels).to be_instance_of(Integer)
129
+ expect(data.start_time).to be_instance_of(Time)
130
+ expect(data.end_time).to be_instance_of(Time)
131
+ expect(data.file_format).to be_one_of(Bandwidth::FileFormatEnum.all_vars)
132
+ expect(data.status).to be_instance_of(String)
133
+ expect(data.media_url).to start_with('http')
181
134
  end
182
135
 
183
136
  it 'causes an ArgumentError for a missing account_id' do
@@ -199,29 +152,25 @@ describe 'ConferencesApi' do
199
152
  end
200
153
  end
201
154
 
202
- # Get Conference Recordings
155
+ # List Conference Recordings
203
156
  describe 'list_conference_recordings' do
204
157
  it 'lists recordings for a conference' do
205
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/recordings").
206
- to_return(status: 200, headers: list_conference_recordings_headers_stub, body: list_conference_recordings_body_stub)
207
-
208
- data, status_code, headers = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, conference_id)
158
+ data, status_code = @conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, conference_id)
209
159
 
210
160
  expect(status_code).to eq(200)
211
- expect(headers).to eq(list_conference_recordings_headers_stub)
212
161
  expect(data).to be_instance_of(Array)
213
162
  expect(data[0]).to be_instance_of(Bandwidth::ConferenceRecordingMetadata)
214
- expect(data[0].account_id).to eq(BW_ACCOUNT_ID)
215
- expect(data[0].conference_id).to eq(conference_id)
216
- expect(data[0].name).to eq(test_id)
217
- expect(data[0].recording_id).to eq(recording_id)
218
- expect(data[0].duration).to eq(duration)
219
- expect(data[0].channels).to eq(channels)
220
- expect(data[0].start_time).to eq(Time.parse(start_time))
221
- expect(data[0].end_time).to eq(Time.parse(end_time))
222
- expect(data[0].file_format).to eq(Bandwidth::FileFormatEnum::WAV)
223
- expect(data[0].status).to eq('complete')
224
- expect(data[0].media_url).to eq(media_url)
163
+ expect(data[0].account_id.length).to eq(7)
164
+ expect(data[0].conference_id.length).to eq(50)
165
+ expect(data[0].name).to be_instance_of(String)
166
+ expect(data[0].recording_id.length).to eq(47)
167
+ expect(data[0].duration).to start_with('PT')
168
+ expect(data[0].channels).to be_instance_of(Integer)
169
+ expect(data[0].start_time).to be_instance_of(Time)
170
+ expect(data[0].end_time).to be_instance_of(Time)
171
+ expect(data[0].file_format).to be_one_of(Bandwidth::FileFormatEnum.all_vars)
172
+ expect(data[0].status).to be_instance_of(String)
173
+ expect(data[0].media_url).to start_with('http')
225
174
  end
226
175
 
227
176
  it 'causes an ArgumentError for a missing account_id' do
@@ -237,28 +186,25 @@ describe 'ConferencesApi' do
237
186
  end
238
187
  end
239
188
 
240
- # Get Conferences
189
+ # List Conferences
241
190
  describe 'list_conferences' do
242
191
  it 'list all conferences' do
243
- stub_request(:get, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences?name=#{test_id}").
244
- to_return(status: 200, headers: list_conferences_headers_stub, body: list_conferences_body_stub)
245
-
246
192
  conference_opts = {
247
- name: test_id
193
+ name: call_id
248
194
  }
249
195
 
250
- data, status_code, headers = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
196
+ data, status_code = @conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID, conference_opts)
251
197
 
252
198
  expect(status_code).to eq(200)
253
- expect(headers).to eq(list_conferences_headers_stub)
254
199
  expect(data).to be_instance_of(Array)
255
200
  expect(data[0]).to be_instance_of(Bandwidth::Conference)
256
- expect(data[0].id).to eq(conference_id)
257
- expect(data[0].name).to eq(test_id)
258
- expect(data[0].tag).to eq(test_id)
259
- expect(data[0].created_time).to eq(Time.parse(created_time))
260
- expect(data[0].conference_event_url).to eq(conference_event_url)
261
- expect(data[0].conference_event_method).to eq(conference_event_method)
201
+ expect(data[0].id.length).to eq(50)
202
+ expect(data[0].name).to be_instance_of(String)
203
+ expect(data[0].created_time).to be_instance_of(Time)
204
+ expect(data[0].completed_time).to be_instance_of(Time)
205
+ expect(data[0].conference_event_url).to start_with('http')
206
+ expect(data[0].conference_event_method).to be_one_of(Bandwidth::CallbackMethodEnum.all_vars)
207
+ expect(data[0].tag).to be_instance_of(String)
262
208
  end
263
209
 
264
210
  it 'causes an ArgumentError for a missing account_id' do
@@ -283,9 +229,6 @@ describe 'ConferencesApi' do
283
229
  # Update Conference
284
230
  describe 'update_conference' do
285
231
  it 'updates a conference' do
286
- stub_request(:post, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}").
287
- to_return(status: 204)
288
-
289
232
  update_conference_body = Bandwidth::UpdateConference.new(
290
233
  status: Bandwidth::ConferenceStateEnum::ACTIVE,
291
234
  redirect_url: BASE_CALLBACK_URL + '/bxml/pause',
@@ -324,9 +267,6 @@ describe 'ConferencesApi' do
324
267
  # Update Conference BXML
325
268
  describe 'update_conference_bxml' do
326
269
  it 'updates a conference using bxml' do
327
- stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/bxml").
328
- to_return(status: 204)
329
-
330
270
  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
271
 
332
272
  _data, status_code = @conferences_api_instance.update_conference_bxml_with_http_info(BW_ACCOUNT_ID, conference_id, update_bxml)
@@ -355,9 +295,6 @@ describe 'ConferencesApi' do
355
295
  # Update Conference Member
356
296
  describe 'update_conference_member' do
357
297
  it 'updates a conference member by call id' do
358
- stub_request(:put, "https://voice.bandwidth.com/api/v2/accounts/#{BW_ACCOUNT_ID}/conferences/#{conference_id}/members/#{call_id}").
359
- to_return(status: 204)
360
-
361
298
  update_conference_member = Bandwidth::UpdateConferenceMember.new(
362
299
  mute: false
363
300
  )