bandwidth-sdk 12.0.0 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/Gemfile.lock +13 -22
- data/README.md +3 -1
- data/Rakefile +4 -12
- data/bandwidth-sdk.gemspec +3 -1
- data/bandwidth.yml +48 -33
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1333 -1598
- data/coverage/index.html +6890 -9805
- data/custom_templates/Gemfile.mustache +1 -2
- data/custom_templates/gemspec.mustache +2 -0
- data/docs/AnswerCallback.md +2 -2
- data/docs/BridgeCompleteCallback.md +2 -2
- data/docs/BridgeTargetCompleteCallback.md +2 -2
- data/docs/CallRecordingMetadata.md +4 -4
- data/docs/CallState.md +1 -1
- data/docs/CallTranscription.md +6 -6
- data/docs/CallTranscriptionDetectedLanguageEnum.md +15 -0
- data/docs/CallTranscriptionResponse.md +2 -2
- data/docs/CallTranscriptionTrackEnum.md +15 -0
- data/docs/CallsApi.md +1 -1
- data/docs/ConferenceMemberExitCallback.md +1 -1
- data/docs/ConferenceMemberJoinCallback.md +1 -1
- data/docs/ConferenceRecordingAvailableCallback.md +1 -1
- data/docs/ConferenceRecordingMetadata.md +1 -1
- data/docs/CreateCall.md +5 -3
- data/docs/DisconnectCallback.md +2 -2
- data/docs/DtmfCallback.md +4 -4
- data/docs/GatherCallback.md +4 -4
- data/docs/InitiateCallback.md +2 -2
- data/docs/MachineDetectionCompleteCallback.md +2 -2
- data/docs/MessagingCodeResponse.md +1 -1
- data/docs/RecordingAvailableCallback.md +4 -4
- data/docs/RecordingCompleteCallback.md +4 -4
- data/docs/RecordingTranscriptionMetadata.md +1 -1
- data/docs/RedirectCallback.md +4 -4
- data/docs/TranscriptionAvailableCallback.md +4 -4
- data/docs/TranscriptionsApi.md +1 -1
- data/docs/TransferAnswerCallback.md +4 -4
- data/docs/TransferCompleteCallback.md +4 -4
- data/docs/TransferDisconnectCallback.md +4 -4
- data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
- data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
- data/lib/bandwidth-sdk/api/media_api.rb +1 -1
- data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
- data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
- data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
- data/lib/bandwidth-sdk/api_client.rb +44 -41
- data/lib/bandwidth-sdk/api_error.rb +1 -1
- data/lib/bandwidth-sdk/configuration.rb +11 -1
- data/lib/bandwidth-sdk/models/account_statistics.rb +2 -2
- data/lib/bandwidth-sdk/models/answer_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/bxml/root.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/gather.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb +0 -6
- data/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb +0 -6
- data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +4 -4
- data/lib/bandwidth-sdk/models/call_state.rb +2 -2
- data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/call_transcription.rb +11 -37
- data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +41 -0
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +2 -2
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +2 -2
- data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +40 -0
- data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/code_request.rb +2 -2
- data/lib/bandwidth-sdk/models/conference.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_completed_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_created_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_member.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +16 -5
- data/lib/bandwidth-sdk/models/create_call_response.rb +2 -2
- data/lib/bandwidth-sdk/models/create_lookup_response.rb +2 -2
- data/lib/bandwidth-sdk/models/create_message_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/deferred_result.rb +2 -2
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/diversion.rb +2 -2
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/field_error.rb +2 -2
- data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/gather_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/inbound_message_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/initiate_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_request.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_result.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_status.rb +2 -2
- data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +3 -3
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +3 -3
- data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_result.rb +2 -2
- data/lib/bandwidth-sdk/models/media.rb +2 -2
- data/lib/bandwidth-sdk/models/message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_delivered_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_failed_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_request.rb +2 -2
- data/lib/bandwidth-sdk/models/message_sending_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +2 -2
- data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/messages_list.rb +2 -2
- data/lib/bandwidth-sdk/models/messaging_code_response.rb +2 -2
- data/lib/bandwidth-sdk/models/messaging_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/page_info.rb +2 -2
- data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +3 -3
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +2 -2
- data/lib/bandwidth-sdk/models/redirect_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
- data/lib/bandwidth-sdk/models/stir_shaken.rb +2 -2
- data/lib/bandwidth-sdk/models/tag.rb +2 -2
- data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +2 -2
- data/lib/bandwidth-sdk/models/transcribe_recording.rb +2 -2
- data/lib/bandwidth-sdk/models/transcription.rb +2 -2
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/update_call.rb +2 -2
- data/lib/bandwidth-sdk/models/update_call_recording.rb +2 -2
- data/lib/bandwidth-sdk/models/update_conference.rb +2 -2
- data/lib/bandwidth-sdk/models/update_conference_member.rb +2 -2
- data/lib/bandwidth-sdk/models/verify_code_request.rb +2 -2
- data/lib/bandwidth-sdk/models/verify_code_response.rb +2 -2
- data/lib/bandwidth-sdk/models/voice_api_error.rb +2 -2
- data/lib/bandwidth-sdk/models/voice_code_response.rb +2 -2
- data/lib/bandwidth-sdk/version.rb +2 -2
- data/lib/bandwidth-sdk.rb +3 -1
- data/openapitools.json +1 -1
- data/spec/call_utils.rb +1 -1
- data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +3 -6
- data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +0 -5
- data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +0 -5
- data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +0 -5
- data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +0 -5
- data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +0 -5
- data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +0 -5
- data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +0 -5
- data/spec/{integration/transcriptions_api_integration_spec.rb → smoke/transcriptions_api_spec.rb} +0 -5
- data/spec/spec_helper.rb +13 -6
- data/spec/unit/api/calls_api_spec.rb +233 -0
- data/spec/unit/api/conferences_api_spec.rb +330 -0
- data/spec/{api → unit/api}/media_api_spec.rb +17 -32
- data/spec/unit/api/messages_api_spec.rb +103 -0
- data/spec/{api → unit/api}/mfa_api_spec.rb +8 -24
- data/spec/unit/api/phone_number_lookup_api_spec.rb +86 -0
- data/spec/{api → unit/api}/recordings_api_spec.rb +83 -110
- data/spec/unit/api/statistics_api_spec.rb +37 -0
- data/spec/{api → unit/api}/transcriptions_api_spec.rb +18 -37
- data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +4 -4
- metadata +136 -118
- data/spec/api/calls_api_spec.rb +0 -261
- data/spec/api/conferences_api_spec.rb +0 -393
- data/spec/api/messages_api_spec.rb +0 -193
- data/spec/api/phone_number_lookup_api_spec.rb +0 -100
- data/spec/api/statistics_api_spec.rb +0 -45
- /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
- /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
- /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
- /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
- /data/spec/{models → unit/models}/message_spec.rb +0 -0
- /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -8,7 +8,7 @@
|
|
8
8
|
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
|
9
9
|
| **account_id** | **String** | The user account associated with the call. | [optional] |
|
10
10
|
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
|
11
|
-
| **from** | **String** | The provided identifier of the caller
|
11
|
+
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
|
12
12
|
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
|
13
13
|
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
|
14
14
|
| **call_id** | **String** | The call id associated with the event. | [optional] |
|
@@ -17,7 +17,7 @@
|
|
17
17
|
| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
|
18
18
|
| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
|
19
19
|
| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
|
20
|
-
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
20
|
+
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
|
21
21
|
| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
|
22
22
|
| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
|
23
23
|
| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
|
@@ -31,7 +31,7 @@ require 'bandwidth-sdk'
|
|
31
31
|
instance = Bandwidth::TransferCompleteCallback.new(
|
32
32
|
event_type: bridgeComplete,
|
33
33
|
event_time: 2022-06-17T22:19:40.375Z,
|
34
|
-
account_id:
|
34
|
+
account_id: 9900000,
|
35
35
|
application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
|
36
36
|
from: +15555555555,
|
37
37
|
to: +15555555555,
|
@@ -43,7 +43,7 @@ instance = Bandwidth::TransferCompleteCallback.new(
|
|
43
43
|
answer_time: 2022-06-17T22:20Z,
|
44
44
|
tag: exampleTag,
|
45
45
|
transfer_caller_id: +15555555555,
|
46
|
-
transfer_to: +15555555555
|
46
|
+
transfer_to: +15555555555,
|
47
47
|
cause: busy,
|
48
48
|
error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
|
49
49
|
error_id: 4642074b-7b58-478b-96e4-3a60955c6765
|
@@ -8,7 +8,7 @@
|
|
8
8
|
| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
|
9
9
|
| **account_id** | **String** | The user account associated with the call. | [optional] |
|
10
10
|
| **application_id** | **String** | The id of the application associated with the call. | [optional] |
|
11
|
-
| **from** | **String** | The provided identifier of the caller
|
11
|
+
| **from** | **String** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] |
|
12
12
|
| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
|
13
13
|
| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
|
14
14
|
| **call_id** | **String** | The call id associated with the event. | [optional] |
|
@@ -19,7 +19,7 @@
|
|
19
19
|
| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
|
20
20
|
| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
|
21
21
|
| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
|
22
|
-
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
22
|
+
| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
|
23
23
|
| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
|
24
24
|
| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
|
25
25
|
| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
|
@@ -33,7 +33,7 @@ require 'bandwidth-sdk'
|
|
33
33
|
instance = Bandwidth::TransferDisconnectCallback.new(
|
34
34
|
event_type: bridgeComplete,
|
35
35
|
event_time: 2022-06-17T22:19:40.375Z,
|
36
|
-
account_id:
|
36
|
+
account_id: 9900000,
|
37
37
|
application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
|
38
38
|
from: +15555555555,
|
39
39
|
to: +15555555555,
|
@@ -47,7 +47,7 @@ instance = Bandwidth::TransferDisconnectCallback.new(
|
|
47
47
|
end_time: 2022-06-17T22:20Z,
|
48
48
|
tag: exampleTag,
|
49
49
|
transfer_caller_id: +15555555555,
|
50
|
-
transfer_to: +15555555555
|
50
|
+
transfer_to: +15555555555,
|
51
51
|
cause: busy,
|
52
52
|
error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
|
53
53
|
error_id: 4642074b-7b58-478b-96e4-3a60955c6765
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -20,7 +20,7 @@ module Bandwidth
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Delete a specific transcription
|
23
|
-
# Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `
|
23
|
+
# Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `200` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
|
24
24
|
# @param account_id [String] Your Bandwidth Account ID.
|
25
25
|
# @param call_id [String] Programmable Voice API Call ID.
|
26
26
|
# @param transcription_id [String] Programmable Voice API Transcription ID.
|
@@ -32,7 +32,7 @@ module Bandwidth
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Delete a specific transcription
|
35
|
-
# Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `
|
35
|
+
# Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `200` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
|
36
36
|
# @param account_id [String] Your Bandwidth Account ID.
|
37
37
|
# @param call_id [String] Programmable Voice API Call ID.
|
38
38
|
# @param transcription_id [String] Programmable Voice API Transcription ID.
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -17,6 +17,8 @@ require 'tempfile'
|
|
17
17
|
require 'time'
|
18
18
|
require 'faraday'
|
19
19
|
require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
|
20
|
+
require 'marcel'
|
21
|
+
|
20
22
|
|
21
23
|
module Bandwidth
|
22
24
|
class ApiClient
|
@@ -48,9 +50,11 @@ module Bandwidth
|
|
48
50
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
49
51
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
50
52
|
def call_api(http_method, path, opts = {})
|
53
|
+
stream = nil
|
51
54
|
begin
|
52
55
|
response = connection(opts).public_send(http_method.to_sym.downcase) do |req|
|
53
|
-
build_request(http_method, path, req, opts)
|
56
|
+
request = build_request(http_method, path, req, opts)
|
57
|
+
stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
|
54
58
|
end
|
55
59
|
|
56
60
|
if config.debugging
|
@@ -75,7 +79,9 @@ module Bandwidth
|
|
75
79
|
fail ApiError.new('Connection failed')
|
76
80
|
end
|
77
81
|
|
78
|
-
if opts[:return_type]
|
82
|
+
if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
|
83
|
+
data = deserialize_file(response, stream)
|
84
|
+
elsif opts[:return_type]
|
79
85
|
data = deserialize(response, opts[:return_type])
|
80
86
|
else
|
81
87
|
data = nil
|
@@ -117,7 +123,6 @@ module Bandwidth
|
|
117
123
|
|
118
124
|
request.url url
|
119
125
|
request.params = query_params
|
120
|
-
download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
|
121
126
|
request
|
122
127
|
end
|
123
128
|
|
@@ -136,8 +141,7 @@ module Bandwidth
|
|
136
141
|
form_params.each do |key, value|
|
137
142
|
case value
|
138
143
|
when ::File, ::Tempfile
|
139
|
-
|
140
|
-
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
|
144
|
+
data[key] = Faraday::FilePart.new(value.path, Marcel::MimeType.for(Pathname.new(value.path)))
|
141
145
|
when ::Array, nil
|
142
146
|
# let Faraday handle Array and nil parameters
|
143
147
|
data[key] = value
|
@@ -154,11 +158,40 @@ module Bandwidth
|
|
154
158
|
end
|
155
159
|
|
156
160
|
def download_file(request)
|
157
|
-
|
161
|
+
stream = []
|
158
162
|
|
159
163
|
# handle streaming Responses
|
160
164
|
request.options.on_data = Proc.new do |chunk, overall_received_bytes|
|
161
|
-
|
165
|
+
stream << chunk
|
166
|
+
end
|
167
|
+
stream
|
168
|
+
end
|
169
|
+
|
170
|
+
def deserialize_file(response, stream)
|
171
|
+
body = response.body
|
172
|
+
if @config.return_binary_data == true
|
173
|
+
# return byte stream
|
174
|
+
encoding = body.encoding
|
175
|
+
stream.join.force_encoding(encoding)
|
176
|
+
else
|
177
|
+
# return file instead of binary data
|
178
|
+
content_disposition = response.headers['Content-Disposition']
|
179
|
+
if content_disposition && content_disposition =~ /filename=/i
|
180
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
181
|
+
prefix = sanitize_filename(filename)
|
182
|
+
else
|
183
|
+
prefix = 'download-'
|
184
|
+
end
|
185
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
186
|
+
encoding = body.encoding
|
187
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
188
|
+
tempfile.write(stream.join.force_encoding(encoding))
|
189
|
+
tempfile.close
|
190
|
+
config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
191
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
192
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
193
|
+
"explicitly with `tempfile.delete`"
|
194
|
+
tempfile
|
162
195
|
end
|
163
196
|
end
|
164
197
|
|
@@ -216,7 +249,7 @@ module Bandwidth
|
|
216
249
|
# @param [String] mime MIME
|
217
250
|
# @return [Boolean] True if the MIME is application/json
|
218
251
|
def json_mime?(mime)
|
219
|
-
(mime == '*/*') || !(mime =~
|
252
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
220
253
|
end
|
221
254
|
|
222
255
|
# Deserialize the response to the given return type.
|
@@ -225,40 +258,10 @@ module Bandwidth
|
|
225
258
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
226
259
|
def deserialize(response, return_type)
|
227
260
|
body = response.body
|
228
|
-
|
229
|
-
# handle file downloading - return the File instance processed in request callbacks
|
230
|
-
# note that response body is empty when the file is written in chunks in request on_body callback
|
231
|
-
if return_type == 'File'
|
232
|
-
if @config.return_binary_data == true
|
233
|
-
# return byte stream
|
234
|
-
encoding = body.encoding
|
235
|
-
return @stream.join.force_encoding(encoding)
|
236
|
-
else
|
237
|
-
# return file instead of binary data
|
238
|
-
content_disposition = response.headers['Content-Disposition']
|
239
|
-
if content_disposition && content_disposition =~ /filename=/i
|
240
|
-
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
241
|
-
prefix = sanitize_filename(filename)
|
242
|
-
else
|
243
|
-
prefix = 'download-'
|
244
|
-
end
|
245
|
-
prefix = prefix + '-' unless prefix.end_with?('-')
|
246
|
-
encoding = body.encoding
|
247
|
-
@tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
248
|
-
@tempfile.write(@stream.join.force_encoding(encoding))
|
249
|
-
@tempfile.close
|
250
|
-
@config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\
|
251
|
-
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
252
|
-
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
253
|
-
"explicitly with `tempfile.delete`"
|
254
|
-
return @tempfile
|
255
|
-
end
|
256
|
-
end
|
257
|
-
|
258
261
|
return nil if body.nil? || body.empty?
|
259
262
|
|
260
263
|
# return response body directly for String return type
|
261
|
-
return body if return_type == 'String'
|
264
|
+
return body.to_s if return_type == 'String'
|
262
265
|
|
263
266
|
# ensuring a default content type
|
264
267
|
content_type = response.headers['Content-Type'] || 'application/json'
|
@@ -325,7 +328,7 @@ module Bandwidth
|
|
325
328
|
# @param [String] filename the filename to be sanitized
|
326
329
|
# @return [String] the sanitized filename
|
327
330
|
def sanitize_filename(filename)
|
328
|
-
filename.
|
331
|
+
filename.split(/[\/\\]/).last
|
329
332
|
end
|
330
333
|
|
331
334
|
def build_request_url(path, opts = {})
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -79,6 +79,14 @@ module Bandwidth
|
|
79
79
|
# @return [true, false]
|
80
80
|
attr_accessor :debugging
|
81
81
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
82
90
|
# Defines the logger used for debugging.
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
84
92
|
#
|
@@ -170,6 +178,7 @@ module Bandwidth
|
|
170
178
|
@return_binary_data = false
|
171
179
|
@params_encoder = nil
|
172
180
|
@debugging = false
|
181
|
+
@ignore_operation_servers = false
|
173
182
|
@inject_format = false
|
174
183
|
@force_ending_format = false
|
175
184
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -204,6 +213,7 @@ module Bandwidth
|
|
204
213
|
|
205
214
|
# Returns base URL for specified operation based on server settings
|
206
215
|
def base_url(operation = nil)
|
216
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
207
217
|
if operation_server_settings.key?(operation) then
|
208
218
|
index = server_operation_index.fetch(operation, server_index)
|
209
219
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -170,7 +170,7 @@ module Bandwidth
|
|
170
170
|
else # model
|
171
171
|
# models (e.g. Pet) or oneOf
|
172
172
|
klass = Bandwidth.const_get(type)
|
173
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
173
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -315,7 +315,7 @@ module Bandwidth
|
|
315
315
|
else # model
|
316
316
|
# models (e.g. Pet) or oneOf
|
317
317
|
klass = Bandwidth.const_get(type)
|
318
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
318
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
319
319
|
end
|
320
320
|
end
|
321
321
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -337,7 +337,7 @@ module Bandwidth
|
|
337
337
|
else # model
|
338
338
|
# models (e.g. Pet) or oneOf
|
339
339
|
klass = Bandwidth.const_get(type)
|
340
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
340
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
341
341
|
end
|
342
342
|
end
|
343
343
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -305,7 +305,7 @@ module Bandwidth
|
|
305
305
|
else # model
|
306
306
|
# models (e.g. Pet) or oneOf
|
307
307
|
klass = Bandwidth.const_get(type)
|
308
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
308
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
@@ -36,12 +36,6 @@ module Bandwidth
|
|
36
36
|
@nested_verbs.push(*nested_verbs)
|
37
37
|
end
|
38
38
|
|
39
|
-
extend Gem::Deprecate
|
40
|
-
def add_verb(nested_verbs)
|
41
|
-
add_verbs(nested_verbs)
|
42
|
-
end
|
43
|
-
deprecate(:add_verb, 'add_verbs', 2024, 7)
|
44
|
-
|
45
39
|
# Return BXML representaion of this response
|
46
40
|
# @return [String] The XML response in string format.
|
47
41
|
def to_bxml
|
@@ -37,12 +37,6 @@ module Bandwidth
|
|
37
37
|
def add_audio_verbs(audio_verbs)
|
38
38
|
@nested_verbs.push(*audio_verbs)
|
39
39
|
end
|
40
|
-
|
41
|
-
extend Gem::Deprecate
|
42
|
-
def add_audio_verb(audio_verbs)
|
43
|
-
add_audio_verbs(audio_verbs)
|
44
|
-
end
|
45
|
-
deprecate(:add_audio_verb, 'add_audio_verbs', 2024, 7)
|
46
40
|
end
|
47
41
|
end
|
48
42
|
end
|
@@ -23,12 +23,6 @@ module Bandwidth
|
|
23
23
|
def add_stream_params(stream_params)
|
24
24
|
@nested_verbs.push(*stream_params)
|
25
25
|
end
|
26
|
-
|
27
|
-
extend Gem::Deprecate
|
28
|
-
def add_stream_param(stream_params)
|
29
|
-
add_stream_params(stream_params)
|
30
|
-
end
|
31
|
-
deprecate(:add_stream_param, 'add_stream_params', 2024, 7)
|
32
26
|
end
|
33
27
|
end
|
34
28
|
end
|
@@ -24,12 +24,6 @@ module Bandwidth
|
|
24
24
|
def add_custom_params(custom_params)
|
25
25
|
@nested_verbs.push(*custom_params)
|
26
26
|
end
|
27
|
-
|
28
|
-
extend Gem::Deprecate
|
29
|
-
def add_custom_param(custom_params)
|
30
|
-
add_custom_params(custom_params)
|
31
|
-
end
|
32
|
-
deprecate(:add_custom_param, 'add_custom_params', 2024, 7)
|
33
27
|
end
|
34
28
|
end
|
35
29
|
end
|
@@ -30,12 +30,6 @@ module Bandwidth
|
|
30
30
|
def add_transfer_recipients(recipients)
|
31
31
|
@nested_verbs.push(*recipients)
|
32
32
|
end
|
33
|
-
|
34
|
-
extend Gem::Deprecate
|
35
|
-
def add_transfer_recipient(recipients)
|
36
|
-
add_transfer_recipients(recipients)
|
37
|
-
end
|
38
|
-
deprecate(:add_transfer_recipient, 'add_transfer_recipients', 2024, 7)
|
39
33
|
end
|
40
34
|
end
|
41
35
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -33,10 +33,10 @@ module Bandwidth
|
|
33
33
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
34
34
|
attr_accessor :to
|
35
35
|
|
36
|
-
# The provided identifier of the caller
|
36
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
37
37
|
attr_accessor :from
|
38
38
|
|
39
|
-
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
39
|
+
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
|
40
40
|
attr_accessor :transfer_caller_id
|
41
41
|
|
42
42
|
# The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
|
@@ -351,7 +351,7 @@ module Bandwidth
|
|
351
351
|
else # model
|
352
352
|
# models (e.g. Pet) or oneOf
|
353
353
|
klass = Bandwidth.const_get(type)
|
354
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
354
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: letstalk@bandwidth.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -363,7 +363,7 @@ module Bandwidth
|
|
363
363
|
else # model
|
364
364
|
# models (e.g. Pet) or oneOf
|
365
365
|
klass = Bandwidth.const_get(type)
|
366
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
366
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
367
367
|
end
|
368
368
|
end
|
369
369
|
|