From 1bae9a5ecb5db9722753c8992e840d63aaa2036e Mon Sep 17 00:00:00 2001 From: "band-swi[bot]" <143147434+band-swi[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:20:59 -0400 Subject: [PATCH] SWI-5462 Update SDK Based on Recent Spec Changes (#205) * Generate SDK with OpenAPI Generator Version 7.4.0 * update workflows * fix wf * try one test * copy them all * remove all but init * now remove the init * bring it back * move bxml * move smoke * clean up spaces * update tests * fix completedTime to be date-time * include_optional * update spec * unit tests * more unit tests * unit tessssssssts * final model unit tests * move api unit tests * SWI-4279 Fix BXML Library Anti Pattern (#206) * fix verbs * finish updating bxml library * Update bandwidth/models/bxml/nestable_verb.py Co-authored-by: AJ Rice <53190766+ajrice6713@users.noreply.github.com> --------- Co-authored-by: AJ Rice <53190766+ajrice6713@users.noreply.github.com> * SWI-5462 Add Real Time Transcriptions Tests (#207) * add privacy field to calls api test * remove unused env var * update recordings smoke tests to use new method names * add files for stats and transcriptions apis * update smoke test header blocks * add statistics smoke tests * fill in skeleton of transcriptions test * transcriptions * 403 from manteca :( * finalize transcriptions tests * update smoke test wf * only main * fix tests hopefully * SWI-5457 Prism Unit Tests (#209) * SWI-5457 Prism Unit Tests * calls, conferences, media, messages * final unit tests * run prism on unit tests * only test models until base url can be updated * bring back apis, we're waiting to update * only test models for now * SWI-5462 Update to Generator v7.6.0 (#210) * SWI-5545 Update Transcription Model (#214) * SWI-5545 Update Transcription Model * remove models path from deploy tests * generate using 7.7.0-SNAPSHOT * remove old model * update tests * fix tests * regenerate with 7.7.0 * unit test everything on PR * small test updates * bash shell --------- Co-authored-by: DX-Bandwidth Co-authored-by: ckoegel Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Co-authored-by: AJ Rice <53190766+ajrice6713@users.noreply.github.com> --- .github/workflows/deploy.yml | 12 +- .github/workflows/test-pr.yml | 63 ++ .github/workflows/test-smoke.yml | 92 ++ .github/workflows/test.yml | 92 -- .gitignore | 2 +- .openapi-generator/FILES | 22 +- .openapi-generator/VERSION | 2 +- LICENSE | 4 +- README.md | 19 +- bandwidth.yml | 389 ++++++- bandwidth/__init__.py | 10 +- bandwidth/api/__init__.py | 1 + bandwidth/api/calls_api.py | 456 +++++++- bandwidth/api/conferences_api.py | 125 +-- bandwidth/api/media_api.py | 56 +- bandwidth/api/messages_api.py | 26 +- bandwidth/api/mfa_api.py | 39 +- bandwidth/api/phone_number_lookup_api.py | 26 +- bandwidth/api/recordings_api.py | 254 ++--- bandwidth/api/statistics_api.py | 13 +- bandwidth/api/transcriptions_api.py | 974 ++++++++++++++++++ bandwidth/api_client.py | 81 +- bandwidth/configuration.py | 18 +- bandwidth/models/__init__.py | 9 +- bandwidth/models/answer_callback.py | 2 +- bandwidth/models/bridge_complete_callback.py | 2 +- .../models/bridge_target_complete_callback.py | 2 +- bandwidth/models/bxml/__init__.py | 2 +- bandwidth/models/bxml/nestable_verb.py | 72 ++ bandwidth/models/bxml/terminal_verb.py | 34 - bandwidth/models/bxml/verb.py | 19 +- bandwidth/models/bxml/verbs/__init__.py | 7 +- bandwidth/models/bxml/verbs/bridge.py | 4 +- bandwidth/models/bxml/verbs/conference.py | 4 +- bandwidth/models/bxml/verbs/custom_param.py | 4 +- bandwidth/models/bxml/verbs/forward.py | 4 +- bandwidth/models/bxml/verbs/gather.py | 4 +- bandwidth/models/bxml/verbs/hangup.py | 4 +- bandwidth/models/bxml/verbs/pause.py | 4 +- .../models/bxml/verbs/pause_recording.py | 4 +- bandwidth/models/bxml/verbs/phone_number.py | 4 +- bandwidth/models/bxml/verbs/play_audio.py | 4 +- bandwidth/models/bxml/verbs/record.py | 4 +- bandwidth/models/bxml/verbs/redirect.py | 4 +- .../models/bxml/verbs/resume_recording.py | 4 +- bandwidth/models/bxml/verbs/ring.py | 4 +- bandwidth/models/bxml/verbs/send_dtmf.py | 4 +- bandwidth/models/bxml/verbs/sip_uri.py | 4 +- bandwidth/models/bxml/verbs/speak_sentence.py | 4 +- bandwidth/models/bxml/verbs/start_gather.py | 4 +- .../models/bxml/verbs/start_recording.py | 4 +- bandwidth/models/bxml/verbs/start_stream.py | 4 +- .../models/bxml/verbs/start_transcription.py | 4 +- bandwidth/models/bxml/verbs/stop_gather.py | 4 +- bandwidth/models/bxml/verbs/stop_recording.py | 4 +- bandwidth/models/bxml/verbs/stop_stream.py | 4 +- .../models/bxml/verbs/stop_transcription.py | 4 +- bandwidth/models/bxml/verbs/stream_param.py | 4 +- bandwidth/models/bxml/verbs/tag.py | 4 +- bandwidth/models/bxml/verbs/transfer.py | 4 +- bandwidth/models/call_recording_metadata.py | 10 +- bandwidth/models/call_transcription.py | 110 ++ ...ll_transcription_detected_language_enum.py | 39 + .../models/call_transcription_metadata.py | 103 ++ .../models/call_transcription_response.py | 115 +++ .../models/call_transcription_track_enum.py | 38 + bandwidth/models/conference.py | 4 +- .../models/conference_member_exit_callback.py | 2 +- .../models/conference_member_join_callback.py | 2 +- bandwidth/models/create_call.py | 27 +- bandwidth/models/create_call_response.py | 8 +- bandwidth/models/disconnect_callback.py | 2 +- bandwidth/models/dtmf_callback.py | 4 +- bandwidth/models/gather_callback.py | 4 +- bandwidth/models/initiate_callback.py | 2 +- .../machine_detection_complete_callback.py | 2 +- .../models/machine_detection_configuration.py | 14 +- bandwidth/models/message_request.py | 2 +- .../models/recording_available_callback.py | 8 +- .../models/recording_complete_callback.py | 4 +- ...py => recording_transcription_metadata.py} | 9 +- bandwidth/models/recording_transcriptions.py | 109 ++ bandwidth/models/redirect_callback.py | 4 +- bandwidth/models/transcribe_recording.py | 4 +- .../transcription_available_callback.py | 4 +- bandwidth/models/transfer_answer_callback.py | 4 +- .../models/transfer_complete_callback.py | 4 +- .../models/transfer_disconnect_callback.py | 4 +- bandwidth/models/update_call.py | 12 +- bandwidth/models/update_conference.py | 12 +- bandwidth/rest.py | 2 + docs/AccountStatistics.md | 2 +- docs/AnswerCallback.md | 4 +- docs/BridgeCompleteCallback.md | 4 +- docs/BridgeTargetCompleteCallback.md | 4 +- docs/CallDirectionEnum.md | 7 +- docs/CallRecordingMetadata.md | 8 +- docs/CallState.md | 2 +- docs/CallStateEnum.md | 7 +- docs/CallTranscription.md | 32 + docs/CallTranscriptionDetectedLanguageEnum.md | 15 + docs/CallTranscriptionMetadata.md | 30 + docs/CallTranscriptionResponse.md | 32 + docs/CallTranscriptionTrackEnum.md | 13 + docs/CallbackMethodEnum.md | 7 +- docs/CallsApi.md | 102 ++ docs/CodeRequest.md | 2 +- docs/Conference.md | 4 +- docs/ConferenceCompletedCallback.md | 2 +- docs/ConferenceCreatedCallback.md | 2 +- docs/ConferenceMember.md | 2 +- docs/ConferenceMemberExitCallback.md | 4 +- docs/ConferenceMemberJoinCallback.md | 4 +- docs/ConferenceRecordingAvailableCallback.md | 2 +- docs/ConferenceRecordingMetadata.md | 2 +- docs/ConferenceRedirectCallback.md | 2 +- docs/ConferenceStateEnum.md | 7 +- docs/CreateCall.md | 13 +- docs/CreateCallResponse.md | 8 +- docs/CreateLookupResponse.md | 2 +- docs/CreateMessageRequestError.md | 2 +- docs/DeferredResult.md | 2 +- docs/DisconnectCallback.md | 4 +- docs/Diversion.md | 2 +- docs/DtmfCallback.md | 6 +- docs/FieldError.md | 2 +- docs/FileFormatEnum.md | 7 +- docs/GatherCallback.md | 6 +- docs/InboundMessageCallback.md | 2 +- docs/InboundMessageCallbackMessage.md | 2 +- docs/InitiateCallback.md | 4 +- docs/ListMessageDirectionEnum.md | 7 +- docs/ListMessageItem.md | 2 +- docs/LookupRequest.md | 2 +- docs/LookupResult.md | 2 +- docs/LookupStatus.md | 2 +- docs/LookupStatusEnum.md | 11 +- docs/MachineDetectionCompleteCallback.md | 4 +- docs/MachineDetectionConfiguration.md | 10 +- docs/MachineDetectionModeEnum.md | 7 +- docs/MachineDetectionResult.md | 2 +- docs/Media.md | 2 +- docs/Message.md | 2 +- docs/MessageDeliveredCallback.md | 2 +- docs/MessageDeliveredCallbackMessage.md | 2 +- docs/MessageDirectionEnum.md | 7 +- docs/MessageFailedCallback.md | 2 +- docs/MessageFailedCallbackMessage.md | 2 +- docs/MessageRequest.md | 4 +- docs/MessageSendingCallback.md | 2 +- docs/MessageSendingCallbackMessage.md | 2 +- docs/MessageStatusEnum.md | 19 +- docs/MessageTypeEnum.md | 7 +- docs/MessagesList.md | 2 +- docs/MessagingCodeResponse.md | 2 +- docs/MessagingRequestError.md | 2 +- docs/MfaForbiddenRequestError.md | 2 +- docs/MfaRequestError.md | 2 +- docs/MfaUnauthorizedRequestError.md | 2 +- docs/PageInfo.md | 2 +- docs/PriorityEnum.md | 7 +- docs/RecordingAvailableCallback.md | 8 +- docs/RecordingCompleteCallback.md | 6 +- docs/RecordingStateEnum.md | 7 +- docs/RecordingTranscriptionMetadata.md | 33 + docs/RecordingTranscriptions.md | 29 + docs/RecordingsApi.md | 70 +- docs/RedirectCallback.md | 6 +- docs/RedirectMethodEnum.md | 7 +- docs/StirShaken.md | 2 +- docs/Tag.md | 2 +- docs/TnLookupRequestError.md | 2 +- docs/TranscribeRecording.md | 4 +- docs/Transcription.md | 2 +- docs/TranscriptionAvailableCallback.md | 6 +- docs/TranscriptionsApi.md | 279 +++++ docs/TransferAnswerCallback.md | 6 +- docs/TransferCompleteCallback.md | 6 +- docs/TransferDisconnectCallback.md | 6 +- docs/UpdateCall.md | 8 +- docs/UpdateCallRecording.md | 2 +- docs/UpdateConference.md | 8 +- docs/UpdateConferenceMember.md | 2 +- docs/VerifyCodeRequest.md | 2 +- docs/VerifyCodeResponse.md | 2 +- docs/VoiceApiError.md | 2 +- docs/VoiceCodeResponse.md | 2 +- openapitools.json | 2 +- test/{integration => smoke}/__init__.py | 0 .../bwmatchers/one_of_string.py | 0 test/{integration => smoke}/test_calls_api.py | 58 +- .../test_conferences_api.py | 2 +- test/{integration => smoke}/test_media_api.py | 10 +- .../test_messages_api.py | 10 +- test/{integration => smoke}/test_mfa_api.py | 2 +- .../test_phone_number_lookup_api.py | 0 .../test_recordings_api.py | 32 +- test/smoke/test_statistics_api.py | 41 + test/smoke/test_transcriptions_api.py | 154 +++ test/unit/{bxml => api}/__init__.py | 0 test/unit/api/test_calls_api.py | 216 ++++ test/unit/api/test_conferences_api.py | 194 ++++ test/unit/api/test_media_api.py | 90 ++ test/unit/api/test_messages_api.py | 114 ++ test/unit/api/test_mfa_api.py | 96 ++ test/unit/api/test_phone_number_lookup_api.py | 87 ++ test/unit/api/test_recordings_api.py | 236 +++++ test/unit/api/test_statistics_api.py | 52 + test/unit/api/test_transcriptions_api.py | 91 ++ test/unit/models/__init__.py | 0 test/unit/models/bxml/__init__.py | 0 .../{ => models}/bxml/test_base_classes.py | 27 +- test/unit/{ => models}/bxml/test_bridge.py | 10 +- test/unit/{ => models}/bxml/test_bxml.py | 7 +- .../unit/{ => models}/bxml/test_conference.py | 10 +- test/unit/{ => models}/bxml/test_forward.py | 10 +- test/unit/{ => models}/bxml/test_gather.py | 13 +- test/unit/{ => models}/bxml/test_hangup.py | 10 +- test/unit/{ => models}/bxml/test_pause.py | 10 +- .../{ => models}/bxml/test_pause_recording.py | 10 +- .../{ => models}/bxml/test_phone_number.py | 10 +- .../unit/{ => models}/bxml/test_play_audio.py | 9 +- test/unit/{ => models}/bxml/test_record.py | 10 +- test/unit/{ => models}/bxml/test_redirect.py | 10 +- test/unit/{ => models}/bxml/test_response.py | 3 + .../bxml/test_resume_recording.py | 10 +- test/unit/{ => models}/bxml/test_ring.py | 10 +- test/unit/{ => models}/bxml/test_send_dtmf.py | 10 +- test/unit/{ => models}/bxml/test_sip_uri.py | 10 +- .../{ => models}/bxml/test_speak_sentence.py | 11 +- .../{ => models}/bxml/test_start_gather.py | 10 +- .../{ => models}/bxml/test_start_recording.py | 9 +- .../{ => models}/bxml/test_start_stream.py | 11 +- .../bxml/test_start_transcription.py | 11 +- .../{ => models}/bxml/test_stop_gather.py | 10 +- .../{ => models}/bxml/test_stop_recording.py | 10 +- .../{ => models}/bxml/test_stop_stream.py | 10 +- .../bxml/test_stop_transcription.py | 8 +- .../{ => models}/bxml/test_stream_param.py | 10 +- test/unit/{ => models}/bxml/test_tag.py | 10 +- test/unit/{ => models}/bxml/test_transfer.py | 13 +- .../{ => models}/test_account_statistics.py | 26 +- test/unit/models/test_answer_callback.py | 83 ++ .../models/test_bridge_complete_callback.py | 81 ++ .../test_bridge_target_complete_callback.py | 75 ++ .../{ => models}/test_call_direction_enum.py | 11 +- .../models/test_call_recording_metadata.py | 94 ++ test/unit/models/test_call_state.py | 85 ++ .../unit/{ => models}/test_call_state_enum.py | 10 +- test/unit/models/test_call_transcription.py | 57 + ...ll_transcription_detected_language_enum.py | 39 + .../test_call_transcription_metadata.py | 52 + .../test_call_transcription_response.py | 59 ++ .../test_call_transcription_track_enum.py | 37 + .../{ => models}/test_callback_method_enum.py | 10 +- test/unit/{ => models}/test_code_request.py | 38 +- test/unit/models/test_conference.py | 82 ++ .../test_conference_completed_callback.py | 36 +- .../test_conference_created_callback.py | 36 +- .../{ => models}/test_conference_member.py | 38 +- .../test_conference_member_exit_callback.py | 65 ++ .../test_conference_member_join_callback.py | 65 ++ ...conference_recording_available_callback.py | 77 ++ .../test_conference_recording_metadata.py | 71 ++ .../test_conference_redirect_callback.py | 36 +- .../test_conference_state_enum.py | 10 +- test/unit/models/test_create_call.py | 123 +++ test/unit/models/test_create_call_response.py | 100 ++ .../test_create_lookup_response.py | 26 +- .../test_create_message_request_error.py | 38 +- .../unit/{ => models}/test_deferred_result.py | 26 +- test/unit/models/test_disconnect_callback.py | 83 ++ test/unit/models/test_diversion.py | 62 ++ test/unit/models/test_dtmf_callback.py | 83 ++ test/unit/{ => models}/test_field_error.py | 28 +- .../{ => models}/test_file_format_enum.py | 10 +- test/unit/models/test_gather_callback.py | 85 ++ .../test_inbound_message_callback.py | 57 +- .../test_inbound_message_callback_message.py | 57 +- test/unit/models/test_initiate_callback.py | 95 ++ .../test_list_message_direction_enum.py | 10 +- test/unit/models/test_list_message_item.py | 83 ++ test/unit/{ => models}/test_lookup_request.py | 23 +- test/unit/models/test_lookup_result.py | 66 ++ test/unit/models/test_lookup_status.py | 79 ++ .../{ => models}/test_lookup_status_enum.py | 14 +- ...est_machine_detection_complete_callback.py | 82 ++ .../test_machine_detection_configuration.py | 78 ++ .../test_machine_detection_mode_enum.py | 10 +- .../test_machine_detection_result.py | 26 +- test/unit/{ => models}/test_media.py | 29 +- test/unit/models/test_message.py | 75 ++ .../test_message_delivered_callback.py | 57 +- ...test_message_delivered_callback_message.py | 57 +- .../test_message_direction_enum.py | 10 +- .../test_message_failed_callback.py | 60 +- .../test_message_failed_callback_message.py | 57 +- .../unit/{ => models}/test_message_request.py | 45 +- .../test_message_sending_callback.py | 57 +- .../test_message_sending_callback_message.py | 57 +- test/unit/models/test_message_status_enum.py | 49 + .../{ => models}/test_message_type_enum.py | 10 +- test/unit/models/test_messages_list.py | 103 ++ .../test_messaging_code_response.py | 25 +- .../test_messaging_request_error.py | 26 +- .../test_mfa_forbidden_request_error.py | 23 +- .../{ => models}/test_mfa_request_error.py | 26 +- .../test_mfa_unauthorized_request_error.py | 23 +- test/unit/{ => models}/test_page_info.py | 32 +- test/unit/{ => models}/test_priority_enum.py | 10 +- .../test_recording_available_callback.py | 93 ++ .../test_recording_complete_callback.py | 93 ++ .../{ => models}/test_recording_state_enum.py | 10 +- .../test_recording_transcription_metadata.py | 57 + .../models/test_recording_transcriptions.py | 58 ++ test/unit/models/test_redirect_callback.py | 81 ++ .../{ => models}/test_redirect_method_enum.py | 10 +- test/unit/{ => models}/test_stir_shaken.py | 29 +- test/unit/{ => models}/test_tag.py | 26 +- .../test_tn_lookup_request_error.py | 23 +- .../{ => models}/test_transcribe_recording.py | 41 +- test/unit/{ => models}/test_transcription.py | 26 +- .../test_transcription_available_callback.py | 95 ++ .../models/test_transfer_answer_callback.py | 80 ++ .../models/test_transfer_complete_callback.py | 85 ++ .../test_transfer_disconnect_callback.py | 88 ++ test/unit/models/test_update_call.py | 68 ++ .../test_update_call_recording.py | 23 +- test/unit/models/test_update_conference.py | 66 ++ .../test_update_conference_member.py | 29 +- .../{ => models}/test_verify_code_request.py | 32 +- .../{ => models}/test_verify_code_response.py | 23 +- .../unit/{ => models}/test_voice_api_error.py | 29 +- .../{ => models}/test_voice_code_response.py | 23 +- test/unit/test_answer_callback.py | 70 -- test/unit/test_bridge_complete_callback.py | 70 -- .../test_bridge_target_complete_callback.py | 67 -- test/unit/test_call_recording_metadata.py | 76 -- test/unit/test_call_state.py | 72 -- test/unit/test_conference.py | 70 -- .../test_conference_member_exit_callback.py | 62 -- .../test_conference_member_join_callback.py | 62 -- ...conference_recording_available_callback.py | 68 -- .../test_conference_recording_metadata.py | 65 -- test/unit/test_create_call.py | 93 -- test/unit/test_create_call_response.py | 84 -- test/unit/test_disconnect_callback.py | 71 -- test/unit/test_diversion.py | 61 -- test/unit/test_dtmf_callback.py | 71 -- test/unit/test_gather_callback.py | 72 -- test/unit/test_initiate_callback.py | 76 -- test/unit/test_list_message_item.py | 71 -- test/unit/test_lookup_result.py | 63 -- test/unit/test_lookup_status.py | 69 -- ...est_machine_detection_complete_callback.py | 70 -- .../test_machine_detection_configuration.py | 69 -- test/unit/test_message.py | 67 -- test/unit/test_message_status_enum.py | 37 - test/unit/test_messages_list.py | 80 -- .../unit/test_recording_available_callback.py | 76 -- test/unit/test_recording_complete_callback.py | 76 -- test/unit/test_redirect_callback.py | 70 -- test/unit/test_statistics_api.py | 41 - .../test_transcription_available_callback.py | 77 -- test/unit/test_transcription_list.py | 59 -- test/unit/test_transcription_metadata.py | 58 -- test/unit/test_transfer_answer_callback.py | 69 -- test/unit/test_transfer_complete_callback.py | 72 -- .../unit/test_transfer_disconnect_callback.py | 74 -- test/unit/test_update_call.py | 64 -- test/unit/test_update_conference.py | 63 -- test/utils/call_cleanup.py | 16 +- test/utils/env_variables.py | 5 +- 373 files changed, 9360 insertions(+), 4332 deletions(-) create mode 100644 .github/workflows/test-pr.yml create mode 100644 .github/workflows/test-smoke.yml delete mode 100644 .github/workflows/test.yml create mode 100644 bandwidth/api/transcriptions_api.py create mode 100644 bandwidth/models/bxml/nestable_verb.py delete mode 100644 bandwidth/models/bxml/terminal_verb.py create mode 100644 bandwidth/models/call_transcription.py create mode 100644 bandwidth/models/call_transcription_detected_language_enum.py create mode 100644 bandwidth/models/call_transcription_metadata.py create mode 100644 bandwidth/models/call_transcription_response.py create mode 100644 bandwidth/models/call_transcription_track_enum.py rename bandwidth/models/{transcription_metadata.py => recording_transcription_metadata.py} (90%) create mode 100644 bandwidth/models/recording_transcriptions.py create mode 100644 docs/CallTranscription.md create mode 100644 docs/CallTranscriptionDetectedLanguageEnum.md create mode 100644 docs/CallTranscriptionMetadata.md create mode 100644 docs/CallTranscriptionResponse.md create mode 100644 docs/CallTranscriptionTrackEnum.md create mode 100644 docs/RecordingTranscriptionMetadata.md create mode 100644 docs/RecordingTranscriptions.md create mode 100644 docs/TranscriptionsApi.md rename test/{integration => smoke}/__init__.py (100%) rename test/{integration => smoke}/bwmatchers/one_of_string.py (100%) rename test/{integration => smoke}/test_calls_api.py (95%) rename test/{integration => smoke}/test_conferences_api.py (99%) rename test/{integration => smoke}/test_media_api.py (97%) rename test/{integration => smoke}/test_messages_api.py (96%) rename test/{integration => smoke}/test_mfa_api.py (99%) rename test/{integration => smoke}/test_phone_number_lookup_api.py (100%) rename test/{integration => smoke}/test_recordings_api.py (96%) create mode 100644 test/smoke/test_statistics_api.py create mode 100644 test/smoke/test_transcriptions_api.py rename test/unit/{bxml => api}/__init__.py (100%) create mode 100644 test/unit/api/test_calls_api.py create mode 100644 test/unit/api/test_conferences_api.py create mode 100644 test/unit/api/test_media_api.py create mode 100644 test/unit/api/test_messages_api.py create mode 100644 test/unit/api/test_mfa_api.py create mode 100644 test/unit/api/test_phone_number_lookup_api.py create mode 100644 test/unit/api/test_recordings_api.py create mode 100644 test/unit/api/test_statistics_api.py create mode 100644 test/unit/api/test_transcriptions_api.py create mode 100644 test/unit/models/__init__.py create mode 100644 test/unit/models/bxml/__init__.py rename test/unit/{ => models}/bxml/test_base_classes.py (56%) rename test/unit/{ => models}/bxml/test_bridge.py (67%) rename test/unit/{ => models}/bxml/test_bxml.py (69%) rename test/unit/{ => models}/bxml/test_conference.py (83%) rename test/unit/{ => models}/bxml/test_forward.py (76%) rename test/unit/{ => models}/bxml/test_gather.py (85%) rename test/unit/{ => models}/bxml/test_hangup.py (54%) rename test/unit/{ => models}/bxml/test_pause.py (56%) rename test/unit/{ => models}/bxml/test_pause_recording.py (54%) rename test/unit/{ => models}/bxml/test_phone_number.py (70%) rename test/unit/{ => models}/bxml/test_play_audio.py (66%) rename test/unit/{ => models}/bxml/test_record.py (59%) rename test/unit/{ => models}/bxml/test_redirect.py (60%) rename test/unit/{ => models}/bxml/test_response.py (85%) rename test/unit/{ => models}/bxml/test_resume_recording.py (54%) rename test/unit/{ => models}/bxml/test_ring.py (61%) rename test/unit/{ => models}/bxml/test_send_dtmf.py (62%) rename test/unit/{ => models}/bxml/test_sip_uri.py (75%) rename test/unit/{ => models}/bxml/test_speak_sentence.py (77%) rename test/unit/{ => models}/bxml/test_start_gather.py (69%) rename test/unit/{ => models}/bxml/test_start_recording.py (79%) rename test/unit/{ => models}/bxml/test_start_stream.py (78%) rename test/unit/{ => models}/bxml/test_start_transcription.py (81%) rename test/unit/{ => models}/bxml/test_stop_gather.py (54%) rename test/unit/{ => models}/bxml/test_stop_recording.py (63%) rename test/unit/{ => models}/bxml/test_stop_stream.py (56%) rename test/unit/{ => models}/bxml/test_stop_transcription.py (59%) rename test/unit/{ => models}/bxml/test_stream_param.py (60%) rename test/unit/{ => models}/bxml/test_tag.py (56%) rename test/unit/{ => models}/bxml/test_transfer.py (75%) rename test/unit/{ => models}/test_account_statistics.py (60%) create mode 100644 test/unit/models/test_answer_callback.py create mode 100644 test/unit/models/test_bridge_complete_callback.py create mode 100644 test/unit/models/test_bridge_target_complete_callback.py rename test/unit/{ => models}/test_call_direction_enum.py (78%) create mode 100644 test/unit/models/test_call_recording_metadata.py create mode 100644 test/unit/models/test_call_state.py rename test/unit/{ => models}/test_call_state_enum.py (72%) create mode 100644 test/unit/models/test_call_transcription.py create mode 100644 test/unit/models/test_call_transcription_detected_language_enum.py create mode 100644 test/unit/models/test_call_transcription_metadata.py create mode 100644 test/unit/models/test_call_transcription_response.py create mode 100644 test/unit/models/test_call_transcription_track_enum.py rename test/unit/{ => models}/test_callback_method_enum.py (81%) rename test/unit/{ => models}/test_code_request.py (59%) create mode 100644 test/unit/models/test_conference.py rename test/unit/{ => models}/test_conference_completed_callback.py (55%) rename test/unit/{ => models}/test_conference_created_callback.py (55%) rename test/unit/{ => models}/test_conference_member.py (54%) create mode 100644 test/unit/models/test_conference_member_exit_callback.py create mode 100644 test/unit/models/test_conference_member_join_callback.py create mode 100644 test/unit/models/test_conference_recording_available_callback.py create mode 100644 test/unit/models/test_conference_recording_metadata.py rename test/unit/{ => models}/test_conference_redirect_callback.py (55%) rename test/unit/{ => models}/test_conference_state_enum.py (78%) create mode 100644 test/unit/models/test_create_call.py create mode 100644 test/unit/models/test_create_call_response.py rename test/unit/{ => models}/test_create_lookup_response.py (60%) rename test/unit/{ => models}/test_create_message_request_error.py (51%) rename test/unit/{ => models}/test_deferred_result.py (56%) create mode 100644 test/unit/models/test_disconnect_callback.py create mode 100644 test/unit/models/test_diversion.py create mode 100644 test/unit/models/test_dtmf_callback.py rename test/unit/{ => models}/test_field_error.py (51%) rename test/unit/{ => models}/test_file_format_enum.py (75%) create mode 100644 test/unit/models/test_gather_callback.py rename test/unit/{ => models}/test_inbound_message_callback.py (54%) rename test/unit/{ => models}/test_inbound_message_callback_message.py (52%) create mode 100644 test/unit/models/test_initiate_callback.py rename test/unit/{ => models}/test_list_message_direction_enum.py (77%) create mode 100644 test/unit/models/test_list_message_item.py rename test/unit/{ => models}/test_lookup_request.py (60%) create mode 100644 test/unit/models/test_lookup_result.py create mode 100644 test/unit/models/test_lookup_status.py rename test/unit/{ => models}/test_lookup_status_enum.py (62%) create mode 100644 test/unit/models/test_machine_detection_complete_callback.py create mode 100644 test/unit/models/test_machine_detection_configuration.py rename test/unit/{ => models}/test_machine_detection_mode_enum.py (79%) rename test/unit/{ => models}/test_machine_detection_result.py (59%) rename test/unit/{ => models}/test_media.py (54%) create mode 100644 test/unit/models/test_message.py rename test/unit/{ => models}/test_message_delivered_callback.py (54%) rename test/unit/{ => models}/test_message_delivered_callback_message.py (52%) rename test/unit/{ => models}/test_message_direction_enum.py (81%) rename test/unit/{ => models}/test_message_failed_callback.py (55%) rename test/unit/{ => models}/test_message_failed_callback_message.py (53%) rename test/unit/{ => models}/test_message_request.py (51%) rename test/unit/{ => models}/test_message_sending_callback.py (54%) rename test/unit/{ => models}/test_message_sending_callback_message.py (54%) create mode 100644 test/unit/models/test_message_status_enum.py rename test/unit/{ => models}/test_message_type_enum.py (74%) create mode 100644 test/unit/models/test_messages_list.py rename test/unit/{ => models}/test_messaging_code_response.py (58%) rename test/unit/{ => models}/test_messaging_request_error.py (61%) rename test/unit/{ => models}/test_mfa_forbidden_request_error.py (61%) rename test/unit/{ => models}/test_mfa_request_error.py (55%) rename test/unit/{ => models}/test_mfa_unauthorized_request_error.py (61%) rename test/unit/{ => models}/test_page_info.py (56%) rename test/unit/{ => models}/test_priority_enum.py (73%) create mode 100644 test/unit/models/test_recording_available_callback.py create mode 100644 test/unit/models/test_recording_complete_callback.py rename test/unit/{ => models}/test_recording_state_enum.py (78%) create mode 100644 test/unit/models/test_recording_transcription_metadata.py create mode 100644 test/unit/models/test_recording_transcriptions.py create mode 100644 test/unit/models/test_redirect_callback.py rename test/unit/{ => models}/test_redirect_method_enum.py (81%) rename test/unit/{ => models}/test_stir_shaken.py (54%) rename test/unit/{ => models}/test_tag.py (56%) rename test/unit/{ => models}/test_tn_lookup_request_error.py (61%) rename test/unit/{ => models}/test_transcribe_recording.py (50%) rename test/unit/{ => models}/test_transcription.py (55%) create mode 100644 test/unit/models/test_transcription_available_callback.py create mode 100644 test/unit/models/test_transfer_answer_callback.py create mode 100644 test/unit/models/test_transfer_complete_callback.py create mode 100644 test/unit/models/test_transfer_disconnect_callback.py create mode 100644 test/unit/models/test_update_call.py rename test/unit/{ => models}/test_update_call_recording.py (62%) create mode 100644 test/unit/models/test_update_conference.py rename test/unit/{ => models}/test_update_conference_member.py (60%) rename test/unit/{ => models}/test_verify_code_request.py (60%) rename test/unit/{ => models}/test_verify_code_response.py (61%) rename test/unit/{ => models}/test_voice_api_error.py (54%) rename test/unit/{ => models}/test_voice_code_response.py (62%) delete mode 100644 test/unit/test_answer_callback.py delete mode 100644 test/unit/test_bridge_complete_callback.py delete mode 100644 test/unit/test_bridge_target_complete_callback.py delete mode 100644 test/unit/test_call_recording_metadata.py delete mode 100644 test/unit/test_call_state.py delete mode 100644 test/unit/test_conference.py delete mode 100644 test/unit/test_conference_member_exit_callback.py delete mode 100644 test/unit/test_conference_member_join_callback.py delete mode 100644 test/unit/test_conference_recording_available_callback.py delete mode 100644 test/unit/test_conference_recording_metadata.py delete mode 100644 test/unit/test_create_call.py delete mode 100644 test/unit/test_create_call_response.py delete mode 100644 test/unit/test_disconnect_callback.py delete mode 100644 test/unit/test_diversion.py delete mode 100644 test/unit/test_dtmf_callback.py delete mode 100644 test/unit/test_gather_callback.py delete mode 100644 test/unit/test_initiate_callback.py delete mode 100644 test/unit/test_list_message_item.py delete mode 100644 test/unit/test_lookup_result.py delete mode 100644 test/unit/test_lookup_status.py delete mode 100644 test/unit/test_machine_detection_complete_callback.py delete mode 100644 test/unit/test_machine_detection_configuration.py delete mode 100644 test/unit/test_message.py delete mode 100644 test/unit/test_message_status_enum.py delete mode 100644 test/unit/test_messages_list.py delete mode 100644 test/unit/test_recording_available_callback.py delete mode 100644 test/unit/test_recording_complete_callback.py delete mode 100644 test/unit/test_redirect_callback.py delete mode 100644 test/unit/test_statistics_api.py delete mode 100644 test/unit/test_transcription_available_callback.py delete mode 100644 test/unit/test_transcription_list.py delete mode 100644 test/unit/test_transcription_metadata.py delete mode 100644 test/unit/test_transfer_answer_callback.py delete mode 100644 test/unit/test_transfer_complete_callback.py delete mode 100644 test/unit/test_transfer_disconnect_callback.py delete mode 100644 test/unit/test_update_call.py delete mode 100644 test/unit/test_update_conference.py diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c9a06069..3cf5c822 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,7 +30,6 @@ jobs: MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} - BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} steps: - name: Set Release Version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV @@ -57,7 +56,9 @@ jobs: - name: Test run: | - pytest -v + npm install -g @stoplight/prism-cli + prism mock ./bandwidth.yml & pytest -v ./test/unit + - name: Deploy to PYPI run: | @@ -68,7 +69,7 @@ jobs: env: PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - + - uses: Bandwidth/build-notify-slack-action@v2.0.0 if: always() with: @@ -100,7 +101,6 @@ jobs: MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} - BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} steps: - name: Set Release Version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV @@ -125,7 +125,9 @@ jobs: - name: Test run: |- - pytest -v + npm install -g @stoplight/prism-cli + prism mock ./bandwidth.yml & pytest -v ./test/unit + shell: bash - name: Deploy to PYPI run: | diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml new file mode 100644 index 00000000..a9bba712 --- /dev/null +++ b/.github/workflows/test-pr.yml @@ -0,0 +1,63 @@ +name: Test PR + +on: + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +env: + BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} + BW_USERNAME: ${{ secrets.BW_USERNAME }} + BW_PASSWORD: ${{ secrets.BW_PASSWORD }} + BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} + BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} + BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} + BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} + BW_NUMBER: ${{ secrets.BW_NUMBER }} + USER_NUMBER: ${{ secrets.USER_NUMBER }} + VZW_NUMBER: ${{ secrets.VZW_NUMBER }} + ATT_NUMBER: ${{ secrets.ATT_NUMBER }} + T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }} + BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} + MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} + MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} + MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} + MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} + +jobs: + test: + name: Test PR + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] + fail-fast: false + env: + PYTHON_VERSION: ${{ matrix.python-version }} + OPERATING_SYSTEM: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Packages + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: Test at Warning Level + run: | + echo "Log level: WARNING" + npm install -g @stoplight/prism-cli + prism mock ./bandwidth.yml & pytest -v --log-cli-level=WARNING ./test/unit + shell: bash diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml new file mode 100644 index 00000000..918f3226 --- /dev/null +++ b/.github/workflows/test-smoke.yml @@ -0,0 +1,92 @@ +name: Smoke Tests + +on: + schedule: + - cron: "0 4 * * *" + workflow_dispatch: + inputs: + logLevel: + description: Log level + required: false + default: WARNING + type: choice + options: + - WARNING + - DEBUG + pull_request: + branches: + - main + paths: + - 'test/smoke/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +env: + BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} + BW_USERNAME: ${{ secrets.BW_USERNAME }} + BW_PASSWORD: ${{ secrets.BW_PASSWORD }} + BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} + BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} + BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} + BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} + BW_NUMBER: ${{ secrets.BW_NUMBER }} + USER_NUMBER: ${{ secrets.USER_NUMBER }} + VZW_NUMBER: ${{ secrets.VZW_NUMBER }} + ATT_NUMBER: ${{ secrets.ATT_NUMBER }} + T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }} + BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} + MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} + MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} + MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} + MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} + +jobs: + test: + name: Smoke Test + runs-on: ubuntu-latest + env: + PYTHON_VERSION: '3.12' + OPERATING_SYSTEM: ubuntu + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Packages + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: Test at Debug Level + if: ${{ inputs.logLevel == 'DEBUG' }} + run: | + echo "Log level: DEBUG" + pytest -v --log-cli-level=DEBUG + shell: bash + + - name: Test at Warning Level + if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }} + run: | + echo "Log level: WARNING" + pytest -v --log-cli-level=WARNING ./test/smoke + shell: bash + + notify_for_failures: + name: Notify for Failures + needs: [test] + if: failure() + runs-on: ubuntu-latest + steps: + - name: Notify Slack of Failures + uses: Bandwidth/build-notify-slack-action@v2.0.0 + with: + job-status: failure + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 0a2947c5..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Test - -on: - schedule: - - cron: "0 4 * * *" - pull_request: - workflow_dispatch: - inputs: - logLevel: - description: Log level - required: false - default: WARNING - type: choice - options: - - WARNING - - DEBUG - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -env: - BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} - BW_USERNAME: ${{ secrets.BW_USERNAME }} - BW_PASSWORD: ${{ secrets.BW_PASSWORD }} - BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} - BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} - BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} - BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} - BW_NUMBER: ${{ secrets.BW_NUMBER }} - USER_NUMBER: ${{ secrets.USER_NUMBER }} - VZW_NUMBER: ${{ secrets.VZW_NUMBER }} - ATT_NUMBER: ${{ secrets.ATT_NUMBER }} - T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }} - BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} - MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} - MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} - MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} - MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} - BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} - -jobs: - test: - name: Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest] - python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] - fail-fast: false - env: - PYTHON_VERSION: ${{ matrix.python-version }} - OPERATING_SYSTEM: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Packages - run: | - pip install -r requirements.txt - pip install -r test-requirements.txt - - - name: Test at Debug Level - if: ${{ inputs.logLevel == 'DEBUG' }} - run: | - echo "Log level: DEBUG" - pytest -v --log-cli-level=DEBUG - - - name: Test at Warning Level - if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }} - run: | - echo "Log level: WARNING" - pytest -v --log-cli-level=WARNING - - notify_for_failures: - name: Notify for Failures - needs: [test] - if: failure() - runs-on: ubuntu-latest - steps: - - name: Notify Slack of Failures - uses: Bandwidth/build-notify-slack-action@v2.0.0 - with: - job-status: failure - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} - slack-channel: ${{ secrets.SLACK_CHANNEL }} diff --git a/.gitignore b/.gitignore index d5dfbee6..e7aa7b90 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ __pycache__/ # C extensions *.so -# MacOS Files +# MacOS Files .DS_Store # Distribution / packaging diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0458bb44..a641d920 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -11,6 +11,7 @@ bandwidth/api/mfa_api.py bandwidth/api/phone_number_lookup_api.py bandwidth/api/recordings_api.py bandwidth/api/statistics_api.py +bandwidth/api/transcriptions_api.py bandwidth/api_client.py bandwidth/api_response.py bandwidth/configuration.py @@ -24,6 +25,11 @@ bandwidth/models/call_direction_enum.py bandwidth/models/call_recording_metadata.py bandwidth/models/call_state.py bandwidth/models/call_state_enum.py +bandwidth/models/call_transcription.py +bandwidth/models/call_transcription_detected_language_enum.py +bandwidth/models/call_transcription_metadata.py +bandwidth/models/call_transcription_response.py +bandwidth/models/call_transcription_track_enum.py bandwidth/models/callback_method_enum.py bandwidth/models/code_request.py bandwidth/models/conference.py @@ -83,6 +89,8 @@ bandwidth/models/priority_enum.py bandwidth/models/recording_available_callback.py bandwidth/models/recording_complete_callback.py bandwidth/models/recording_state_enum.py +bandwidth/models/recording_transcription_metadata.py +bandwidth/models/recording_transcriptions.py bandwidth/models/redirect_callback.py bandwidth/models/redirect_method_enum.py bandwidth/models/stir_shaken.py @@ -91,8 +99,6 @@ bandwidth/models/tn_lookup_request_error.py bandwidth/models/transcribe_recording.py bandwidth/models/transcription.py bandwidth/models/transcription_available_callback.py -bandwidth/models/transcription_list.py -bandwidth/models/transcription_metadata.py bandwidth/models/transfer_answer_callback.py bandwidth/models/transfer_complete_callback.py bandwidth/models/transfer_disconnect_callback.py @@ -114,6 +120,11 @@ docs/CallDirectionEnum.md docs/CallRecordingMetadata.md docs/CallState.md docs/CallStateEnum.md +docs/CallTranscription.md +docs/CallTranscriptionDetectedLanguageEnum.md +docs/CallTranscriptionMetadata.md +docs/CallTranscriptionResponse.md +docs/CallTranscriptionTrackEnum.md docs/CallbackMethodEnum.md docs/CallsApi.md docs/CodeRequest.md @@ -179,6 +190,8 @@ docs/PriorityEnum.md docs/RecordingAvailableCallback.md docs/RecordingCompleteCallback.md docs/RecordingStateEnum.md +docs/RecordingTranscriptionMetadata.md +docs/RecordingTranscriptions.md docs/RecordingsApi.md docs/RedirectCallback.md docs/RedirectMethodEnum.md @@ -189,8 +202,7 @@ docs/TnLookupRequestError.md docs/TranscribeRecording.md docs/Transcription.md docs/TranscriptionAvailableCallback.md -docs/TranscriptionList.md -docs/TranscriptionMetadata.md +docs/TranscriptionsApi.md docs/TransferAnswerCallback.md docs/TransferCompleteCallback.md docs/TransferDisconnectCallback.md @@ -204,7 +216,5 @@ docs/VoiceApiError.md docs/VoiceCodeResponse.md git_push.sh pyproject.toml -requirements.txt setup.py -test-requirements.txt tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index ba7f754d..1985849f 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0 +7.7.0 diff --git a/LICENSE b/LICENSE index 749af7fb..4b70ae03 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -License: +License: ======== The MIT License (MIT) http://opensource.org/licenses/MIT @@ -25,4 +25,4 @@ THE SOFTWARE. Trade Mark: ========== -APIMATIC is a trade mark for APIMATIC Limited \ No newline at end of file +APIMATIC is a trade mark for APIMATIC Limited diff --git a/README.md b/README.md index d9491075..1de2f714 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 15.0.0 -- Generator version: 7.4.0 +- Generator version: 7.7.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com) @@ -99,6 +99,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *CallsApi* | [**create_call**](docs/CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call *CallsApi* | [**get_call_state**](docs/CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information +*CallsApi* | [**list_calls**](docs/CallsApi.md#list_calls) | **GET** /accounts/{accountId}/calls | Get Calls *CallsApi* | [**update_call**](docs/CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call *CallsApi* | [**update_call_bxml**](docs/CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML *ConferencesApi* | [**download_conference_recording**](docs/ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording @@ -121,17 +122,20 @@ Class | Method | HTTP request | Description *MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages *PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup *PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status -*RecordingsApi* | [**delete_call_transcription**](docs/RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription *RecordingsApi* | [**delete_recording**](docs/RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording *RecordingsApi* | [**delete_recording_media**](docs/RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media +*RecordingsApi* | [**delete_recording_transcription**](docs/RecordingsApi.md#delete_recording_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription *RecordingsApi* | [**download_call_recording**](docs/RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording *RecordingsApi* | [**get_call_recording**](docs/RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording -*RecordingsApi* | [**get_call_transcription**](docs/RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription +*RecordingsApi* | [**get_recording_transcription**](docs/RecordingsApi.md#get_recording_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription *RecordingsApi* | [**list_account_call_recordings**](docs/RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings *RecordingsApi* | [**list_call_recordings**](docs/RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings *RecordingsApi* | [**transcribe_call_recording**](docs/RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request *RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording *StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics +*TranscriptionsApi* | [**delete_real_time_transcription**](docs/TranscriptionsApi.md#delete_real_time_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Delete a specific transcription +*TranscriptionsApi* | [**get_real_time_transcription**](docs/TranscriptionsApi.md#get_real_time_transcription) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Retrieve a specific transcription +*TranscriptionsApi* | [**list_real_time_transcriptions**](docs/TranscriptionsApi.md#list_real_time_transcriptions) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions | Enumerate transcriptions made with StartTranscription ## Documentation For Models @@ -144,6 +148,11 @@ Class | Method | HTTP request | Description - [CallRecordingMetadata](docs/CallRecordingMetadata.md) - [CallState](docs/CallState.md) - [CallStateEnum](docs/CallStateEnum.md) + - [CallTranscription](docs/CallTranscription.md) + - [CallTranscriptionDetectedLanguageEnum](docs/CallTranscriptionDetectedLanguageEnum.md) + - [CallTranscriptionMetadata](docs/CallTranscriptionMetadata.md) + - [CallTranscriptionResponse](docs/CallTranscriptionResponse.md) + - [CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md) - [CallbackMethodEnum](docs/CallbackMethodEnum.md) - [CodeRequest](docs/CodeRequest.md) - [Conference](docs/Conference.md) @@ -203,6 +212,8 @@ Class | Method | HTTP request | Description - [RecordingAvailableCallback](docs/RecordingAvailableCallback.md) - [RecordingCompleteCallback](docs/RecordingCompleteCallback.md) - [RecordingStateEnum](docs/RecordingStateEnum.md) + - [RecordingTranscriptionMetadata](docs/RecordingTranscriptionMetadata.md) + - [RecordingTranscriptions](docs/RecordingTranscriptions.md) - [RedirectCallback](docs/RedirectCallback.md) - [RedirectMethodEnum](docs/RedirectMethodEnum.md) - [StirShaken](docs/StirShaken.md) @@ -211,8 +222,6 @@ Class | Method | HTTP request | Description - [TranscribeRecording](docs/TranscribeRecording.md) - [Transcription](docs/Transcription.md) - [TranscriptionAvailableCallback](docs/TranscriptionAvailableCallback.md) - - [TranscriptionList](docs/TranscriptionList.md) - - [TranscriptionMetadata](docs/TranscriptionMetadata.md) - [TransferAnswerCallback](docs/TransferAnswerCallback.md) - [TransferCompleteCallback](docs/TransferCompleteCallback.md) - [TransferDisconnectCallback](docs/TransferDisconnectCallback.md) diff --git a/bandwidth.yml b/bandwidth.yml index 1cbcd06f..f3e5be8e 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -16,6 +16,7 @@ tags: - name: Conferences - name: Recordings - name: Statistics + - name: Transcriptions - name: MFA - name: Phone Number Lookup paths: @@ -275,6 +276,52 @@ paths: $ref: '#/components/responses/voiceTooManyRequestsError' '500': $ref: '#/components/responses/voiceInternalServerError' + get: + tags: + - Calls + summary: Get Calls + description: >- + Returns a max of 10000 calls, sorted by `createdTime` from oldest to + newest. + + + **NOTE:** If the number of calls in the account is bigger than + `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be + returned in the response. The url can be used to retrieve the next page + of call records. + + Also, call information is kept for 7 days after the calls are hung up. + If you attempt to retrieve information for a call that is older than 7 + days, you will get an empty array [] in response. + operationId: listCalls + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTimeCalls' + - $ref: '#/components/parameters/maxStartTimeCalls' + - $ref: '#/components/parameters/disconnectCause' + - $ref: '#/components/parameters/pageSizeCalls' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listCallsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' servers: &ref_1 - url: https://voice.bandwidth.com/api/v2 description: Production @@ -916,9 +963,7 @@ paths: description: >- Downloads the specified transcription. - - If the transcribed recording was multi-channel, then there will be 2 - transcripts. + If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and @@ -928,14 +973,14 @@ paths: During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. - operationId: getCallTranscription + operationId: getRecordingTranscription parameters: - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '200': - $ref: '#/components/responses/getCallTranscriptionResponse' + $ref: '#/components/responses/getRecordingTranscriptionResponse' '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -1001,7 +1046,7 @@ paths: 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. - operationId: deleteCallTranscription + operationId: deleteRecordingTranscription parameters: - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' @@ -1055,6 +1100,108 @@ paths: '500': $ref: '#/components/responses/voiceInternalServerError' servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions: + get: + tags: + - Transcriptions + summary: Enumerate transcriptions made with StartTranscription + description: >- + Enumerates the transcriptions created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: listRealTimeTranscriptions + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listTranscriptionsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: + get: + tags: + - Transcriptions + summary: Retrieve a specific transcription + description: >- + Retrieve the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: getRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/getCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Transcriptions + summary: Delete a specific transcription + description: >- + 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. + operationId: deleteRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/deleteCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 /accounts/{accountId}/code/voice: post: tags: @@ -1501,8 +1648,14 @@ components: from: type: string description: >- - One of your telephone numbers the message should come from in E164 - format. + Either an alphanumeric sender ID or the sender's Bandwidth phone + number in E.164 format, which must be hosted within Bandwidth and + linked to the account that is generating the message. + + Alphanumeric Sender IDs can contain up to 11 characters, upper-case + letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, + plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must + contain at least one letter. example: '+15551113333' text: type: string @@ -1978,6 +2131,21 @@ components: and will include its result. example: async + callTranscriptionDetectedLanguageEnum: + type: string + enum: + - en-US + - es-US + - fr-FR + description: The detected language for this transcription. + example: en-US + callTranscriptionTrackEnum: + type: string + enum: + - inbound + - outbound + description: Which `track` this transcription is derived from. + example: inbound createCall: type: object required: @@ -1999,11 +2167,16 @@ components: description: >- A Bandwidth phone number on your account the call should come - from (must be in E.164 format, like `+15555551212`, or be one of the - following - - strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). - example: '+19195554321' + from (must be in E.164 format, like `+15555551212`) even if + `privacy` is set to true. + example: '+15555551212' + privacy: + nullable: true + type: boolean + description: >- + Hide the calling number. The `displayName` field can be used to + customize the displayed name. + example: false displayName: nullable: true type: string @@ -2012,6 +2185,9 @@ components: May not exceed 256 characters nor contain control characters such as new lines. + + If `privacy` is true, only the following values are valid: + `Restricted`, `Anonymous`, `Private`, or `Unavailable`. maxLength: 256 example: John Doe uui: @@ -2335,7 +2511,7 @@ components: description: >- The phone number that made the call, in E.164 format (e.g. +15555555555). - example: '19195554321' + example: '+19195554321' direction: $ref: '#/components/schemas/callDirectionEnum' state: @@ -2625,7 +2801,7 @@ components: mediaUrl: $ref: '#/components/schemas/mediaUrl' transcription: - $ref: '#/components/schemas/transcriptionMetadata' + $ref: '#/components/schemas/recordingTranscriptionMetadata' conference: type: object properties: @@ -2870,7 +3046,10 @@ components: description: >- The machine detection request used to perform machine detection on the - call. + call. Currently, there is an issue where decimal values are not getting + processed correctly. Please use whole number values. We are working to + resolve this issue. Please contact Bandwidth Support if you need more + information. properties: mode: $ref: '#/components/schemas/machineDetectionModeEnum' @@ -3062,14 +3241,84 @@ components: Current supported languages are English, French, and Spanish. default: false example: true - transcriptionList: + recordingTranscriptions: type: object properties: transcripts: type: array items: $ref: '#/components/schemas/transcription' - transcriptionMetadata: + callTranscriptionMetadataList: + type: array + items: + $ref: '#/components/schemas/callTranscriptionMetadata' + example: + - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionMetadata: + type: object + properties: + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: + type: string + description: >- + A URL that may be used to retrieve the transcription itself. This + points to the + + [Get Call + Transcription](/apis/voice/#operation/getCallTranscription) + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionResponse: + type: object + properties: + accountId: + type: string + description: The user account associated with the call. + example: '9900000' + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + tracks: + type: array + items: + $ref: '#/components/schemas/callTranscription' + example: + - detectedLanguage: en-US + track: inbound + transcript: Hello World! This is an example. + confidence: 0.9 + callTranscription: + type: object + properties: + detectedLanguage: + $ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum' + track: + $ref: '#/components/schemas/callTranscriptionTrackEnum' + transcript: + type: string + description: The transcription itself. + example: Hello World! This is an example. + confidence: + type: number + format: double + minimum: 0 + maximum: 1 + description: >- + How confident the transcription engine was in transcribing the + associated audio (from `0` to `1`). + example: 0.9 + recordingTranscriptionMetadata: nullable: true type: object description: If the recording was transcribed, metadata about the transcription @@ -3082,6 +3331,7 @@ components: $ref: '#/components/schemas/status' completedTime: type: string + format: date-time description: The time that the transcription was completed example: '2022-06-13T18:46:29.715Z' url: @@ -3641,7 +3891,7 @@ components: fileFormat: $ref: '#/components/schemas/fileFormatEnum' channels: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/channels' tag: $ref: '#/components/schemas/tag1' status: @@ -3894,7 +4144,7 @@ components: accountId: type: string description: The user account associated with the call. - example: '920012' + example: '9900000' applicationId: type: string description: The id of the application associated with the call. @@ -3908,9 +4158,8 @@ components: from: type: string description: >- - The provided identifier of the caller: can be a phone number in E.164 - format (e.g. +15555555555) or one of Private, Restricted, Unavailable, - or Anonymous. + The provided identifier of the caller. Must be a phone number in E.164 + format (e.g. +15555555555). example: '+15555555555' conferenceId: type: string @@ -3989,15 +4238,14 @@ components: type: string description: >- The phone number used as the from field of the B-leg call, in E.164 - format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or - Unavailable. + format (e.g. +15555555555). example: '+15555555555' transferTo: type: string description: >- The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). - example: +15555555555) + example: '+15555555555' mediaUrl: nullable: true type: string @@ -4208,7 +4456,7 @@ components: messageId: type: string description: Messaging API Message ID. - example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 + example: 1589228074636lm4k2je7j7jklbn2 verifyCodeRequest: type: object properties: @@ -4491,6 +4739,14 @@ components: application/json: schema: $ref: '#/components/schemas/callState' + listCallsResponse: + description: Calls retrieved successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callState' getStatisticsResponse: description: Statistics Found content: @@ -4522,12 +4778,26 @@ components: schema: type: string format: binary + getRecordingTranscriptionResponse: + description: Transcription found. + content: + application/json: + schema: + $ref: '#/components/schemas/recordingTranscriptions' + listTranscriptionsResponse: + description: Transcription found. + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' getCallTranscriptionResponse: - description: Transcription found + description: Transcription found. content: application/json: schema: - $ref: '#/components/schemas/transcriptionList' + $ref: '#/components/schemas/callTranscriptionResponse' + deleteCallTranscriptionResponse: + description: Transcription data was deleted. listConferencesResponse: description: Conferences retrieved successfully content: @@ -5030,6 +5300,14 @@ components: type: string description: Programmable Voice API Conference Member ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + name: transcriptionId + in: path + required: true + schema: + type: string + description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 to: name: to in: query @@ -5106,6 +5384,38 @@ components: default: 1000 description: Specifies the max number of conferences that will be returned. example: 500 + minStartTimeCalls: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTimeCalls: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` before or including + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSizeCalls: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 10000 + default: 1000 + description: Specifies the max number of calls that will be returned. + example: 500 pageToken1: name: pageToken in: query @@ -5116,6 +5426,14 @@ components: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + disconnectCause: + name: disconnectCause + in: query + required: false + schema: + type: string + description: Filter results to calls with specified call Disconnect Cause. + example: hangup requestId: name: requestId in: path @@ -5417,12 +5735,14 @@ components: Basic: type: http scheme: basic - description: |- + description: >- Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an Authorization - header that contains the word Basic followed by a space and a - base64-encoded string `username:password`Example: `Authorization: Basic - ZGVtbZpwQDU1dzByZA==` + HTTP protocol. To use it, send your HTTP requests with an + `Authorization` header that contains the word `Basic` followed by a + space and a Base64-encoded string `username:password`. + + + - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` callbacks: inboundCallback: '{inboundCallbackUrl}': @@ -5472,6 +5792,7 @@ components: answerMethod: POST answerUrl: https://myServer.example/bandwidth/webhooks/answer answerFallbackMethod: POST + answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback disconnectMethod: POST disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect username: mySecretUsername diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index c7a1b41e..835b28b0 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -26,6 +26,7 @@ from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi from bandwidth.api.recordings_api import RecordingsApi from bandwidth.api.statistics_api import StatisticsApi +from bandwidth.api.transcriptions_api import TranscriptionsApi # import ApiClient from bandwidth.api_response import ApiResponse @@ -47,6 +48,11 @@ from bandwidth.models.call_recording_metadata import CallRecordingMetadata from bandwidth.models.call_state import CallState from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.call_transcription import CallTranscription +from bandwidth.models.call_transcription_detected_language_enum import CallTranscriptionDetectedLanguageEnum +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata +from bandwidth.models.call_transcription_response import CallTranscriptionResponse +from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference @@ -106,6 +112,8 @@ from bandwidth.models.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata +from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum from bandwidth.models.stir_shaken import StirShaken @@ -114,8 +122,6 @@ from bandwidth.models.transcribe_recording import TranscribeRecording from bandwidth.models.transcription import Transcription from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback -from bandwidth.models.transcription_list import TranscriptionList -from bandwidth.models.transcription_metadata import TranscriptionMetadata from bandwidth.models.transfer_answer_callback import TransferAnswerCallback from bandwidth.models.transfer_complete_callback import TransferCompleteCallback from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback diff --git a/bandwidth/api/__init__.py b/bandwidth/api/__init__.py index 1af480a8..e7d2d1bb 100644 --- a/bandwidth/api/__init__.py +++ b/bandwidth/api/__init__.py @@ -9,4 +9,5 @@ from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi from bandwidth.api.recordings_api import RecordingsApi from bandwidth.api.statistics_api import StatisticsApi +from bandwidth.api.transcriptions_api import TranscriptionsApi diff --git a/bandwidth/api/calls_api.py b/bandwidth/api/calls_api.py index 0f66a9d1..1d1a13c4 100644 --- a/bandwidth/api/calls_api.py +++ b/bandwidth/api/calls_api.py @@ -18,6 +18,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictStr +from typing import List, Optional from typing_extensions import Annotated from bandwidth.models.call_state import CallState from bandwidth.models.create_call import CreateCall @@ -297,7 +298,7 @@ def _create_call_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -312,11 +313,12 @@ def _create_call_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -610,7 +612,7 @@ def _get_call_state_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -625,11 +627,417 @@ def _get_call_state_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/accounts/{accountId}/calls/{callId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_calls( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + to: Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, + min_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, + max_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format).")] = None, + disconnect_cause: Annotated[Optional[StrictStr], Field(description="Filter results to calls with specified call Disconnect Cause.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]], Field(description="Specifies the max number of calls that will be returned.")] = None, + page_token: Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> List[CallState]: + """Get Calls + + Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param to: Filter results by the `to` field. + :type to: str + :param var_from: Filter results by the `from` field. + :type var_from: str + :param min_start_time: Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). + :type min_start_time: str + :param max_start_time: Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). + :type max_start_time: str + :param disconnect_cause: Filter results to calls with specified call Disconnect Cause. + :type disconnect_cause: str + :param page_size: Specifies the max number of calls that will be returned. + :type page_size: int + :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + :type page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_calls_serialize( + account_id=account_id, + to=to, + var_from=var_from, + min_start_time=min_start_time, + max_start_time=max_start_time, + disconnect_cause=disconnect_cause, + page_size=page_size, + page_token=page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallState]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_calls_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + to: Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, + min_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, + max_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format).")] = None, + disconnect_cause: Annotated[Optional[StrictStr], Field(description="Filter results to calls with specified call Disconnect Cause.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]], Field(description="Specifies the max number of calls that will be returned.")] = None, + page_token: Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[List[CallState]]: + """Get Calls + + Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param to: Filter results by the `to` field. + :type to: str + :param var_from: Filter results by the `from` field. + :type var_from: str + :param min_start_time: Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). + :type min_start_time: str + :param max_start_time: Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). + :type max_start_time: str + :param disconnect_cause: Filter results to calls with specified call Disconnect Cause. + :type disconnect_cause: str + :param page_size: Specifies the max number of calls that will be returned. + :type page_size: int + :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + :type page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_calls_serialize( + account_id=account_id, + to=to, + var_from=var_from, + min_start_time=min_start_time, + max_start_time=max_start_time, + disconnect_cause=disconnect_cause, + page_size=page_size, + page_token=page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallState]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_calls_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + to: Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, + min_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, + max_start_time: Annotated[Optional[StrictStr], Field(description="Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format).")] = None, + disconnect_cause: Annotated[Optional[StrictStr], Field(description="Filter results to calls with specified call Disconnect Cause.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]], Field(description="Specifies the max number of calls that will be returned.")] = None, + page_token: Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get Calls + + Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param to: Filter results by the `to` field. + :type to: str + :param var_from: Filter results by the `from` field. + :type var_from: str + :param min_start_time: Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). + :type min_start_time: str + :param max_start_time: Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). + :type max_start_time: str + :param disconnect_cause: Filter results to calls with specified call Disconnect Cause. + :type disconnect_cause: str + :param page_size: Specifies the max number of calls that will be returned. + :type page_size: int + :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. + :type page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_calls_serialize( + account_id=account_id, + to=to, + var_from=var_from, + min_start_time=min_start_time, + max_start_time=max_start_time, + disconnect_cause=disconnect_cause, + page_size=page_size, + page_token=page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallState]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response + + + def _list_calls_serialize( + self, + account_id, + to, + var_from, + min_start_time, + max_start_time, + disconnect_cause, + page_size, + page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + # process the query parameters + if to is not None: + + _query_params.append(('to', to)) + + if var_from is not None: + + _query_params.append(('from', var_from)) + + if min_start_time is not None: + + _query_params.append(('minStartTime', min_start_time)) + + if max_start_time is not None: + + _query_params.append(('maxStartTime', max_start_time)) + + if disconnect_cause is not None: + + _query_params.append(('disconnectCause', disconnect_cause)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if page_token is not None: + + _query_params.append(('pageToken', page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -639,7 +1047,7 @@ def _get_call_state_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/accounts/{accountId}/calls/{callId}', + resource_path='/accounts/{accountId}/calls', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -926,7 +1334,7 @@ def _update_call_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -943,11 +1351,12 @@ def _update_call_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1257,7 +1666,7 @@ def _update_call_bxml_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1274,11 +1683,12 @@ def _update_call_bxml_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/bandwidth/api/conferences_api.py b/bandwidth/api/conferences_api.py index b806352c..1e8177f1 100644 --- a/bandwidth/api/conferences_api.py +++ b/bandwidth/api/conferences_api.py @@ -17,8 +17,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional +from pydantic import Field, StrictBytes, StrictStr +from typing import List, Optional, Union from typing_extensions import Annotated from bandwidth.models.conference import Conference from bandwidth.models.conference_member import ConferenceMember @@ -312,7 +312,7 @@ def _download_conference_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -329,13 +329,14 @@ def _download_conference_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'audio/vnd.wave', - 'audio/mpeg', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'audio/vnd.wave', + 'audio/mpeg', + 'application/json' + ] + ) # authentication setting @@ -616,7 +617,7 @@ def _get_conference_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -631,11 +632,12 @@ def _get_conference_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -929,7 +931,7 @@ def _get_conference_member_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -946,11 +948,12 @@ def _get_conference_member_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1244,7 +1247,7 @@ def _get_conference_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1261,11 +1264,12 @@ def _get_conference_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1546,7 +1550,7 @@ def _list_conference_recordings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1561,11 +1565,12 @@ def _list_conference_recordings_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1898,7 +1903,7 @@ def _list_conferences_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1931,11 +1936,12 @@ def _list_conferences_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2229,7 +2235,7 @@ def _update_conference_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2246,11 +2252,12 @@ def _update_conference_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2557,7 +2564,7 @@ def _update_conference_bxml_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2574,11 +2581,12 @@ def _update_conference_bxml_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2898,7 +2906,7 @@ def _update_conference_member_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2917,11 +2925,12 @@ def _update_conference_member_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/bandwidth/api/media_api.py b/bandwidth/api/media_api.py index 45c53cf9..8258fce9 100644 --- a/bandwidth/api/media_api.py +++ b/bandwidth/api/media_api.py @@ -18,7 +18,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBytes, StrictStr -from typing import Optional, Union +from typing import List, Optional, Union from typing_extensions import Annotated from bandwidth.models.media import Media @@ -295,7 +295,7 @@ def _delete_media_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -310,11 +310,12 @@ def _delete_media_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -595,7 +596,7 @@ def _get_media_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -610,12 +611,13 @@ def _get_media_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/octet-stream', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) # authentication setting @@ -896,7 +898,7 @@ def _list_media_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -911,11 +913,12 @@ def _list_media_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1235,7 +1238,7 @@ def _upload_media_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1261,11 +1264,12 @@ def _upload_media_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py index 0bf460ae..93af0c06 100644 --- a/bandwidth/api/messages_api.py +++ b/bandwidth/api/messages_api.py @@ -300,7 +300,7 @@ def _create_message_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -315,11 +315,12 @@ def _create_message_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -792,7 +793,7 @@ def _list_messages_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -865,11 +866,12 @@ def _list_messages_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/bandwidth/api/mfa_api.py b/bandwidth/api/mfa_api.py index 77013394..562fc14f 100644 --- a/bandwidth/api/mfa_api.py +++ b/bandwidth/api/mfa_api.py @@ -286,7 +286,7 @@ def _generate_messaging_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -301,11 +301,12 @@ def _generate_messaging_code_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -587,7 +588,7 @@ def _generate_voice_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -602,11 +603,12 @@ def _generate_voice_code_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -891,7 +893,7 @@ def _verify_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -906,11 +908,12 @@ def _verify_code_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/bandwidth/api/phone_number_lookup_api.py b/bandwidth/api/phone_number_lookup_api.py index 878e3d04..d380a255 100644 --- a/bandwidth/api/phone_number_lookup_api.py +++ b/bandwidth/api/phone_number_lookup_api.py @@ -290,7 +290,7 @@ def _create_lookup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -305,11 +305,12 @@ def _create_lookup_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -597,7 +598,7 @@ def _get_lookup_status_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -612,11 +613,12 @@ def _get_lookup_status_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/bandwidth/api/recordings_api.py b/bandwidth/api/recordings_api.py index 42ca14f9..8ec8dfc8 100644 --- a/bandwidth/api/recordings_api.py +++ b/bandwidth/api/recordings_api.py @@ -17,12 +17,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional +from pydantic import Field, StrictBytes, StrictStr +from typing import List, Optional, Union from typing_extensions import Annotated from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.transcribe_recording import TranscribeRecording -from bandwidth.models.transcription_list import TranscriptionList from bandwidth.models.update_call_recording import UpdateCallRecording from bandwidth.api_client import ApiClient, RequestSerialized @@ -44,7 +44,7 @@ def __init__(self, api_client=None) -> None: @validate_call - def delete_call_transcription( + def delete_recording( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -62,9 +62,9 @@ def delete_call_transcription( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> None: - """Delete Transcription + """Delete Recording - Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. + Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -94,7 +94,7 @@ def delete_call_transcription( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_call_transcription_serialize( + _param = self._delete_recording_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -127,7 +127,7 @@ def delete_call_transcription( @validate_call - def delete_call_transcription_with_http_info( + def delete_recording_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -145,9 +145,9 @@ def delete_call_transcription_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> ApiResponse[None]: - """Delete Transcription + """Delete Recording - Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. + Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -177,7 +177,7 @@ def delete_call_transcription_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_call_transcription_serialize( + _param = self._delete_recording_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -210,7 +210,7 @@ def delete_call_transcription_with_http_info( @validate_call - def delete_call_transcription_without_preload_content( + def delete_recording_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -228,9 +228,9 @@ def delete_call_transcription_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> RESTResponseType: - """Delete Transcription + """Delete Recording - Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. + Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -260,7 +260,7 @@ def delete_call_transcription_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_call_transcription_serialize( + _param = self._delete_recording_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -288,7 +288,7 @@ def delete_call_transcription_without_preload_content( return response_data.response - def _delete_call_transcription_serialize( + def _delete_recording_serialize( self, account_id, call_id, @@ -311,7 +311,7 @@ def _delete_call_transcription_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -328,11 +328,12 @@ def _delete_call_transcription_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -342,7 +343,7 @@ def _delete_call_transcription_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', + resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -359,7 +360,7 @@ def _delete_call_transcription_serialize( @validate_call - def delete_recording( + def delete_recording_media( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -377,9 +378,9 @@ def delete_recording( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> None: - """Delete Recording + """Delete Recording Media - Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + Deletes the specified recording's media. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -409,7 +410,7 @@ def delete_recording( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_serialize( + _param = self._delete_recording_media_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -442,7 +443,7 @@ def delete_recording( @validate_call - def delete_recording_with_http_info( + def delete_recording_media_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -460,9 +461,9 @@ def delete_recording_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> ApiResponse[None]: - """Delete Recording + """Delete Recording Media - Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + Deletes the specified recording's media. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -492,7 +493,7 @@ def delete_recording_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_serialize( + _param = self._delete_recording_media_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -525,7 +526,7 @@ def delete_recording_with_http_info( @validate_call - def delete_recording_without_preload_content( + def delete_recording_media_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -543,9 +544,9 @@ def delete_recording_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> RESTResponseType: - """Delete Recording + """Delete Recording Media - Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + Deletes the specified recording's media. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -575,7 +576,7 @@ def delete_recording_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_serialize( + _param = self._delete_recording_media_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -603,7 +604,7 @@ def delete_recording_without_preload_content( return response_data.response - def _delete_recording_serialize( + def _delete_recording_media_serialize( self, account_id, call_id, @@ -626,7 +627,7 @@ def _delete_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -643,11 +644,12 @@ def _delete_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -657,7 +659,7 @@ def _delete_recording_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', + resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -674,7 +676,7 @@ def _delete_recording_serialize( @validate_call - def delete_recording_media( + def delete_recording_transcription( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -692,9 +694,9 @@ def delete_recording_media( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> None: - """Delete Recording Media + """Delete Transcription - Deletes the specified recording's media. + Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -724,7 +726,7 @@ def delete_recording_media( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_media_serialize( + _param = self._delete_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -757,7 +759,7 @@ def delete_recording_media( @validate_call - def delete_recording_media_with_http_info( + def delete_recording_transcription_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -775,9 +777,9 @@ def delete_recording_media_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> ApiResponse[None]: - """Delete Recording Media + """Delete Transcription - Deletes the specified recording's media. + Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -807,7 +809,7 @@ def delete_recording_media_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_media_serialize( + _param = self._delete_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -840,7 +842,7 @@ def delete_recording_media_with_http_info( @validate_call - def delete_recording_media_without_preload_content( + def delete_recording_transcription_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -858,9 +860,9 @@ def delete_recording_media_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> RESTResponseType: - """Delete Recording Media + """Delete Transcription - Deletes the specified recording's media. + Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -890,7 +892,7 @@ def delete_recording_media_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_recording_media_serialize( + _param = self._delete_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -918,7 +920,7 @@ def delete_recording_media_without_preload_content( return response_data.response - def _delete_recording_media_serialize( + def _delete_recording_transcription_serialize( self, account_id, call_id, @@ -941,7 +943,7 @@ def _delete_recording_media_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -958,11 +960,12 @@ def _delete_recording_media_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -972,7 +975,7 @@ def _delete_recording_media_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', + resource_path='/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1256,7 +1259,7 @@ def _download_call_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1273,13 +1276,14 @@ def _download_call_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'audio/vnd.wave', - 'audio/mpeg', - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'audio/vnd.wave', + 'audio/mpeg', + 'application/json' + ] + ) # authentication setting @@ -1573,7 +1577,7 @@ def _get_call_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1590,11 +1594,12 @@ def _get_call_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1621,7 +1626,7 @@ def _get_call_recording_serialize( @validate_call - def get_call_transcription( + def get_recording_transcription( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -1638,10 +1643,10 @@ def get_call_transcription( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, - ) -> TranscriptionList: + ) -> RecordingTranscriptions: """Get Transcription - Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -1671,7 +1676,7 @@ def get_call_transcription( :return: Returns the result object. """ # noqa: E501 - _param = self._get_call_transcription_serialize( + _param = self._get_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -1682,7 +1687,7 @@ def get_call_transcription( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TranscriptionList", + '200': "RecordingTranscriptions", '400': "VoiceApiError", '401': "VoiceApiError", '403': "VoiceApiError", @@ -1704,7 +1709,7 @@ def get_call_transcription( @validate_call - def get_call_transcription_with_http_info( + def get_recording_transcription_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -1721,10 +1726,10 @@ def get_call_transcription_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, - ) -> ApiResponse[TranscriptionList]: + ) -> ApiResponse[RecordingTranscriptions]: """Get Transcription - Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -1754,7 +1759,7 @@ def get_call_transcription_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_call_transcription_serialize( + _param = self._get_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -1765,7 +1770,7 @@ def get_call_transcription_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TranscriptionList", + '200': "RecordingTranscriptions", '400': "VoiceApiError", '401': "VoiceApiError", '403': "VoiceApiError", @@ -1787,7 +1792,7 @@ def get_call_transcription_with_http_info( @validate_call - def get_call_transcription_without_preload_content( + def get_recording_transcription_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], @@ -1807,7 +1812,7 @@ def get_call_transcription_without_preload_content( ) -> RESTResponseType: """Get Transcription - Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. :param account_id: Your Bandwidth Account ID. (required) :type account_id: str @@ -1837,7 +1842,7 @@ def get_call_transcription_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_call_transcription_serialize( + _param = self._get_recording_transcription_serialize( account_id=account_id, call_id=call_id, recording_id=recording_id, @@ -1848,7 +1853,7 @@ def get_call_transcription_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TranscriptionList", + '200': "RecordingTranscriptions", '400': "VoiceApiError", '401': "VoiceApiError", '403': "VoiceApiError", @@ -1865,7 +1870,7 @@ def get_call_transcription_without_preload_content( return response_data.response - def _get_call_transcription_serialize( + def _get_recording_transcription_serialize( self, account_id, call_id, @@ -1888,7 +1893,7 @@ def _get_call_transcription_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1905,11 +1910,12 @@ def _get_call_transcription_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2229,7 +2235,7 @@ def _list_account_call_recordings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2258,11 +2264,12 @@ def _list_account_call_recordings_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2543,7 +2550,7 @@ def _list_call_recordings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2558,11 +2565,12 @@ def _list_call_recordings_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2869,7 +2877,7 @@ def _transcribe_call_recording_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2888,11 +2896,12 @@ def _transcribe_call_recording_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -3199,7 +3208,7 @@ def _update_call_recording_state_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3216,11 +3225,12 @@ def _update_call_recording_state_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/bandwidth/api/statistics_api.py b/bandwidth/api/statistics_api.py index 4221049e..6fe3af8f 100644 --- a/bandwidth/api/statistics_api.py +++ b/bandwidth/api/statistics_api.py @@ -281,7 +281,7 @@ def _get_statistics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -294,11 +294,12 @@ def _get_statistics_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/bandwidth/api/transcriptions_api.py b/bandwidth/api/transcriptions_api.py new file mode 100644 index 00000000..c1f0bf5e --- /dev/null +++ b/bandwidth/api/transcriptions_api.py @@ -0,0 +1,974 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata +from bandwidth.models.call_transcription_response import CallTranscriptionResponse + +from bandwidth.api_client import ApiClient, RequestSerialized +from bandwidth.api_response import ApiResponse +from bandwidth.rest import RESTResponseType + + +class TranscriptionsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def delete_real_time_transcription( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> None: + """Delete a specific transcription + + 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. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_real_time_transcription_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[None]: + """Delete a specific transcription + + 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. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_real_time_transcription_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Delete a specific transcription + + 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. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_real_time_transcription_serialize( + self, + account_id, + call_id, + transcription_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if call_id is not None: + _path_params['callId'] = call_id + if transcription_id is not None: + _path_params['transcriptionId'] = transcription_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_real_time_transcription( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> CallTranscriptionResponse: + """Retrieve a specific transcription + + Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallTranscriptionResponse", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_real_time_transcription_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[CallTranscriptionResponse]: + """Retrieve a specific transcription + + Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallTranscriptionResponse", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_real_time_transcription_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + transcription_id: Annotated[StrictStr, Field(description="Programmable Voice API Transcription ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Retrieve a specific transcription + + Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param transcription_id: Programmable Voice API Transcription ID. (required) + :type transcription_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_real_time_transcription_serialize( + account_id=account_id, + call_id=call_id, + transcription_id=transcription_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallTranscriptionResponse", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_real_time_transcription_serialize( + self, + account_id, + call_id, + transcription_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if call_id is not None: + _path_params['callId'] = call_id + if transcription_id is not None: + _path_params['transcriptionId'] = transcription_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_real_time_transcriptions( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> List[CallTranscriptionMetadata]: + """Enumerate transcriptions made with StartTranscription + + Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_real_time_transcriptions_serialize( + account_id=account_id, + call_id=call_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallTranscriptionMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_real_time_transcriptions_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[List[CallTranscriptionMetadata]]: + """Enumerate transcriptions made with StartTranscription + + Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_real_time_transcriptions_serialize( + account_id=account_id, + call_id=call_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallTranscriptionMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_real_time_transcriptions_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + call_id: Annotated[StrictStr, Field(description="Programmable Voice API Call ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Enumerate transcriptions made with StartTranscription + + Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param call_id: Programmable Voice API Call ID. (required) + :type call_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_real_time_transcriptions_serialize( + account_id=account_id, + call_id=call_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CallTranscriptionMetadata]", + '400': "VoiceApiError", + '401': "VoiceApiError", + '403': "VoiceApiError", + '404': "VoiceApiError", + '405': "VoiceApiError", + '415': "VoiceApiError", + '429': "VoiceApiError", + '500': "VoiceApiError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_real_time_transcriptions_serialize( + self, + account_id, + call_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://voice.bandwidth.com/api/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if call_id is not None: + _path_params['callId'] = call_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/accounts/{accountId}/calls/{callId}/transcriptions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/bandwidth/api_client.py b/bandwidth/api_client.py index 2aed2303..e2054dad 100644 --- a/bandwidth/api_client.py +++ b/bandwidth/api_client.py @@ -23,7 +23,8 @@ import tempfile from urllib.parse import quote -from typing import Tuple, Optional, List, Dict +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from bandwidth.configuration import Configuration from bandwidth.api_response import ApiResponse, T as ApiResponseT @@ -88,7 +89,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/16.0.0/python' + self.user_agent = 'OpenAPI-Generator/15.0.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -208,7 +209,8 @@ def param_serialize( post_params, collection_formats ) - post_params.extend(self.files_parameters(files)) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( @@ -226,7 +228,7 @@ def param_serialize( body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -313,7 +315,7 @@ def response_deserialize( match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -333,6 +335,7 @@ def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. @@ -345,6 +348,10 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): @@ -366,28 +373,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ return { key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -505,31 +529,30 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters(self, files: Dict[str, Union[str, bytes]]): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: diff --git a/bandwidth/configuration.py b/bandwidth/configuration.py index 51b5f408..fd84071e 100644 --- a/bandwidth/configuration.py +++ b/bandwidth/configuration.py @@ -33,6 +33,9 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -55,6 +58,7 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -83,7 +87,11 @@ def __init__(self, host=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None ) -> None: """Constructor """ @@ -98,6 +106,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -141,7 +152,10 @@ def __init__(self, host=None, self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -184,7 +198,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index 18c7b0a3..da557bc1 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -23,6 +23,11 @@ from bandwidth.models.call_recording_metadata import CallRecordingMetadata from bandwidth.models.call_state import CallState from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.call_transcription import CallTranscription +from bandwidth.models.call_transcription_detected_language_enum import CallTranscriptionDetectedLanguageEnum +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata +from bandwidth.models.call_transcription_response import CallTranscriptionResponse +from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference @@ -82,6 +87,8 @@ from bandwidth.models.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata +from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum from bandwidth.models.stir_shaken import StirShaken @@ -90,8 +97,6 @@ from bandwidth.models.transcribe_recording import TranscribeRecording from bandwidth.models.transcription import Transcription from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback -from bandwidth.models.transcription_list import TranscriptionList -from bandwidth.models.transcription_metadata import TranscriptionMetadata from bandwidth.models.transfer_answer_callback import TransferAnswerCallback from bandwidth.models.transfer_complete_callback import TransferCompleteCallback from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback diff --git a/bandwidth/models/answer_callback.py b/bandwidth/models/answer_callback.py index 598e9037..77a2cff2 100644 --- a/bandwidth/models/answer_callback.py +++ b/bandwidth/models/answer_callback.py @@ -34,7 +34,7 @@ class AnswerCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") diff --git a/bandwidth/models/bridge_complete_callback.py b/bandwidth/models/bridge_complete_callback.py index b61450f7..f937a093 100644 --- a/bandwidth/models/bridge_complete_callback.py +++ b/bandwidth/models/bridge_complete_callback.py @@ -33,7 +33,7 @@ class BridgeCompleteCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") diff --git a/bandwidth/models/bridge_target_complete_callback.py b/bandwidth/models/bridge_target_complete_callback.py index c2a2c831..9a962589 100644 --- a/bandwidth/models/bridge_target_complete_callback.py +++ b/bandwidth/models/bridge_target_complete_callback.py @@ -33,7 +33,7 @@ class BridgeTargetCompleteCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") diff --git a/bandwidth/models/bxml/__init__.py b/bandwidth/models/bxml/__init__.py index 32a84c4c..6ee36b26 100644 --- a/bandwidth/models/bxml/__init__.py +++ b/bandwidth/models/bxml/__init__.py @@ -1,6 +1,6 @@ from .bxml import Bxml +from .nestable_verb import NestableVerb from .response import Response from .root import Root -from .terminal_verb import TerminalVerb from .verb import Verb from .verbs import * diff --git a/bandwidth/models/bxml/nestable_verb.py b/bandwidth/models/bxml/nestable_verb.py new file mode 100644 index 00000000..6dd0aa03 --- /dev/null +++ b/bandwidth/models/bxml/nestable_verb.py @@ -0,0 +1,72 @@ +""" +nestable_verb.py + +Defines the base nestable_verb class for all BXML verbs that can have nested verbs + +@copyright Bandwidth INC +""" +from __future__ import annotations +import re +from typing import Union +import xml.etree.ElementTree as ET + +from .verb import Verb + + +class NestableVerb(Verb): + """Base class for nestable BXML verbs + """ + ssml_regex = r"<([a-zA-Z//].*?)>" + + def __init__(self, tag: str, content: str = None, nested_verbs: list[Verb] = None): + """Initialize the verb model + + Args: + tag (str): Name of the XML element + content (str, optional): XML element content. Defaults to None. + nested_verbs (list[Verb], optional): XML element children. Defaults to None. + """ + self._tag = tag + self._content = content + self._nested_verbs = nested_verbs + if not self._nested_verbs: + self._nested_verbs = [] + + def _to_etree_element(self) -> ET.Element: + """Generate an ET.Element object from a NestableVerb Object + + Returns: + ET.Element: ET.Element representation of NestableVerb + """ + root = ET.Element(self._tag) + if self._content: + root.text = self._content + self._set_attributes(root) + if self._nested_verbs: + for verb in self._nested_verbs: + root.append(verb._to_etree_element()) + return root + + def _generate_xml(self) -> ET.ElementTree: + """Generates an XML dom + + Returns: + ET.Element: The XML dom for the verb and its nested verbs + """ + root = ET.Element(self._tag) + if self._content: + root.text = self._content + self._set_attributes(root) + if self._nested_verbs: + for verb in self._nested_verbs: + root.append(verb._to_etree_element()) + dom = ET.ElementTree(root) + return dom + + def add_verb(self, verb) -> None: + """Add a verb to the object's nested_verbs array + + Args: + verb (Verb): BXML verb to nest within the parent. Becomes a child xml element. + """ + self._nested_verbs.append(verb) diff --git a/bandwidth/models/bxml/terminal_verb.py b/bandwidth/models/bxml/terminal_verb.py deleted file mode 100644 index ddcf75b2..00000000 --- a/bandwidth/models/bxml/terminal_verb.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -terminal_verb.py - -Defines the terminal_verb class BXML verbs that cant have nested_verbs - -@copyright Bandwidth INC -""" -from .verb import Verb - - -class TerminalVerb(Verb): - """Base class for BXML verbs - """ - ssml_regex = r"<([a-zA-Z//].*?)>" - - def __init__(self, tag: str, content: str = None): - """Initialize the verb model - - Args: - tag (str): Name of the XML element - content (str, optional): XML element content. Defaults to None. - """ - super().__init__(tag=tag, content=content, nested_verbs=None) - - def add_verb(self, verb: Verb): - """Adding verbs is not allowed for this class - - Args: - verb (Verb): BXML verb - - Raises: - AttributeError: This method is not allowed for this verb - """ - raise AttributeError('Adding verbs is not supported by this verb') diff --git a/bandwidth/models/bxml/verb.py b/bandwidth/models/bxml/verb.py index 54de09b1..128dcc0b 100644 --- a/bandwidth/models/bxml/verb.py +++ b/bandwidth/models/bxml/verb.py @@ -15,7 +15,7 @@ class Verb: """Base class for BXML verbs """ - def __init__(self, tag: str, content: str = None, nested_verbs: list[Verb] = None): + def __init__(self, tag: str, content: str = None): """Initialize the verb model Args: @@ -25,9 +25,6 @@ def __init__(self, tag: str, content: str = None, nested_verbs: list[Verb] = Non """ self._tag = tag self._content = content - self._nested_verbs = nested_verbs - if not self._nested_verbs: - self._nested_verbs = [] @property def _attributes(self) -> Union[None, dict]: @@ -73,9 +70,6 @@ def _to_etree_element(self) -> ET.Element: if self._content: root.text = self._content self._set_attributes(root) - if self._nested_verbs: - for verb in self._nested_verbs: - root.append(verb._to_etree_element()) return root def _generate_xml(self) -> ET.ElementTree: @@ -88,20 +82,9 @@ def _generate_xml(self) -> ET.ElementTree: if self._content: root.text = self._content self._set_attributes(root) - if self._nested_verbs: - for verb in self._nested_verbs: - root.append(verb._to_etree_element()) dom = ET.ElementTree(root) return dom - def add_verb(self, verb) -> None: - """Add a verb to the object's nested_verbs array - - Args: - verb (BxmlVerb): BXML verb to nest within the parent. Becomes a child xml element. - """ - self._nested_verbs.append(verb) - def to_bxml(self) -> str: """Return the serialized BXML string diff --git a/bandwidth/models/bxml/verbs/__init__.py b/bandwidth/models/bxml/verbs/__init__.py index fc6ce38b..986c3972 100644 --- a/bandwidth/models/bxml/verbs/__init__.py +++ b/bandwidth/models/bxml/verbs/__init__.py @@ -1,10 +1,11 @@ from .bridge import Bridge from .conference import Conference from .custom_param import CustomParam -from .hangup import Hangup +from .forward import Forward from .gather import Gather -from .pause import Pause +from .hangup import Hangup from .pause_recording import PauseRecording +from .pause import Pause from .phone_number import PhoneNumber from .play_audio import PlayAudio from .record import Record @@ -19,8 +20,8 @@ from .start_stream import StartStream from .start_transcription import StartTranscription from .stop_gather import StopGather -from .stop_stream import StopStream from .stop_recording import StopRecording +from .stop_stream import StopStream from .stop_transcription import StopTranscription from .stream_param import StreamParam from .tag import Tag diff --git a/bandwidth/models/bxml/verbs/bridge.py b/bandwidth/models/bxml/verbs/bridge.py index 1c3b52c0..515232e4 100644 --- a/bandwidth/models/bxml/verbs/bridge.py +++ b/bandwidth/models/bxml/verbs/bridge.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Bridge(TerminalVerb): +class Bridge(Verb): def __init__( self, target_call: str, bridge_complete_url: str=None, diff --git a/bandwidth/models/bxml/verbs/conference.py b/bandwidth/models/bxml/verbs/conference.py index 9fbac54c..5baba3f6 100644 --- a/bandwidth/models/bxml/verbs/conference.py +++ b/bandwidth/models/bxml/verbs/conference.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Conference(TerminalVerb): +class Conference(Verb): def __init__( self, name: str, mute: str=None, diff --git a/bandwidth/models/bxml/verbs/custom_param.py b/bandwidth/models/bxml/verbs/custom_param.py index b50c464f..65a63f52 100644 --- a/bandwidth/models/bxml/verbs/custom_param.py +++ b/bandwidth/models/bxml/verbs/custom_param.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class CustomParam(TerminalVerb): +class CustomParam(Verb): def __init__(self, name: str = None, value: str = None): """ Initialize a verb diff --git a/bandwidth/models/bxml/verbs/forward.py b/bandwidth/models/bxml/verbs/forward.py index fb624b85..99cd6207 100644 --- a/bandwidth/models/bxml/verbs/forward.py +++ b/bandwidth/models/bxml/verbs/forward.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Forward(TerminalVerb): +class Forward(Verb): def __init__( self, to: str=None, _from: str=None, diff --git a/bandwidth/models/bxml/verbs/gather.py b/bandwidth/models/bxml/verbs/gather.py index b3ffebb3..d0a18a63 100644 --- a/bandwidth/models/bxml/verbs/gather.py +++ b/bandwidth/models/bxml/verbs/gather.py @@ -6,12 +6,12 @@ @copyright Bandwidth INC """ from typing import Union, List -from ..verb import Verb +from ..nestable_verb import NestableVerb from .play_audio import PlayAudio from .speak_sentence import SpeakSentence -class Gather(Verb): +class Gather(NestableVerb): def __init__( self, audio_verbs: List[Union[PlayAudio, SpeakSentence]] = [], diff --git a/bandwidth/models/bxml/verbs/hangup.py b/bandwidth/models/bxml/verbs/hangup.py index f6603efa..3d3e8778 100644 --- a/bandwidth/models/bxml/verbs/hangup.py +++ b/bandwidth/models/bxml/verbs/hangup.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Hangup(TerminalVerb): +class Hangup(Verb): def __init__(self): """Initialize a verb diff --git a/bandwidth/models/bxml/verbs/pause.py b/bandwidth/models/bxml/verbs/pause.py index 67e82f68..59709133 100644 --- a/bandwidth/models/bxml/verbs/pause.py +++ b/bandwidth/models/bxml/verbs/pause.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Pause(TerminalVerb): +class Pause(Verb): def __init__(self, duration:int=1): """Initialize a verb Args: diff --git a/bandwidth/models/bxml/verbs/pause_recording.py b/bandwidth/models/bxml/verbs/pause_recording.py index b7a7de5e..23f23998 100644 --- a/bandwidth/models/bxml/verbs/pause_recording.py +++ b/bandwidth/models/bxml/verbs/pause_recording.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class PauseRecording(TerminalVerb): +class PauseRecording(Verb): def __init__(self): """Initialize a verb diff --git a/bandwidth/models/bxml/verbs/phone_number.py b/bandwidth/models/bxml/verbs/phone_number.py index 381bebe5..ac209166 100644 --- a/bandwidth/models/bxml/verbs/phone_number.py +++ b/bandwidth/models/bxml/verbs/phone_number.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class PhoneNumber(TerminalVerb): +class PhoneNumber(Verb): def __init__( self, number: str, transfer_answer_url: str=None, transfer_answer_method: str=None, diff --git a/bandwidth/models/bxml/verbs/play_audio.py b/bandwidth/models/bxml/verbs/play_audio.py index 727d1256..92db0ba3 100644 --- a/bandwidth/models/bxml/verbs/play_audio.py +++ b/bandwidth/models/bxml/verbs/play_audio.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class PlayAudio(TerminalVerb): +class PlayAudio(Verb): def __init__( self, audio_uri: str, diff --git a/bandwidth/models/bxml/verbs/record.py b/bandwidth/models/bxml/verbs/record.py index d20be380..55ebd871 100644 --- a/bandwidth/models/bxml/verbs/record.py +++ b/bandwidth/models/bxml/verbs/record.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Record(TerminalVerb): +class Record(Verb): def __init__( self, record_complete_url: str=None, diff --git a/bandwidth/models/bxml/verbs/redirect.py b/bandwidth/models/bxml/verbs/redirect.py index 1b49a742..4d25db0c 100644 --- a/bandwidth/models/bxml/verbs/redirect.py +++ b/bandwidth/models/bxml/verbs/redirect.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Redirect(TerminalVerb): +class Redirect(Verb): def __init__( self, redirect_url: str, redirect_method: str = None, diff --git a/bandwidth/models/bxml/verbs/resume_recording.py b/bandwidth/models/bxml/verbs/resume_recording.py index 45fdf166..94913297 100644 --- a/bandwidth/models/bxml/verbs/resume_recording.py +++ b/bandwidth/models/bxml/verbs/resume_recording.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class ResumeRecording(TerminalVerb): +class ResumeRecording(Verb): def __init__( self diff --git a/bandwidth/models/bxml/verbs/ring.py b/bandwidth/models/bxml/verbs/ring.py index 28a32137..02234230 100644 --- a/bandwidth/models/bxml/verbs/ring.py +++ b/bandwidth/models/bxml/verbs/ring.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Ring(TerminalVerb): +class Ring(Verb): def __init__( self, duration: int=None, diff --git a/bandwidth/models/bxml/verbs/send_dtmf.py b/bandwidth/models/bxml/verbs/send_dtmf.py index 2900befd..ace83b65 100644 --- a/bandwidth/models/bxml/verbs/send_dtmf.py +++ b/bandwidth/models/bxml/verbs/send_dtmf.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class SendDtmf(TerminalVerb): +class SendDtmf(Verb): def __init__( self, digits: str, diff --git a/bandwidth/models/bxml/verbs/sip_uri.py b/bandwidth/models/bxml/verbs/sip_uri.py index 16452248..e52dbcc5 100644 --- a/bandwidth/models/bxml/verbs/sip_uri.py +++ b/bandwidth/models/bxml/verbs/sip_uri.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class SipUri(TerminalVerb): +class SipUri(Verb): def __init__( self, uri: str, uui: str=None, transfer_answer_url: str=None, transfer_answer_method: str=None, diff --git a/bandwidth/models/bxml/verbs/speak_sentence.py b/bandwidth/models/bxml/verbs/speak_sentence.py index f76fe513..f255c95f 100644 --- a/bandwidth/models/bxml/verbs/speak_sentence.py +++ b/bandwidth/models/bxml/verbs/speak_sentence.py @@ -9,10 +9,10 @@ import xml.etree.ElementTree as ET -from ..terminal_verb import TerminalVerb +from ..nestable_verb import NestableVerb -class SpeakSentence(TerminalVerb): +class SpeakSentence(NestableVerb): def __init__( self, text: str, voice: str=None, diff --git a/bandwidth/models/bxml/verbs/start_gather.py b/bandwidth/models/bxml/verbs/start_gather.py index 560e4c78..a88dedc0 100644 --- a/bandwidth/models/bxml/verbs/start_gather.py +++ b/bandwidth/models/bxml/verbs/start_gather.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StartGather(TerminalVerb): +class StartGather(Verb): def __init__( self, dtmf_url: str, dtmf_method: str=None, username: str=None, diff --git a/bandwidth/models/bxml/verbs/start_recording.py b/bandwidth/models/bxml/verbs/start_recording.py index 406d6705..422c903d 100644 --- a/bandwidth/models/bxml/verbs/start_recording.py +++ b/bandwidth/models/bxml/verbs/start_recording.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StartRecording(TerminalVerb): +class StartRecording(Verb): def __init__( self, recording_available_url: str = None, diff --git a/bandwidth/models/bxml/verbs/start_stream.py b/bandwidth/models/bxml/verbs/start_stream.py index d44d678b..a4fd274b 100644 --- a/bandwidth/models/bxml/verbs/start_stream.py +++ b/bandwidth/models/bxml/verbs/start_stream.py @@ -7,11 +7,11 @@ """ from typing import List -from ..verb import Verb +from ..nestable_verb import NestableVerb from ..verbs.stream_param import StreamParam -class StartStream(Verb): +class StartStream(NestableVerb): def __init__( self, destination: str, stream_params: List[StreamParam] = [], diff --git a/bandwidth/models/bxml/verbs/start_transcription.py b/bandwidth/models/bxml/verbs/start_transcription.py index 78a4af7d..bd1b9df6 100644 --- a/bandwidth/models/bxml/verbs/start_transcription.py +++ b/bandwidth/models/bxml/verbs/start_transcription.py @@ -7,11 +7,11 @@ """ from typing import List -from ..verb import Verb +from ..nestable_verb import NestableVerb from ..verbs.custom_param import CustomParam -class StartTranscription(Verb): +class StartTranscription(NestableVerb): def __init__( self, name: str = None, tracks: str = None, diff --git a/bandwidth/models/bxml/verbs/stop_gather.py b/bandwidth/models/bxml/verbs/stop_gather.py index 73b6b8a3..c06a23f5 100644 --- a/bandwidth/models/bxml/verbs/stop_gather.py +++ b/bandwidth/models/bxml/verbs/stop_gather.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StopGather(TerminalVerb): +class StopGather(Verb): def __init__(self): """Initialize a verb diff --git a/bandwidth/models/bxml/verbs/stop_recording.py b/bandwidth/models/bxml/verbs/stop_recording.py index 651f9caa..87cf8467 100644 --- a/bandwidth/models/bxml/verbs/stop_recording.py +++ b/bandwidth/models/bxml/verbs/stop_recording.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StopRecording(TerminalVerb): +class StopRecording(Verb): def __init__(self): """Initialize a verb diff --git a/bandwidth/models/bxml/verbs/stop_stream.py b/bandwidth/models/bxml/verbs/stop_stream.py index 87f7f596..8fb18109 100644 --- a/bandwidth/models/bxml/verbs/stop_stream.py +++ b/bandwidth/models/bxml/verbs/stop_stream.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StopStream(TerminalVerb): +class StopStream(Verb): def __init__( self, name: str diff --git a/bandwidth/models/bxml/verbs/stop_transcription.py b/bandwidth/models/bxml/verbs/stop_transcription.py index 5b9828ad..62e2cf4c 100644 --- a/bandwidth/models/bxml/verbs/stop_transcription.py +++ b/bandwidth/models/bxml/verbs/stop_transcription.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StopTranscription(TerminalVerb): +class StopTranscription(Verb): def __init__( self, name: str = None, diff --git a/bandwidth/models/bxml/verbs/stream_param.py b/bandwidth/models/bxml/verbs/stream_param.py index dbd4516d..2466dc21 100644 --- a/bandwidth/models/bxml/verbs/stream_param.py +++ b/bandwidth/models/bxml/verbs/stream_param.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class StreamParam(TerminalVerb): +class StreamParam(Verb): def __init__( self, name: str, value: str diff --git a/bandwidth/models/bxml/verbs/tag.py b/bandwidth/models/bxml/verbs/tag.py index d2d9b55b..0a89d18d 100644 --- a/bandwidth/models/bxml/verbs/tag.py +++ b/bandwidth/models/bxml/verbs/tag.py @@ -5,10 +5,10 @@ @copyright Bandwidth INC """ -from ..terminal_verb import TerminalVerb +from ..verb import Verb -class Tag(TerminalVerb): +class Tag(Verb): def __init__(self, content=""): """Initialize a verb diff --git a/bandwidth/models/bxml/verbs/transfer.py b/bandwidth/models/bxml/verbs/transfer.py index c9fe94e5..984ad5b5 100644 --- a/bandwidth/models/bxml/verbs/transfer.py +++ b/bandwidth/models/bxml/verbs/transfer.py @@ -7,12 +7,12 @@ """ from typing import Union, List -from ..verb import Verb +from ..nestable_verb import NestableVerb from ..verbs.phone_number import PhoneNumber from ..verbs.sip_uri import SipUri -class Transfer(Verb): +class Transfer(NestableVerb): def __init__( self, transfer_to: List[Union[PhoneNumber, SipUri]] = [], diff --git a/bandwidth/models/call_recording_metadata.py b/bandwidth/models/call_recording_metadata.py index 9f48dd6f..97a643d9 100644 --- a/bandwidth/models/call_recording_metadata.py +++ b/bandwidth/models/call_recording_metadata.py @@ -23,7 +23,7 @@ from typing import Any, ClassVar, Dict, List, Optional from bandwidth.models.call_direction_enum import CallDirectionEnum from bandwidth.models.file_format_enum import FileFormatEnum -from bandwidth.models.transcription_metadata import TranscriptionMetadata +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata from typing import Optional, Set from typing_extensions import Self @@ -37,8 +37,8 @@ class CallRecordingMetadata(BaseModel): parent_call_id: Optional[StrictStr] = Field(default=None, description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.", alias="parentCallId") recording_id: Optional[StrictStr] = Field(default=None, description="The unique ID of this recording", alias="recordingId") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") duration: Optional[StrictStr] = Field(default=None, description="The duration of the recording in ISO-8601 format") direction: Optional[CallDirectionEnum] = None @@ -48,7 +48,7 @@ class CallRecordingMetadata(BaseModel): file_format: Optional[FileFormatEnum] = Field(default=None, alias="fileFormat") status: Optional[StrictStr] = Field(default=None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") media_url: Optional[StrictStr] = Field(default=None, description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.", alias="mediaUrl") - transcription: Optional[TranscriptionMetadata] = None + transcription: Optional[RecordingTranscriptionMetadata] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["applicationId", "accountId", "callId", "parentCallId", "recordingId", "to", "from", "transferCallerId", "transferTo", "duration", "direction", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "transcription"] @@ -140,7 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "fileFormat": obj.get("fileFormat"), "status": obj.get("status"), "mediaUrl": obj.get("mediaUrl"), - "transcription": TranscriptionMetadata.from_dict(obj["transcription"]) if obj.get("transcription") is not None else None + "transcription": RecordingTranscriptionMetadata.from_dict(obj["transcription"]) if obj.get("transcription") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/call_transcription.py b/bandwidth/models/call_transcription.py new file mode 100644 index 00000000..9fc843bc --- /dev/null +++ b/bandwidth/models/call_transcription.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from bandwidth.models.call_transcription_detected_language_enum import CallTranscriptionDetectedLanguageEnum +from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum +from typing import Optional, Set +from typing_extensions import Self + +class CallTranscription(BaseModel): + """ + CallTranscription + """ # noqa: E501 + detected_language: Optional[CallTranscriptionDetectedLanguageEnum] = Field(default=None, alias="detectedLanguage") + track: Optional[CallTranscriptionTrackEnum] = None + transcript: Optional[StrictStr] = Field(default=None, description="The transcription itself.") + confidence: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="How confident the transcription engine was in transcribing the associated audio (from `0` to `1`).") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["detectedLanguage", "track", "transcript", "confidence"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CallTranscription from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallTranscription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detectedLanguage": obj.get("detectedLanguage"), + "track": obj.get("track"), + "transcript": obj.get("transcript"), + "confidence": obj.get("confidence") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/call_transcription_detected_language_enum.py b/bandwidth/models/call_transcription_detected_language_enum.py new file mode 100644 index 00000000..2d26f56b --- /dev/null +++ b/bandwidth/models/call_transcription_detected_language_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CallTranscriptionDetectedLanguageEnum(str, Enum): + """ + The detected language for this transcription. + """ + + """ + allowed enum values + """ + EN_MINUS_US = 'en-US' + ES_MINUS_US = 'es-US' + FR_MINUS_FR = 'fr-FR' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CallTranscriptionDetectedLanguageEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/call_transcription_metadata.py b/bandwidth/models/call_transcription_metadata.py new file mode 100644 index 00000000..c77980f2 --- /dev/null +++ b/bandwidth/models/call_transcription_metadata.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CallTranscriptionMetadata(BaseModel): + """ + CallTranscriptionMetadata + """ # noqa: E501 + transcription_id: Optional[StrictStr] = Field(default=None, description="The programmable voice API transcription ID.", alias="transcriptionId") + transcription_url: Optional[StrictStr] = Field(default=None, description="A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint.", alias="transcriptionUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["transcriptionId", "transcriptionUrl"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CallTranscriptionMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallTranscriptionMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transcriptionId": obj.get("transcriptionId"), + "transcriptionUrl": obj.get("transcriptionUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/call_transcription_response.py b/bandwidth/models/call_transcription_response.py new file mode 100644 index 00000000..df05441b --- /dev/null +++ b/bandwidth/models/call_transcription_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.call_transcription import CallTranscription +from typing import Optional, Set +from typing_extensions import Self + +class CallTranscriptionResponse(BaseModel): + """ + CallTranscriptionResponse + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") + call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") + transcription_id: Optional[StrictStr] = Field(default=None, description="The programmable voice API transcription ID.", alias="transcriptionId") + tracks: Optional[List[CallTranscription]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["accountId", "callId", "transcriptionId", "tracks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CallTranscriptionResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tracks (list) + _items = [] + if self.tracks: + for _item in self.tracks: + if _item: + _items.append(_item.to_dict()) + _dict['tracks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallTranscriptionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountId": obj.get("accountId"), + "callId": obj.get("callId"), + "transcriptionId": obj.get("transcriptionId"), + "tracks": [CallTranscription.from_dict(_item) for _item in obj["tracks"]] if obj.get("tracks") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/call_transcription_track_enum.py b/bandwidth/models/call_transcription_track_enum.py new file mode 100644 index 00000000..412c2214 --- /dev/null +++ b/bandwidth/models/call_transcription_track_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CallTranscriptionTrackEnum(str, Enum): + """ + Which `track` this transcription is derived from. + """ + + """ + allowed enum values + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CallTranscriptionTrackEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/conference.py b/bandwidth/models/conference.py index 39e18753..b361ec6e 100644 --- a/bandwidth/models/conference.py +++ b/bandwidth/models/conference.py @@ -35,7 +35,7 @@ class Conference(BaseModel): created_time: Optional[datetime] = Field(default=None, description="The time the conference was initiated, in ISO 8601 format.", alias="createdTime") completed_time: Optional[datetime] = Field(default=None, description="The time the conference was terminated, in ISO 8601 format.", alias="completedTime") conference_event_url: Optional[StrictStr] = Field(default=None, description="The URL to send the conference-related events.", alias="conferenceEventUrl") - conference_event_method: Optional[CallbackMethodEnum] = Field(default=None, alias="conferenceEventMethod") + conference_event_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="conferenceEventMethod") tag: Optional[StrictStr] = Field(default=None, description="The custom string attached to the conference that will be sent with callbacks.") active_members: Optional[List[ConferenceMember]] = Field(default=None, description="A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences).", alias="activeMembers") additional_properties: Dict[str, Any] = {} @@ -136,7 +136,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "createdTime": obj.get("createdTime"), "completedTime": obj.get("completedTime"), "conferenceEventUrl": obj.get("conferenceEventUrl"), - "conferenceEventMethod": obj.get("conferenceEventMethod"), + "conferenceEventMethod": obj.get("conferenceEventMethod") if obj.get("conferenceEventMethod") is not None else CallbackMethodEnum.POST, "tag": obj.get("tag"), "activeMembers": [ConferenceMember.from_dict(_item) for _item in obj["activeMembers"]] if obj.get("activeMembers") is not None else None }) diff --git a/bandwidth/models/conference_member_exit_callback.py b/bandwidth/models/conference_member_exit_callback.py index 663b3a00..61342408 100644 --- a/bandwidth/models/conference_member_exit_callback.py +++ b/bandwidth/models/conference_member_exit_callback.py @@ -32,7 +32,7 @@ class ConferenceMemberExitCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") conference_id: Optional[StrictStr] = Field(default=None, description="The unique, Bandwidth-generated ID of the conference that was recorded", alias="conferenceId") name: Optional[StrictStr] = Field(default=None, description="The user-specified name of the conference that was recorded") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") diff --git a/bandwidth/models/conference_member_join_callback.py b/bandwidth/models/conference_member_join_callback.py index 88b3fb49..4daa4715 100644 --- a/bandwidth/models/conference_member_join_callback.py +++ b/bandwidth/models/conference_member_join_callback.py @@ -32,7 +32,7 @@ class ConferenceMemberJoinCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") conference_id: Optional[StrictStr] = Field(default=None, description="The unique, Bandwidth-generated ID of the conference that was recorded", alias="conferenceId") name: Optional[StrictStr] = Field(default=None, description="The user-specified name of the conference that was recorded") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") diff --git a/bandwidth/models/create_call.py b/bandwidth/models/create_call.py index 723042ef..e1fedd09 100644 --- a/bandwidth/models/create_call.py +++ b/bandwidth/models/create_call.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated from bandwidth.models.callback_method_enum import CallbackMethodEnum @@ -31,27 +31,28 @@ class CreateCall(BaseModel): CreateCall """ # noqa: E501 to: StrictStr = Field(description="The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).") - var_from: StrictStr = Field(description="A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`).", alias="from") - display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines.", alias="displayName") + var_from: StrictStr = Field(description="A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true.", alias="from") + privacy: Optional[StrictBool] = Field(default=None, description="Hide the calling number. The `displayName` field can be used to customize the displayed name.") + display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.", alias="displayName") uui: Optional[StrictStr] = Field(default=None, description="A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.") application_id: StrictStr = Field(description="The id of the application associated with the `from` number.", alias="applicationId") answer_url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password`.", alias="answerUrl") - answer_method: Optional[CallbackMethodEnum] = Field(default=None, alias="answerMethod") + answer_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="answerMethod") username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.") password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.") answer_fallback_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`.", alias="answerFallbackUrl") - answer_fallback_method: Optional[CallbackMethodEnum] = Field(default=None, alias="answerFallbackMethod") + answer_fallback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="answerFallbackMethod") fallback_username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.", alias="fallbackUsername") fallback_password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.", alias="fallbackPassword") disconnect_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.", alias="disconnectUrl") - disconnect_method: Optional[CallbackMethodEnum] = Field(default=None, alias="disconnectMethod") + disconnect_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="disconnectMethod") call_timeout: Optional[Union[Annotated[float, Field(le=300, strict=True, ge=1)], Annotated[int, Field(le=300, strict=True, ge=1)]]] = Field(default=30, description="The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300.", alias="callTimeout") callback_timeout: Optional[Union[Annotated[float, Field(le=25, strict=True, ge=1)], Annotated[int, Field(le=25, strict=True, ge=1)]]] = Field(default=15, description="This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.", alias="callbackTimeout") machine_detection: Optional[MachineDetectionConfiguration] = Field(default=None, alias="machineDetection") priority: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=5, description="The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.") tag: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["to", "from", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag"] + __properties: ClassVar[List[str]] = ["to", "from", "privacy", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag"] model_config = ConfigDict( populate_by_name=True, @@ -102,6 +103,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if privacy (nullable) is None + # and model_fields_set contains the field + if self.privacy is None and "privacy" in self.model_fields_set: + _dict['privacy'] = None + # set to None if display_name (nullable) is None # and model_fields_set contains the field if self.display_name is None and "display_name" in self.model_fields_set: @@ -191,19 +197,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "to": obj.get("to"), "from": obj.get("from"), + "privacy": obj.get("privacy"), "displayName": obj.get("displayName"), "uui": obj.get("uui"), "applicationId": obj.get("applicationId"), "answerUrl": obj.get("answerUrl"), - "answerMethod": obj.get("answerMethod"), + "answerMethod": obj.get("answerMethod") if obj.get("answerMethod") is not None else CallbackMethodEnum.POST, "username": obj.get("username"), "password": obj.get("password"), "answerFallbackUrl": obj.get("answerFallbackUrl"), - "answerFallbackMethod": obj.get("answerFallbackMethod"), + "answerFallbackMethod": obj.get("answerFallbackMethod") if obj.get("answerFallbackMethod") is not None else CallbackMethodEnum.POST, "fallbackUsername": obj.get("fallbackUsername"), "fallbackPassword": obj.get("fallbackPassword"), "disconnectUrl": obj.get("disconnectUrl"), - "disconnectMethod": obj.get("disconnectMethod"), + "disconnectMethod": obj.get("disconnectMethod") if obj.get("disconnectMethod") is not None else CallbackMethodEnum.POST, "callTimeout": obj.get("callTimeout") if obj.get("callTimeout") is not None else 30, "callbackTimeout": obj.get("callbackTimeout") if obj.get("callbackTimeout") is not None else 15, "machineDetection": MachineDetectionConfiguration.from_dict(obj["machineDetection"]) if obj.get("machineDetection") is not None else None, diff --git a/bandwidth/models/create_call_response.py b/bandwidth/models/create_call_response.py index 5af22d43..82b56b1c 100644 --- a/bandwidth/models/create_call_response.py +++ b/bandwidth/models/create_call_response.py @@ -42,7 +42,7 @@ class CreateCallResponse(BaseModel): tag: Optional[StrictStr] = Field(default=None, description="Custom tag value.") answer_method: Optional[CallbackMethodEnum] = Field(alias="answerMethod") answer_url: StrictStr = Field(description="URL to deliver the `answer` event webhook.", alias="answerUrl") - answer_fallback_method: Optional[CallbackMethodEnum] = Field(default=None, alias="answerFallbackMethod") + answer_fallback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="answerFallbackMethod") answer_fallback_url: Optional[StrictStr] = Field(default=None, description="Fallback URL to deliver the `answer` event webhook.", alias="answerFallbackUrl") disconnect_method: Optional[CallbackMethodEnum] = Field(alias="disconnectMethod") disconnect_url: Optional[StrictStr] = Field(default=None, description="URL to deliver the `disconnect` event webhook.", alias="disconnectUrl") @@ -182,11 +182,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "callTimeout": obj.get("callTimeout"), "callbackTimeout": obj.get("callbackTimeout"), "tag": obj.get("tag"), - "answerMethod": obj.get("answerMethod"), + "answerMethod": obj.get("answerMethod") if obj.get("answerMethod") is not None else CallbackMethodEnum.POST, "answerUrl": obj.get("answerUrl"), - "answerFallbackMethod": obj.get("answerFallbackMethod"), + "answerFallbackMethod": obj.get("answerFallbackMethod") if obj.get("answerFallbackMethod") is not None else CallbackMethodEnum.POST, "answerFallbackUrl": obj.get("answerFallbackUrl"), - "disconnectMethod": obj.get("disconnectMethod"), + "disconnectMethod": obj.get("disconnectMethod") if obj.get("disconnectMethod") is not None else CallbackMethodEnum.POST, "disconnectUrl": obj.get("disconnectUrl"), "username": obj.get("username"), "password": obj.get("password"), diff --git a/bandwidth/models/disconnect_callback.py b/bandwidth/models/disconnect_callback.py index 31c1f304..1a2103ce 100644 --- a/bandwidth/models/disconnect_callback.py +++ b/bandwidth/models/disconnect_callback.py @@ -33,7 +33,7 @@ class DisconnectCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") direction: Optional[CallDirectionEnum] = None diff --git a/bandwidth/models/dtmf_callback.py b/bandwidth/models/dtmf_callback.py index 109cd139..807b0074 100644 --- a/bandwidth/models/dtmf_callback.py +++ b/bandwidth/models/dtmf_callback.py @@ -33,7 +33,7 @@ class DtmfCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") direction: Optional[CallDirectionEnum] = None @@ -43,7 +43,7 @@ class DtmfCallback(BaseModel): start_time: Optional[datetime] = Field(default=None, description="Time the call was started, in ISO 8601 format.", alias="startTime") answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") parent_call_id: Optional[StrictStr] = Field(default=None, description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.", alias="parentCallId") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") additional_properties: Dict[str, Any] = {} diff --git a/bandwidth/models/gather_callback.py b/bandwidth/models/gather_callback.py index cf859d0c..2512429d 100644 --- a/bandwidth/models/gather_callback.py +++ b/bandwidth/models/gather_callback.py @@ -33,7 +33,7 @@ class GatherCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -44,7 +44,7 @@ class GatherCallback(BaseModel): answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") parent_call_id: Optional[StrictStr] = Field(default=None, description="(optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.", alias="parentCallId") terminating_digit: Optional[StrictStr] = Field(default=None, description="(optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.", alias="terminatingDigit") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") additional_properties: Dict[str, Any] = {} diff --git a/bandwidth/models/initiate_callback.py b/bandwidth/models/initiate_callback.py index 42adb30e..78e46977 100644 --- a/bandwidth/models/initiate_callback.py +++ b/bandwidth/models/initiate_callback.py @@ -35,7 +35,7 @@ class InitiateCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") diff --git a/bandwidth/models/machine_detection_complete_callback.py b/bandwidth/models/machine_detection_complete_callback.py index 4d3f9d38..55e8bfed 100644 --- a/bandwidth/models/machine_detection_complete_callback.py +++ b/bandwidth/models/machine_detection_complete_callback.py @@ -34,7 +34,7 @@ class MachineDetectionCompleteCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") diff --git a/bandwidth/models/machine_detection_configuration.py b/bandwidth/models/machine_detection_configuration.py index 858c4107..befeedd4 100644 --- a/bandwidth/models/machine_detection_configuration.py +++ b/bandwidth/models/machine_detection_configuration.py @@ -28,9 +28,9 @@ class MachineDetectionConfiguration(BaseModel): """ - The machine detection request used to perform machine detection on the call. + The machine detection request used to perform machine detection on the call. Currently, there is an issue where decimal values are not getting processed correctly. Please use whole number values. We are working to resolve this issue. Please contact Bandwidth Support if you need more information. """ # noqa: E501 - mode: Optional[MachineDetectionModeEnum] = None + mode: Optional[MachineDetectionModeEnum] = MachineDetectionModeEnum.ASYNC detection_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(default=15, description="The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent.", alias="detectionTimeout") silence_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="If no speech is detected in this period, a callback with a 'silence' result is sent.", alias="silenceTimeout") speech_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.", alias="speechThreshold") @@ -38,11 +38,11 @@ class MachineDetectionConfiguration(BaseModel): machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.", alias="machineSpeechEndThreshold") delay_result: Optional[StrictBool] = Field(default=False, description="If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.", alias="delayResult") callback_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.", alias="callbackUrl") - callback_method: Optional[CallbackMethodEnum] = Field(default=None, alias="callbackMethod") + callback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="callbackMethod") username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.") password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.") fallback_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond", alias="fallbackUrl") - fallback_method: Optional[CallbackMethodEnum] = Field(default=None, alias="fallbackMethod") + fallback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="fallbackMethod") fallback_username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.", alias="fallbackUsername") fallback_password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.", alias="fallbackPassword") additional_properties: Dict[str, Any] = {} @@ -176,7 +176,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "mode": obj.get("mode"), + "mode": obj.get("mode") if obj.get("mode") is not None else MachineDetectionModeEnum.ASYNC, "detectionTimeout": obj.get("detectionTimeout") if obj.get("detectionTimeout") is not None else 15, "silenceTimeout": obj.get("silenceTimeout") if obj.get("silenceTimeout") is not None else 10, "speechThreshold": obj.get("speechThreshold") if obj.get("speechThreshold") is not None else 10, @@ -184,11 +184,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "machineSpeechEndThreshold": obj.get("machineSpeechEndThreshold"), "delayResult": obj.get("delayResult") if obj.get("delayResult") is not None else False, "callbackUrl": obj.get("callbackUrl"), - "callbackMethod": obj.get("callbackMethod"), + "callbackMethod": obj.get("callbackMethod") if obj.get("callbackMethod") is not None else CallbackMethodEnum.POST, "username": obj.get("username"), "password": obj.get("password"), "fallbackUrl": obj.get("fallbackUrl"), - "fallbackMethod": obj.get("fallbackMethod"), + "fallbackMethod": obj.get("fallbackMethod") if obj.get("fallbackMethod") is not None else CallbackMethodEnum.POST, "fallbackUsername": obj.get("fallbackUsername"), "fallbackPassword": obj.get("fallbackPassword") }) diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index f1dea4cf..c323adeb 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -32,7 +32,7 @@ class MessageRequest(BaseModel): """ # noqa: E501 application_id: StrictStr = Field(description="The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") to: List[StrictStr] = Field(description="The phone number(s) the message should be sent to in E164 format.") - var_from: StrictStr = Field(description="One of your telephone numbers the message should come from in E164 format.", alias="from") + var_from: StrictStr = Field(description="Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.", alias="from") text: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The contents of the text message. Must be 2048 characters or less.") media: Optional[List[Annotated[str, Field(strict=True, max_length=4096)]]] = Field(default=None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.") tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") diff --git a/bandwidth/models/recording_available_callback.py b/bandwidth/models/recording_available_callback.py index 6995f230..ba57a24f 100644 --- a/bandwidth/models/recording_available_callback.py +++ b/bandwidth/models/recording_available_callback.py @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from bandwidth.models.call_direction_enum import CallDirectionEnum from bandwidth.models.file_format_enum import FileFormatEnum @@ -34,7 +34,7 @@ class RecordingAvailableCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -47,10 +47,10 @@ class RecordingAvailableCallback(BaseModel): end_time: Optional[datetime] = Field(default=None, description="The time that the recording ended in ISO-8601 format", alias="endTime") duration: Optional[StrictStr] = Field(default=None, description="The duration of the recording in ISO-8601 format") file_format: Optional[FileFormatEnum] = Field(default=None, alias="fileFormat") - channels: Optional[StrictStr] = Field(default=None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") + channels: Optional[StrictInt] = Field(default=None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") status: Optional[StrictStr] = Field(default=None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "channels", "tag", "status", "transferCallerId", "transferTo"] diff --git a/bandwidth/models/recording_complete_callback.py b/bandwidth/models/recording_complete_callback.py index 621b2d07..075f3d73 100644 --- a/bandwidth/models/recording_complete_callback.py +++ b/bandwidth/models/recording_complete_callback.py @@ -34,7 +34,7 @@ class RecordingCompleteCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -50,7 +50,7 @@ class RecordingCompleteCallback(BaseModel): file_format: Optional[FileFormatEnum] = Field(default=None, alias="fileFormat") channels: Optional[StrictInt] = Field(default=None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "duration", "fileFormat", "channels", "tag", "transferCallerId", "transferTo"] diff --git a/bandwidth/models/transcription_metadata.py b/bandwidth/models/recording_transcription_metadata.py similarity index 90% rename from bandwidth/models/transcription_metadata.py rename to bandwidth/models/recording_transcription_metadata.py index 07e67d01..5360cc04 100644 --- a/bandwidth/models/transcription_metadata.py +++ b/bandwidth/models/recording_transcription_metadata.py @@ -18,18 +18,19 @@ import re # noqa: F401 import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class TranscriptionMetadata(BaseModel): +class RecordingTranscriptionMetadata(BaseModel): """ If the recording was transcribed, metadata about the transcription """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="The unique transcription ID") status: Optional[StrictStr] = Field(default=None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.") - completed_time: Optional[StrictStr] = Field(default=None, description="The time that the transcription was completed", alias="completedTime") + completed_time: Optional[datetime] = Field(default=None, description="The time that the transcription was completed", alias="completedTime") url: Optional[StrictStr] = Field(default=None, description="The URL of the [transcription](#operation/getCallTranscription)") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "status", "completedTime", "url"] @@ -52,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TranscriptionMetadata from a JSON string""" + """Create an instance of RecordingTranscriptionMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TranscriptionMetadata from a dict""" + """Create an instance of RecordingTranscriptionMetadata from a dict""" if obj is None: return None diff --git a/bandwidth/models/recording_transcriptions.py b/bandwidth/models/recording_transcriptions.py new file mode 100644 index 00000000..6845cd9b --- /dev/null +++ b/bandwidth/models/recording_transcriptions.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.transcription import Transcription +from typing import Optional, Set +from typing_extensions import Self + +class RecordingTranscriptions(BaseModel): + """ + RecordingTranscriptions + """ # noqa: E501 + transcripts: Optional[List[Transcription]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["transcripts"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RecordingTranscriptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in transcripts (list) + _items = [] + if self.transcripts: + for _item in self.transcripts: + if _item: + _items.append(_item.to_dict()) + _dict['transcripts'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecordingTranscriptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transcripts": [Transcription.from_dict(_item) for _item in obj["transcripts"]] if obj.get("transcripts") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/redirect_callback.py b/bandwidth/models/redirect_callback.py index 7ef6fe05..90f78704 100644 --- a/bandwidth/models/redirect_callback.py +++ b/bandwidth/models/redirect_callback.py @@ -33,7 +33,7 @@ class RedirectCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -43,7 +43,7 @@ class RedirectCallback(BaseModel): start_time: Optional[datetime] = Field(default=None, description="Time the call was started, in ISO 8601 format.", alias="startTime") answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"] diff --git a/bandwidth/models/transcribe_recording.py b/bandwidth/models/transcribe_recording.py index 93abf2a7..14908994 100644 --- a/bandwidth/models/transcribe_recording.py +++ b/bandwidth/models/transcribe_recording.py @@ -30,7 +30,7 @@ class TranscribeRecording(BaseModel): TranscribeRecording """ # noqa: E501 callback_url: Optional[StrictStr] = Field(default=None, description="The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization.", alias="callbackUrl") - callback_method: Optional[CallbackMethodEnum] = Field(default=None, alias="callbackMethod") + callback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="callbackMethod") username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.") password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") @@ -128,7 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "callbackUrl": obj.get("callbackUrl"), - "callbackMethod": obj.get("callbackMethod"), + "callbackMethod": obj.get("callbackMethod") if obj.get("callbackMethod") is not None else CallbackMethodEnum.POST, "username": obj.get("username"), "password": obj.get("password"), "tag": obj.get("tag"), diff --git a/bandwidth/models/transcription_available_callback.py b/bandwidth/models/transcription_available_callback.py index 355766da..3cf49a95 100644 --- a/bandwidth/models/transcription_available_callback.py +++ b/bandwidth/models/transcription_available_callback.py @@ -35,7 +35,7 @@ class TranscriptionAvailableCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -50,7 +50,7 @@ class TranscriptionAvailableCallback(BaseModel): file_format: Optional[FileFormatEnum] = Field(default=None, alias="fileFormat") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") transcription: Optional[Transcription] = None - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "mediaUrl", "parentCallId", "recordingId", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "tag", "transcription", "transferCallerId", "transferTo"] diff --git a/bandwidth/models/transfer_answer_callback.py b/bandwidth/models/transfer_answer_callback.py index fb44e3b0..343c677b 100644 --- a/bandwidth/models/transfer_answer_callback.py +++ b/bandwidth/models/transfer_answer_callback.py @@ -33,7 +33,7 @@ class TransferAnswerCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -42,7 +42,7 @@ class TransferAnswerCallback(BaseModel): start_time: Optional[datetime] = Field(default=None, description="Time the call was started, in ISO 8601 format.", alias="startTime") answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"] diff --git a/bandwidth/models/transfer_complete_callback.py b/bandwidth/models/transfer_complete_callback.py index 4fa91708..8118d8b9 100644 --- a/bandwidth/models/transfer_complete_callback.py +++ b/bandwidth/models/transfer_complete_callback.py @@ -33,7 +33,7 @@ class TransferCompleteCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -42,7 +42,7 @@ class TransferCompleteCallback(BaseModel): start_time: Optional[datetime] = Field(default=None, description="Time the call was started, in ISO 8601 format.", alias="startTime") answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") cause: Optional[StrictStr] = Field(default=None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") error_message: Optional[StrictStr] = Field(default=None, description="Text explaining the reason that caused the call to fail in case of errors.", alias="errorMessage") diff --git a/bandwidth/models/transfer_disconnect_callback.py b/bandwidth/models/transfer_disconnect_callback.py index 51c22b93..5a215357 100644 --- a/bandwidth/models/transfer_disconnect_callback.py +++ b/bandwidth/models/transfer_disconnect_callback.py @@ -33,7 +33,7 @@ class TransferDisconnectCallback(BaseModel): event_time: Optional[datetime] = Field(default=None, description="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.", alias="eventTime") account_id: Optional[StrictStr] = Field(default=None, description="The user account associated with the call.", alias="accountId") application_id: Optional[StrictStr] = Field(default=None, description="The id of the application associated with the call.", alias="applicationId") - var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.", alias="from") + var_from: Optional[StrictStr] = Field(default=None, description="The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).", alias="from") to: Optional[StrictStr] = Field(default=None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).") direction: Optional[CallDirectionEnum] = None call_id: Optional[StrictStr] = Field(default=None, description="The call id associated with the event.", alias="callId") @@ -44,7 +44,7 @@ class TransferDisconnectCallback(BaseModel): answer_time: Optional[datetime] = Field(default=None, description="Time the call was answered, in ISO 8601 format.", alias="answerTime") end_time: Optional[datetime] = Field(default=None, description="The time that the recording ended in ISO-8601 format", alias="endTime") tag: Optional[StrictStr] = Field(default=None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.") - transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.", alias="transferCallerId") + transfer_caller_id: Optional[StrictStr] = Field(default=None, description="The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferCallerId") transfer_to: Optional[StrictStr] = Field(default=None, description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).", alias="transferTo") cause: Optional[StrictStr] = Field(default=None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.") error_message: Optional[StrictStr] = Field(default=None, description="Text explaining the reason that caused the call to fail in case of errors.", alias="errorMessage") diff --git a/bandwidth/models/update_call.py b/bandwidth/models/update_call.py index 3840c925..2f17bfef 100644 --- a/bandwidth/models/update_call.py +++ b/bandwidth/models/update_call.py @@ -30,13 +30,13 @@ class UpdateCall(BaseModel): """ UpdateCall """ # noqa: E501 - state: Optional[CallStateEnum] = None + state: Optional[CallStateEnum] = CallStateEnum.ACTIVE redirect_url: Optional[StrictStr] = Field(default=None, description="The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`.", alias="redirectUrl") - redirect_method: Optional[RedirectMethodEnum] = Field(default=None, alias="redirectMethod") + redirect_method: Optional[RedirectMethodEnum] = Field(default=RedirectMethodEnum.POST, alias="redirectMethod") username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.") password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.") redirect_fallback_url: Optional[StrictStr] = Field(default=None, description="A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond.", alias="redirectFallbackUrl") - redirect_fallback_method: Optional[RedirectMethodEnum] = Field(default=None, alias="redirectFallbackMethod") + redirect_fallback_method: Optional[RedirectMethodEnum] = Field(default=RedirectMethodEnum.POST, alias="redirectFallbackMethod") fallback_username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.", alias="fallbackUsername") fallback_password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.", alias="fallbackPassword") tag: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.") @@ -151,13 +151,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "state": obj.get("state"), + "state": obj.get("state") if obj.get("state") is not None else CallStateEnum.ACTIVE, "redirectUrl": obj.get("redirectUrl"), - "redirectMethod": obj.get("redirectMethod"), + "redirectMethod": obj.get("redirectMethod") if obj.get("redirectMethod") is not None else RedirectMethodEnum.POST, "username": obj.get("username"), "password": obj.get("password"), "redirectFallbackUrl": obj.get("redirectFallbackUrl"), - "redirectFallbackMethod": obj.get("redirectFallbackMethod"), + "redirectFallbackMethod": obj.get("redirectFallbackMethod") if obj.get("redirectFallbackMethod") is not None else RedirectMethodEnum.POST, "fallbackUsername": obj.get("fallbackUsername"), "fallbackPassword": obj.get("fallbackPassword"), "tag": obj.get("tag") diff --git a/bandwidth/models/update_conference.py b/bandwidth/models/update_conference.py index 997b1651..c87e5de2 100644 --- a/bandwidth/models/update_conference.py +++ b/bandwidth/models/update_conference.py @@ -30,13 +30,13 @@ class UpdateConference(BaseModel): """ UpdateConference """ # noqa: E501 - status: Optional[ConferenceStateEnum] = None + status: Optional[ConferenceStateEnum] = ConferenceStateEnum.ACTIVE redirect_url: Optional[StrictStr] = Field(default=None, description="The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`.", alias="redirectUrl") - redirect_method: Optional[RedirectMethodEnum] = Field(default=None, alias="redirectMethod") + redirect_method: Optional[RedirectMethodEnum] = Field(default=RedirectMethodEnum.POST, alias="redirectMethod") username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.") password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.") redirect_fallback_url: Optional[StrictStr] = Field(default=None, description="A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`.", alias="redirectFallbackUrl") - redirect_fallback_method: Optional[RedirectMethodEnum] = Field(default=None, alias="redirectFallbackMethod") + redirect_fallback_method: Optional[RedirectMethodEnum] = Field(default=RedirectMethodEnum.POST, alias="redirectFallbackMethod") fallback_username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.", alias="fallbackUsername") fallback_password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.", alias="fallbackPassword") additional_properties: Dict[str, Any] = {} @@ -145,13 +145,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "status": obj.get("status"), + "status": obj.get("status") if obj.get("status") is not None else ConferenceStateEnum.ACTIVE, "redirectUrl": obj.get("redirectUrl"), - "redirectMethod": obj.get("redirectMethod"), + "redirectMethod": obj.get("redirectMethod") if obj.get("redirectMethod") is not None else RedirectMethodEnum.POST, "username": obj.get("username"), "password": obj.get("password"), "redirectFallbackUrl": obj.get("redirectFallbackUrl"), - "redirectFallbackMethod": obj.get("redirectFallbackMethod"), + "redirectFallbackMethod": obj.get("redirectFallbackMethod") if obj.get("redirectFallbackMethod") is not None else RedirectMethodEnum.POST, "fallbackUsername": obj.get("fallbackUsername"), "fallbackPassword": obj.get("fallbackPassword") }) diff --git a/bandwidth/rest.py b/bandwidth/rest.py index 579b9918..c8582dad 100644 --- a/bandwidth/rest.py +++ b/bandwidth/rest.py @@ -203,6 +203,8 @@ def request( # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( method, url, diff --git a/docs/AccountStatistics.md b/docs/AccountStatistics.md index 1a62bb96..95f1f638 100644 --- a/docs/AccountStatistics.md +++ b/docs/AccountStatistics.md @@ -23,7 +23,7 @@ print(AccountStatistics.to_json()) # convert the object into a dict account_statistics_dict = account_statistics_instance.to_dict() # create an instance of AccountStatistics from a dict -account_statistics_form_dict = account_statistics.from_dict(account_statistics_dict) +account_statistics_from_dict = AccountStatistics.from_dict(account_statistics_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md index 3d334c1e..7b872670 100644 --- a/docs/AnswerCallback.md +++ b/docs/AnswerCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -36,7 +36,7 @@ print(AnswerCallback.to_json()) # convert the object into a dict answer_callback_dict = answer_callback_instance.to_dict() # create an instance of AnswerCallback from a dict -answer_callback_form_dict = answer_callback.from_dict(answer_callback_dict) +answer_callback_from_dict = AnswerCallback.from_dict(answer_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md index 18cdfce3..aa5b3fec 100644 --- a/docs/BridgeCompleteCallback.md +++ b/docs/BridgeCompleteCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -38,7 +38,7 @@ print(BridgeCompleteCallback.to_json()) # convert the object into a dict bridge_complete_callback_dict = bridge_complete_callback_instance.to_dict() # create an instance of BridgeCompleteCallback from a dict -bridge_complete_callback_form_dict = bridge_complete_callback.from_dict(bridge_complete_callback_dict) +bridge_complete_callback_from_dict = BridgeCompleteCallback.from_dict(bridge_complete_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md index 177192d0..729820c1 100644 --- a/docs/BridgeTargetCompleteCallback.md +++ b/docs/BridgeTargetCompleteCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -35,7 +35,7 @@ print(BridgeTargetCompleteCallback.to_json()) # convert the object into a dict bridge_target_complete_callback_dict = bridge_target_complete_callback_instance.to_dict() # create an instance of BridgeTargetCompleteCallback from a dict -bridge_target_complete_callback_form_dict = bridge_target_complete_callback.from_dict(bridge_target_complete_callback_dict) +bridge_target_complete_callback_from_dict = BridgeTargetCompleteCallback.from_dict(bridge_target_complete_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallDirectionEnum.md b/docs/CallDirectionEnum.md index a750b7c4..63dd13a2 100644 --- a/docs/CallDirectionEnum.md +++ b/docs/CallDirectionEnum.md @@ -2,10 +2,11 @@ The direction of the call. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `INBOUND` (value: `'inbound'`) + +* `OUTBOUND` (value: `'outbound'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md index 47fed570..19e1039d 100644 --- a/docs/CallRecordingMetadata.md +++ b/docs/CallRecordingMetadata.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **recording_id** | **str** | The unique ID of this recording | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] @@ -22,7 +22,7 @@ Name | Type | Description | Notes **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] **media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] -**transcription** | [**TranscriptionMetadata**](TranscriptionMetadata.md) | | [optional] +**transcription** | [**RecordingTranscriptionMetadata**](RecordingTranscriptionMetadata.md) | | [optional] ## Example @@ -39,7 +39,7 @@ print(CallRecordingMetadata.to_json()) # convert the object into a dict call_recording_metadata_dict = call_recording_metadata_instance.to_dict() # create an instance of CallRecordingMetadata from a dict -call_recording_metadata_form_dict = call_recording_metadata.from_dict(call_recording_metadata_dict) +call_recording_metadata_from_dict = CallRecordingMetadata.from_dict(call_recording_metadata_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallState.md b/docs/CallState.md index 9391139b..07354920 100644 --- a/docs/CallState.md +++ b/docs/CallState.md @@ -39,7 +39,7 @@ print(CallState.to_json()) # convert the object into a dict call_state_dict = call_state_instance.to_dict() # create an instance of CallState from a dict -call_state_form_dict = call_state.from_dict(call_state_dict) +call_state_from_dict = CallState.from_dict(call_state_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallStateEnum.md b/docs/CallStateEnum.md index 9c3cf4d9..689330a4 100644 --- a/docs/CallStateEnum.md +++ b/docs/CallStateEnum.md @@ -2,10 +2,11 @@ The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ACTIVE` (value: `'active'`) + +* `COMPLETED` (value: `'completed'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallTranscription.md b/docs/CallTranscription.md new file mode 100644 index 00000000..422ae790 --- /dev/null +++ b/docs/CallTranscription.md @@ -0,0 +1,32 @@ +# CallTranscription + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**detected_language** | [**CallTranscriptionDetectedLanguageEnum**](CallTranscriptionDetectedLanguageEnum.md) | | [optional] +**track** | [**CallTranscriptionTrackEnum**](CallTranscriptionTrackEnum.md) | | [optional] +**transcript** | **str** | The transcription itself. | [optional] +**confidence** | **float** | How confident the transcription engine was in transcribing the associated audio (from `0` to `1`). | [optional] + +## Example + +```python +from bandwidth.models.call_transcription import CallTranscription + +# TODO update the JSON string below +json = "{}" +# create an instance of CallTranscription from a JSON string +call_transcription_instance = CallTranscription.from_json(json) +# print the JSON string representation of the object +print(CallTranscription.to_json()) + +# convert the object into a dict +call_transcription_dict = call_transcription_instance.to_dict() +# create an instance of CallTranscription from a dict +call_transcription_from_dict = CallTranscription.from_dict(call_transcription_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallTranscriptionDetectedLanguageEnum.md b/docs/CallTranscriptionDetectedLanguageEnum.md new file mode 100644 index 00000000..aaf60e68 --- /dev/null +++ b/docs/CallTranscriptionDetectedLanguageEnum.md @@ -0,0 +1,15 @@ +# CallTranscriptionDetectedLanguageEnum + +The detected language for this transcription. + +## Enum + +* `EN_MINUS_US` (value: `'en-US'`) + +* `ES_MINUS_US` (value: `'es-US'`) + +* `FR_MINUS_FR` (value: `'fr-FR'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallTranscriptionMetadata.md b/docs/CallTranscriptionMetadata.md new file mode 100644 index 00000000..8d555177 --- /dev/null +++ b/docs/CallTranscriptionMetadata.md @@ -0,0 +1,30 @@ +# CallTranscriptionMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transcription_id** | **str** | The programmable voice API transcription ID. | [optional] +**transcription_url** | **str** | A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint. | [optional] + +## Example + +```python +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of CallTranscriptionMetadata from a JSON string +call_transcription_metadata_instance = CallTranscriptionMetadata.from_json(json) +# print the JSON string representation of the object +print(CallTranscriptionMetadata.to_json()) + +# convert the object into a dict +call_transcription_metadata_dict = call_transcription_metadata_instance.to_dict() +# create an instance of CallTranscriptionMetadata from a dict +call_transcription_metadata_from_dict = CallTranscriptionMetadata.from_dict(call_transcription_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallTranscriptionResponse.md b/docs/CallTranscriptionResponse.md new file mode 100644 index 00000000..43348e3b --- /dev/null +++ b/docs/CallTranscriptionResponse.md @@ -0,0 +1,32 @@ +# CallTranscriptionResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | The user account associated with the call. | [optional] +**call_id** | **str** | The call id associated with the event. | [optional] +**transcription_id** | **str** | The programmable voice API transcription ID. | [optional] +**tracks** | [**List[CallTranscription]**](CallTranscription.md) | | [optional] + +## Example + +```python +from bandwidth.models.call_transcription_response import CallTranscriptionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CallTranscriptionResponse from a JSON string +call_transcription_response_instance = CallTranscriptionResponse.from_json(json) +# print the JSON string representation of the object +print(CallTranscriptionResponse.to_json()) + +# convert the object into a dict +call_transcription_response_dict = call_transcription_response_instance.to_dict() +# create an instance of CallTranscriptionResponse from a dict +call_transcription_response_from_dict = CallTranscriptionResponse.from_dict(call_transcription_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallTranscriptionTrackEnum.md b/docs/CallTranscriptionTrackEnum.md new file mode 100644 index 00000000..9ff3f95b --- /dev/null +++ b/docs/CallTranscriptionTrackEnum.md @@ -0,0 +1,13 @@ +# CallTranscriptionTrackEnum + +Which `track` this transcription is derived from. + +## Enum + +* `INBOUND` (value: `'inbound'`) + +* `OUTBOUND` (value: `'outbound'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CallbackMethodEnum.md b/docs/CallbackMethodEnum.md index 36c9cb03..b58dc9be 100644 --- a/docs/CallbackMethodEnum.md +++ b/docs/CallbackMethodEnum.md @@ -2,10 +2,11 @@ The HTTP method to use to deliver the callback. GET or POST. Default value is POST. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `GET` (value: `'GET'`) + +* `POST` (value: `'POST'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CallsApi.md b/docs/CallsApi.md index e2db39f2..c4e23a13 100644 --- a/docs/CallsApi.md +++ b/docs/CallsApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_call**](CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call [**get_call_state**](CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information +[**list_calls**](CallsApi.md#list_calls) | **GET** /accounts/{accountId}/calls | Get Calls [**update_call**](CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call [**update_call_bxml**](CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML @@ -189,6 +190,107 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_calls** +> List[CallState] list_calls(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time, disconnect_cause=disconnect_cause, page_size=page_size, page_token=page_token) + +Get Calls + +Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of calls in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of call records. Also, call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an empty array [] in response. + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.models.call_state import CallState +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.CallsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + to = '%2b19195551234' # str | Filter results by the `to` field. (optional) + var_from = '%2b19195554321' # str | Filter results by the `from` field. (optional) + min_start_time = '2022-06-21T19:13:21Z' # str | Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional) + max_start_time = '2022-06-21T19:13:21Z' # str | Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). (optional) + disconnect_cause = 'hangup' # str | Filter results to calls with specified call Disconnect Cause. (optional) + page_size = 1000 # int | Specifies the max number of calls that will be returned. (optional) (default to 1000) + page_token = 'page_token_example' # str | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional) + + try: + # Get Calls + api_response = api_instance.list_calls(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time, disconnect_cause=disconnect_cause, page_size=page_size, page_token=page_token) + print("The response of CallsApi->list_calls:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CallsApi->list_calls: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **to** | **str**| Filter results by the `to` field. | [optional] + **var_from** | **str**| Filter results by the `from` field. | [optional] + **min_start_time** | **str**| Filter results to calls which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] + **max_start_time** | **str**| Filter results to calls which have a `startTime` before or including `maxStartTime` (in ISO8601 format). | [optional] + **disconnect_cause** | **str**| Filter results to calls with specified call Disconnect Cause. | [optional] + **page_size** | **int**| Specifies the max number of calls that will be returned. | [optional] [default to 1000] + **page_token** | **str**| Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. | [optional] + +### Return type + +[**List[CallState]**](CallState.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Calls retrieved successfully | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **update_call** > update_call(account_id, call_id, update_call) diff --git a/docs/CodeRequest.md b/docs/CodeRequest.md index 0d8b24a9..2db12f63 100644 --- a/docs/CodeRequest.md +++ b/docs/CodeRequest.md @@ -27,7 +27,7 @@ print(CodeRequest.to_json()) # convert the object into a dict code_request_dict = code_request_instance.to_dict() # create an instance of CodeRequest from a dict -code_request_form_dict = code_request.from_dict(code_request_dict) +code_request_from_dict = CodeRequest.from_dict(code_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Conference.md b/docs/Conference.md index 3343beea..da6626a1 100644 --- a/docs/Conference.md +++ b/docs/Conference.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **created_time** | **datetime** | The time the conference was initiated, in ISO 8601 format. | [optional] **completed_time** | **datetime** | The time the conference was terminated, in ISO 8601 format. | [optional] **conference_event_url** | **str** | The URL to send the conference-related events. | [optional] -**conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **tag** | **str** | The custom string attached to the conference that will be sent with callbacks. | [optional] **active_members** | [**List[ConferenceMember]**](ConferenceMember.md) | A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). | [optional] @@ -29,7 +29,7 @@ print(Conference.to_json()) # convert the object into a dict conference_dict = conference_instance.to_dict() # create an instance of Conference from a dict -conference_form_dict = conference.from_dict(conference_dict) +conference_from_dict = Conference.from_dict(conference_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md index a06cd2e2..eca1873f 100644 --- a/docs/ConferenceCompletedCallback.md +++ b/docs/ConferenceCompletedCallback.md @@ -27,7 +27,7 @@ print(ConferenceCompletedCallback.to_json()) # convert the object into a dict conference_completed_callback_dict = conference_completed_callback_instance.to_dict() # create an instance of ConferenceCompletedCallback from a dict -conference_completed_callback_form_dict = conference_completed_callback.from_dict(conference_completed_callback_dict) +conference_completed_callback_from_dict = ConferenceCompletedCallback.from_dict(conference_completed_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md index fc172292..54618cfc 100644 --- a/docs/ConferenceCreatedCallback.md +++ b/docs/ConferenceCreatedCallback.md @@ -27,7 +27,7 @@ print(ConferenceCreatedCallback.to_json()) # convert the object into a dict conference_created_callback_dict = conference_created_callback_instance.to_dict() # create an instance of ConferenceCreatedCallback from a dict -conference_created_callback_form_dict = conference_created_callback.from_dict(conference_created_callback_dict) +conference_created_callback_from_dict = ConferenceCreatedCallback.from_dict(conference_created_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceMember.md b/docs/ConferenceMember.md index 78c00fbc..8f3f9720 100644 --- a/docs/ConferenceMember.md +++ b/docs/ConferenceMember.md @@ -27,7 +27,7 @@ print(ConferenceMember.to_json()) # convert the object into a dict conference_member_dict = conference_member_instance.to_dict() # create an instance of ConferenceMember from a dict -conference_member_form_dict = conference_member.from_dict(conference_member_dict) +conference_member_from_dict = ConferenceMember.from_dict(conference_member_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md index f19a9c41..950ae557 100644 --- a/docs/ConferenceMemberExitCallback.md +++ b/docs/ConferenceMemberExitCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] @@ -30,7 +30,7 @@ print(ConferenceMemberExitCallback.to_json()) # convert the object into a dict conference_member_exit_callback_dict = conference_member_exit_callback_instance.to_dict() # create an instance of ConferenceMemberExitCallback from a dict -conference_member_exit_callback_form_dict = conference_member_exit_callback.from_dict(conference_member_exit_callback_dict) +conference_member_exit_callback_from_dict = ConferenceMemberExitCallback.from_dict(conference_member_exit_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md index 05e282ae..a87924cd 100644 --- a/docs/ConferenceMemberJoinCallback.md +++ b/docs/ConferenceMemberJoinCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] **name** | **str** | The user-specified name of the conference that was recorded | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] @@ -30,7 +30,7 @@ print(ConferenceMemberJoinCallback.to_json()) # convert the object into a dict conference_member_join_callback_dict = conference_member_join_callback_instance.to_dict() # create an instance of ConferenceMemberJoinCallback from a dict -conference_member_join_callback_form_dict = conference_member_join_callback.from_dict(conference_member_join_callback_dict) +conference_member_join_callback_from_dict = ConferenceMemberJoinCallback.from_dict(conference_member_join_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md index 1aced898..1ffd3a1e 100644 --- a/docs/ConferenceRecordingAvailableCallback.md +++ b/docs/ConferenceRecordingAvailableCallback.md @@ -36,7 +36,7 @@ print(ConferenceRecordingAvailableCallback.to_json()) # convert the object into a dict conference_recording_available_callback_dict = conference_recording_available_callback_instance.to_dict() # create an instance of ConferenceRecordingAvailableCallback from a dict -conference_recording_available_callback_form_dict = conference_recording_available_callback.from_dict(conference_recording_available_callback_dict) +conference_recording_available_callback_from_dict = ConferenceRecordingAvailableCallback.from_dict(conference_recording_available_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceRecordingMetadata.md b/docs/ConferenceRecordingMetadata.md index f3b75138..6c8423cd 100644 --- a/docs/ConferenceRecordingMetadata.md +++ b/docs/ConferenceRecordingMetadata.md @@ -32,7 +32,7 @@ print(ConferenceRecordingMetadata.to_json()) # convert the object into a dict conference_recording_metadata_dict = conference_recording_metadata_instance.to_dict() # create an instance of ConferenceRecordingMetadata from a dict -conference_recording_metadata_form_dict = conference_recording_metadata.from_dict(conference_recording_metadata_dict) +conference_recording_metadata_from_dict = ConferenceRecordingMetadata.from_dict(conference_recording_metadata_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md index b9f6aad5..6f92e112 100644 --- a/docs/ConferenceRedirectCallback.md +++ b/docs/ConferenceRedirectCallback.md @@ -27,7 +27,7 @@ print(ConferenceRedirectCallback.to_json()) # convert the object into a dict conference_redirect_callback_dict = conference_redirect_callback_instance.to_dict() # create an instance of ConferenceRedirectCallback from a dict -conference_redirect_callback_form_dict = conference_redirect_callback.from_dict(conference_redirect_callback_dict) +conference_redirect_callback_from_dict = ConferenceRedirectCallback.from_dict(conference_redirect_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConferenceStateEnum.md b/docs/ConferenceStateEnum.md index d336fd4f..5cab80fa 100644 --- a/docs/ConferenceStateEnum.md +++ b/docs/ConferenceStateEnum.md @@ -2,10 +2,11 @@ Setting the conference state to `completed` ends the conference and ejects all members. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ACTIVE` (value: `'active'`) + +* `COMPLETED` (value: `'completed'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCall.md b/docs/CreateCall.md index f7f3aa3a..ec496aca 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -6,20 +6,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | -**var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). | -**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. | [optional] +**var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | +**privacy** | **bool** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] +**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] **uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] **application_id** | **str** | The id of the application associated with the `from` number. | **answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | -**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] **answer_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. | [optional] -**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **fallback_username** | **str** | Basic auth username. | [optional] **fallback_password** | **str** | Basic auth password. | [optional] **disconnect_url** | **str** | The URL to send the <a href='/docs/voice/webhooks/disconnect'>Disconnect</a> event to when the call ends. This event does not expect a BXML response. | [optional] -**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **call_timeout** | **float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300. | [optional] [default to 30] **callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional] [default to 15] **machine_detection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] @@ -41,7 +42,7 @@ print(CreateCall.to_json()) # convert the object into a dict create_call_dict = create_call_instance.to_dict() # create an instance of CreateCall from a dict -create_call_form_dict = create_call.from_dict(create_call_dict) +create_call_from_dict = CreateCall.from_dict(create_call_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md index 2d9524c4..691df493 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -15,11 +15,11 @@ Name | Type | Description | Notes **call_timeout** | **float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. | [optional] **callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering webhooks for the call. | [optional] **tag** | **str** | Custom tag value. | [optional] -**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | +**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to CallbackMethodEnum.POST] **answer_url** | **str** | URL to deliver the `answer` event webhook. | -**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **answer_fallback_url** | **str** | Fallback URL to deliver the `answer` event webhook. | [optional] -**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | +**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to CallbackMethodEnum.POST] **disconnect_url** | **str** | URL to deliver the `disconnect` event webhook. | [optional] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] @@ -42,7 +42,7 @@ print(CreateCallResponse.to_json()) # convert the object into a dict create_call_response_dict = create_call_response_instance.to_dict() # create an instance of CreateCallResponse from a dict -create_call_response_form_dict = create_call_response.from_dict(create_call_response_dict) +create_call_response_from_dict = CreateCallResponse.from_dict(create_call_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateLookupResponse.md b/docs/CreateLookupResponse.md index 05d10f5f..4edb1104 100644 --- a/docs/CreateLookupResponse.md +++ b/docs/CreateLookupResponse.md @@ -24,7 +24,7 @@ print(CreateLookupResponse.to_json()) # convert the object into a dict create_lookup_response_dict = create_lookup_response_instance.to_dict() # create an instance of CreateLookupResponse from a dict -create_lookup_response_form_dict = create_lookup_response.from_dict(create_lookup_response_dict) +create_lookup_response_from_dict = CreateLookupResponse.from_dict(create_lookup_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateMessageRequestError.md b/docs/CreateMessageRequestError.md index 515aaa38..19629f5f 100644 --- a/docs/CreateMessageRequestError.md +++ b/docs/CreateMessageRequestError.md @@ -24,7 +24,7 @@ print(CreateMessageRequestError.to_json()) # convert the object into a dict create_message_request_error_dict = create_message_request_error_instance.to_dict() # create an instance of CreateMessageRequestError from a dict -create_message_request_error_form_dict = create_message_request_error.from_dict(create_message_request_error_dict) +create_message_request_error_from_dict = CreateMessageRequestError.from_dict(create_message_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeferredResult.md b/docs/DeferredResult.md index b7017374..cff65d98 100644 --- a/docs/DeferredResult.md +++ b/docs/DeferredResult.md @@ -23,7 +23,7 @@ print(DeferredResult.to_json()) # convert the object into a dict deferred_result_dict = deferred_result_instance.to_dict() # create an instance of DeferredResult from a dict -deferred_result_form_dict = deferred_result.from_dict(deferred_result_dict) +deferred_result_from_dict = DeferredResult.from_dict(deferred_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md index 5e322765..433c6dda 100644 --- a/docs/DisconnectCallback.md +++ b/docs/DisconnectCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] @@ -39,7 +39,7 @@ print(DisconnectCallback.to_json()) # convert the object into a dict disconnect_callback_dict = disconnect_callback_instance.to_dict() # create an instance of DisconnectCallback from a dict -disconnect_callback_form_dict = disconnect_callback.from_dict(disconnect_callback_dict) +disconnect_callback_from_dict = DisconnectCallback.from_dict(disconnect_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Diversion.md b/docs/Diversion.md index f508e10e..79082cd2 100644 --- a/docs/Diversion.md +++ b/docs/Diversion.md @@ -28,7 +28,7 @@ print(Diversion.to_json()) # convert the object into a dict diversion_dict = diversion_instance.to_dict() # create an instance of Diversion from a dict -diversion_form_dict = diversion.from_dict(diversion_dict) +diversion_from_dict = Diversion.from_dict(diversion_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DtmfCallback.md b/docs/DtmfCallback.md index 827b6a91..52091bfb 100644 --- a/docs/DtmfCallback.md +++ b/docs/DtmfCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **call_id** | **str** | The call id associated with the event. | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] @@ -20,7 +20,7 @@ Name | Type | Description | Notes **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] @@ -39,7 +39,7 @@ print(DtmfCallback.to_json()) # convert the object into a dict dtmf_callback_dict = dtmf_callback_instance.to_dict() # create an instance of DtmfCallback from a dict -dtmf_callback_form_dict = dtmf_callback.from_dict(dtmf_callback_dict) +dtmf_callback_from_dict = DtmfCallback.from_dict(dtmf_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FieldError.md b/docs/FieldError.md index 7bef3edd..5c74973e 100644 --- a/docs/FieldError.md +++ b/docs/FieldError.md @@ -23,7 +23,7 @@ print(FieldError.to_json()) # convert the object into a dict field_error_dict = field_error_instance.to_dict() # create an instance of FieldError from a dict -field_error_form_dict = field_error.from_dict(field_error_dict) +field_error_from_dict = FieldError.from_dict(field_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FileFormatEnum.md b/docs/FileFormatEnum.md index 416da5cc..e8a7d7f8 100644 --- a/docs/FileFormatEnum.md +++ b/docs/FileFormatEnum.md @@ -2,10 +2,11 @@ The format that the recording is stored in. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `MP3` (value: `'mp3'`) + +* `WAV` (value: `'wav'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GatherCallback.md b/docs/GatherCallback.md index 0c08e01f..50d2ac3d 100644 --- a/docs/GatherCallback.md +++ b/docs/GatherCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -21,7 +21,7 @@ Name | Type | Description | Notes **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] **terminating_digit** | **str** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] @@ -40,7 +40,7 @@ print(GatherCallback.to_json()) # convert the object into a dict gather_callback_dict = gather_callback_instance.to_dict() # create an instance of GatherCallback from a dict -gather_callback_form_dict = gather_callback.from_dict(gather_callback_dict) +gather_callback_from_dict = GatherCallback.from_dict(gather_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InboundMessageCallback.md b/docs/InboundMessageCallback.md index 054600e1..357061fb 100644 --- a/docs/InboundMessageCallback.md +++ b/docs/InboundMessageCallback.md @@ -27,7 +27,7 @@ print(InboundMessageCallback.to_json()) # convert the object into a dict inbound_message_callback_dict = inbound_message_callback_instance.to_dict() # create an instance of InboundMessageCallback from a dict -inbound_message_callback_form_dict = inbound_message_callback.from_dict(inbound_message_callback_dict) +inbound_message_callback_from_dict = InboundMessageCallback.from_dict(inbound_message_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md index 57d193a9..b95f6b25 100644 --- a/docs/InboundMessageCallbackMessage.md +++ b/docs/InboundMessageCallbackMessage.md @@ -34,7 +34,7 @@ print(InboundMessageCallbackMessage.to_json()) # convert the object into a dict inbound_message_callback_message_dict = inbound_message_callback_message_instance.to_dict() # create an instance of InboundMessageCallbackMessage from a dict -inbound_message_callback_message_form_dict = inbound_message_callback_message.from_dict(inbound_message_callback_message_dict) +inbound_message_callback_message_from_dict = InboundMessageCallbackMessage.from_dict(inbound_message_callback_message_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md index 0b76c5d7..8005f9e0 100644 --- a/docs/InitiateCallback.md +++ b/docs/InitiateCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -34,7 +34,7 @@ print(InitiateCallback.to_json()) # convert the object into a dict initiate_callback_dict = initiate_callback_instance.to_dict() # create an instance of InitiateCallback from a dict -initiate_callback_form_dict = initiate_callback.from_dict(initiate_callback_dict) +initiate_callback_from_dict = InitiateCallback.from_dict(initiate_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListMessageDirectionEnum.md b/docs/ListMessageDirectionEnum.md index 4b5ee217..48deeb76 100644 --- a/docs/ListMessageDirectionEnum.md +++ b/docs/ListMessageDirectionEnum.md @@ -2,10 +2,11 @@ The direction of the message. One of INBOUND OUTBOUND. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `INBOUND` (value: `'INBOUND'`) + +* `OUTBOUND` (value: `'OUTBOUND'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md index 099490d4..4dff0c1b 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -38,7 +38,7 @@ print(ListMessageItem.to_json()) # convert the object into a dict list_message_item_dict = list_message_item_instance.to_dict() # create an instance of ListMessageItem from a dict -list_message_item_form_dict = list_message_item.from_dict(list_message_item_dict) +list_message_item_from_dict = ListMessageItem.from_dict(list_message_item_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LookupRequest.md b/docs/LookupRequest.md index 44aabc4c..6ba46798 100644 --- a/docs/LookupRequest.md +++ b/docs/LookupRequest.md @@ -23,7 +23,7 @@ print(LookupRequest.to_json()) # convert the object into a dict lookup_request_dict = lookup_request_instance.to_dict() # create an instance of LookupRequest from a dict -lookup_request_form_dict = lookup_request.from_dict(lookup_request_dict) +lookup_request_from_dict = LookupRequest.from_dict(lookup_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LookupResult.md b/docs/LookupResult.md index df52065e..a2154b50 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -31,7 +31,7 @@ print(LookupResult.to_json()) # convert the object into a dict lookup_result_dict = lookup_result_instance.to_dict() # create an instance of LookupResult from a dict -lookup_result_form_dict = lookup_result.from_dict(lookup_result_dict) +lookup_result_from_dict = LookupResult.from_dict(lookup_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LookupStatus.md b/docs/LookupStatus.md index 0d4e048e..490993e5 100644 --- a/docs/LookupStatus.md +++ b/docs/LookupStatus.md @@ -26,7 +26,7 @@ print(LookupStatus.to_json()) # convert the object into a dict lookup_status_dict = lookup_status_instance.to_dict() # create an instance of LookupStatus from a dict -lookup_status_form_dict = lookup_status.from_dict(lookup_status_dict) +lookup_status_from_dict = LookupStatus.from_dict(lookup_status_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LookupStatusEnum.md b/docs/LookupStatusEnum.md index db300ad3..5269ba85 100644 --- a/docs/LookupStatusEnum.md +++ b/docs/LookupStatusEnum.md @@ -2,10 +2,15 @@ The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED). -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `IN_PROGRESS` (value: `'IN_PROGRESS'`) + +* `COMPLETE` (value: `'COMPLETE'`) + +* `PARTIAL_COMPLETE` (value: `'PARTIAL_COMPLETE'`) + +* `FAILED` (value: `'FAILED'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md index a70f2285..b3f3f9c4 100644 --- a/docs/MachineDetectionCompleteCallback.md +++ b/docs/MachineDetectionCompleteCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -36,7 +36,7 @@ print(MachineDetectionCompleteCallback.to_json()) # convert the object into a dict machine_detection_complete_callback_dict = machine_detection_complete_callback_instance.to_dict() # create an instance of MachineDetectionCompleteCallback from a dict -machine_detection_complete_callback_form_dict = machine_detection_complete_callback.from_dict(machine_detection_complete_callback_dict) +machine_detection_complete_callback_from_dict = MachineDetectionCompleteCallback.from_dict(machine_detection_complete_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index 46a3a08c..e3f7a7a7 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -1,12 +1,12 @@ # MachineDetectionConfiguration -The machine detection request used to perform machine detection on the call. +The machine detection request used to perform machine detection on the call. Currently, there is an issue where decimal values are not getting processed correctly. Please use whole number values. We are working to resolve this issue. Please contact Bandwidth Support if you need more information. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | [**MachineDetectionModeEnum**](MachineDetectionModeEnum.md) | | [optional] +**mode** | [**MachineDetectionModeEnum**](MachineDetectionModeEnum.md) | | [optional] [default to MachineDetectionModeEnum.ASYNC] **detection_timeout** | **float** | The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent. | [optional] [default to 15] **silence_timeout** | **float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional] [default to 10] **speech_threshold** | **float** | When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'. | [optional] [default to 10] @@ -14,11 +14,11 @@ Name | Type | Description | Notes **machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] **delay_result** | **bool** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional] [default to False] **callback_url** | **str** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] -**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] **fallback_url** | **str** | A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond | [optional] -**fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **fallback_username** | **str** | Basic auth username. | [optional] **fallback_password** | **str** | Basic auth password. | [optional] @@ -37,7 +37,7 @@ print(MachineDetectionConfiguration.to_json()) # convert the object into a dict machine_detection_configuration_dict = machine_detection_configuration_instance.to_dict() # create an instance of MachineDetectionConfiguration from a dict -machine_detection_configuration_form_dict = machine_detection_configuration.from_dict(machine_detection_configuration_dict) +machine_detection_configuration_from_dict = MachineDetectionConfiguration.from_dict(machine_detection_configuration_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MachineDetectionModeEnum.md b/docs/MachineDetectionModeEnum.md index 86df5cdd..c6b8c814 100644 --- a/docs/MachineDetectionModeEnum.md +++ b/docs/MachineDetectionModeEnum.md @@ -2,10 +2,11 @@ The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `SYNC` (value: `'sync'`) + +* `ASYNC` (value: `'async'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MachineDetectionResult.md b/docs/MachineDetectionResult.md index d5e48387..fd249dd7 100644 --- a/docs/MachineDetectionResult.md +++ b/docs/MachineDetectionResult.md @@ -24,7 +24,7 @@ print(MachineDetectionResult.to_json()) # convert the object into a dict machine_detection_result_dict = machine_detection_result_instance.to_dict() # create an instance of MachineDetectionResult from a dict -machine_detection_result_form_dict = machine_detection_result.from_dict(machine_detection_result_dict) +machine_detection_result_from_dict = MachineDetectionResult.from_dict(machine_detection_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Media.md b/docs/Media.md index cd489172..3d707063 100644 --- a/docs/Media.md +++ b/docs/Media.md @@ -24,7 +24,7 @@ print(Media.to_json()) # convert the object into a dict media_dict = media_instance.to_dict() # create an instance of Media from a dict -media_form_dict = media.from_dict(media_dict) +media_from_dict = Media.from_dict(media_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Message.md b/docs/Message.md index 17b5494f..ba5d87c2 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -34,7 +34,7 @@ print(Message.to_json()) # convert the object into a dict message_dict = message_instance.to_dict() # create an instance of Message from a dict -message_form_dict = message.from_dict(message_dict) +message_from_dict = Message.from_dict(message_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md index 0de2bdc6..8dcfb718 100644 --- a/docs/MessageDeliveredCallback.md +++ b/docs/MessageDeliveredCallback.md @@ -27,7 +27,7 @@ print(MessageDeliveredCallback.to_json()) # convert the object into a dict message_delivered_callback_dict = message_delivered_callback_instance.to_dict() # create an instance of MessageDeliveredCallback from a dict -message_delivered_callback_form_dict = message_delivered_callback.from_dict(message_delivered_callback_dict) +message_delivered_callback_from_dict = MessageDeliveredCallback.from_dict(message_delivered_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md index d2faa819..880c5a22 100644 --- a/docs/MessageDeliveredCallbackMessage.md +++ b/docs/MessageDeliveredCallbackMessage.md @@ -34,7 +34,7 @@ print(MessageDeliveredCallbackMessage.to_json()) # convert the object into a dict message_delivered_callback_message_dict = message_delivered_callback_message_instance.to_dict() # create an instance of MessageDeliveredCallbackMessage from a dict -message_delivered_callback_message_form_dict = message_delivered_callback_message.from_dict(message_delivered_callback_message_dict) +message_delivered_callback_message_from_dict = MessageDeliveredCallbackMessage.from_dict(message_delivered_callback_message_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageDirectionEnum.md b/docs/MessageDirectionEnum.md index fddf1e3f..3bdd4f66 100644 --- a/docs/MessageDirectionEnum.md +++ b/docs/MessageDirectionEnum.md @@ -2,10 +2,11 @@ The direction of the message. One of in out. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `IN` (value: `'in'`) + +* `OUT` (value: `'out'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageFailedCallback.md b/docs/MessageFailedCallback.md index ee382f08..3cbb78f0 100644 --- a/docs/MessageFailedCallback.md +++ b/docs/MessageFailedCallback.md @@ -28,7 +28,7 @@ print(MessageFailedCallback.to_json()) # convert the object into a dict message_failed_callback_dict = message_failed_callback_instance.to_dict() # create an instance of MessageFailedCallback from a dict -message_failed_callback_form_dict = message_failed_callback.from_dict(message_failed_callback_dict) +message_failed_callback_from_dict = MessageFailedCallback.from_dict(message_failed_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md index 76732aa8..582020e0 100644 --- a/docs/MessageFailedCallbackMessage.md +++ b/docs/MessageFailedCallbackMessage.md @@ -34,7 +34,7 @@ print(MessageFailedCallbackMessage.to_json()) # convert the object into a dict message_failed_callback_message_dict = message_failed_callback_message_instance.to_dict() # create an instance of MessageFailedCallbackMessage from a dict -message_failed_callback_message_form_dict = message_failed_callback_message.from_dict(message_failed_callback_message_dict) +message_failed_callback_message_from_dict = MessageFailedCallbackMessage.from_dict(message_failed_callback_message_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index 92405dc3..bf2611d6 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | **to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. | -**var_from** | **str** | One of your telephone numbers the message should come from in E164 format. | +**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] **media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] @@ -29,7 +29,7 @@ print(MessageRequest.to_json()) # convert the object into a dict message_request_dict = message_request_instance.to_dict() # create an instance of MessageRequest from a dict -message_request_form_dict = message_request.from_dict(message_request_dict) +message_request_from_dict = MessageRequest.from_dict(message_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageSendingCallback.md b/docs/MessageSendingCallback.md index c301bf2e..26fd7915 100644 --- a/docs/MessageSendingCallback.md +++ b/docs/MessageSendingCallback.md @@ -27,7 +27,7 @@ print(MessageSendingCallback.to_json()) # convert the object into a dict message_sending_callback_dict = message_sending_callback_instance.to_dict() # create an instance of MessageSendingCallback from a dict -message_sending_callback_form_dict = message_sending_callback.from_dict(message_sending_callback_dict) +message_sending_callback_from_dict = MessageSendingCallback.from_dict(message_sending_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md index f90cb48e..e7691078 100644 --- a/docs/MessageSendingCallbackMessage.md +++ b/docs/MessageSendingCallbackMessage.md @@ -34,7 +34,7 @@ print(MessageSendingCallbackMessage.to_json()) # convert the object into a dict message_sending_callback_message_dict = message_sending_callback_message_instance.to_dict() # create an instance of MessageSendingCallbackMessage from a dict -message_sending_callback_message_form_dict = message_sending_callback_message.from_dict(message_sending_callback_message_dict) +message_sending_callback_message_from_dict = MessageSendingCallbackMessage.from_dict(message_sending_callback_message_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md index cdd283ee..869748f6 100644 --- a/docs/MessageStatusEnum.md +++ b/docs/MessageStatusEnum.md @@ -2,10 +2,23 @@ The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `RECEIVED` (value: `'RECEIVED'`) + +* `QUEUED` (value: `'QUEUED'`) + +* `SENDING` (value: `'SENDING'`) + +* `SENT` (value: `'SENT'`) + +* `FAILED` (value: `'FAILED'`) + +* `DELIVERED` (value: `'DELIVERED'`) + +* `ACCEPTED` (value: `'ACCEPTED'`) + +* `UNDELIVERED` (value: `'UNDELIVERED'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessageTypeEnum.md b/docs/MessageTypeEnum.md index e08bff97..1cf77340 100644 --- a/docs/MessageTypeEnum.md +++ b/docs/MessageTypeEnum.md @@ -2,10 +2,11 @@ The type of message. Either SMS or MMS. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `SMS` (value: `'sms'`) + +* `MMS` (value: `'mms'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessagesList.md b/docs/MessagesList.md index d145de3e..75db09d1 100644 --- a/docs/MessagesList.md +++ b/docs/MessagesList.md @@ -24,7 +24,7 @@ print(MessagesList.to_json()) # convert the object into a dict messages_list_dict = messages_list_instance.to_dict() # create an instance of MessagesList from a dict -messages_list_form_dict = messages_list.from_dict(messages_list_dict) +messages_list_from_dict = MessagesList.from_dict(messages_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessagingCodeResponse.md b/docs/MessagingCodeResponse.md index 3eebe12e..9863143c 100644 --- a/docs/MessagingCodeResponse.md +++ b/docs/MessagingCodeResponse.md @@ -22,7 +22,7 @@ print(MessagingCodeResponse.to_json()) # convert the object into a dict messaging_code_response_dict = messaging_code_response_instance.to_dict() # create an instance of MessagingCodeResponse from a dict -messaging_code_response_form_dict = messaging_code_response.from_dict(messaging_code_response_dict) +messaging_code_response_from_dict = MessagingCodeResponse.from_dict(messaging_code_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MessagingRequestError.md b/docs/MessagingRequestError.md index 6d784cfa..8d160ce2 100644 --- a/docs/MessagingRequestError.md +++ b/docs/MessagingRequestError.md @@ -23,7 +23,7 @@ print(MessagingRequestError.to_json()) # convert the object into a dict messaging_request_error_dict = messaging_request_error_instance.to_dict() # create an instance of MessagingRequestError from a dict -messaging_request_error_form_dict = messaging_request_error.from_dict(messaging_request_error_dict) +messaging_request_error_from_dict = MessagingRequestError.from_dict(messaging_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MfaForbiddenRequestError.md b/docs/MfaForbiddenRequestError.md index a91fe693..69324527 100644 --- a/docs/MfaForbiddenRequestError.md +++ b/docs/MfaForbiddenRequestError.md @@ -22,7 +22,7 @@ print(MfaForbiddenRequestError.to_json()) # convert the object into a dict mfa_forbidden_request_error_dict = mfa_forbidden_request_error_instance.to_dict() # create an instance of MfaForbiddenRequestError from a dict -mfa_forbidden_request_error_form_dict = mfa_forbidden_request_error.from_dict(mfa_forbidden_request_error_dict) +mfa_forbidden_request_error_from_dict = MfaForbiddenRequestError.from_dict(mfa_forbidden_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MfaRequestError.md b/docs/MfaRequestError.md index 241ce759..7fb8449d 100644 --- a/docs/MfaRequestError.md +++ b/docs/MfaRequestError.md @@ -23,7 +23,7 @@ print(MfaRequestError.to_json()) # convert the object into a dict mfa_request_error_dict = mfa_request_error_instance.to_dict() # create an instance of MfaRequestError from a dict -mfa_request_error_form_dict = mfa_request_error.from_dict(mfa_request_error_dict) +mfa_request_error_from_dict = MfaRequestError.from_dict(mfa_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MfaUnauthorizedRequestError.md b/docs/MfaUnauthorizedRequestError.md index fabaad4a..1281f2ca 100644 --- a/docs/MfaUnauthorizedRequestError.md +++ b/docs/MfaUnauthorizedRequestError.md @@ -22,7 +22,7 @@ print(MfaUnauthorizedRequestError.to_json()) # convert the object into a dict mfa_unauthorized_request_error_dict = mfa_unauthorized_request_error_instance.to_dict() # create an instance of MfaUnauthorizedRequestError from a dict -mfa_unauthorized_request_error_form_dict = mfa_unauthorized_request_error.from_dict(mfa_unauthorized_request_error_dict) +mfa_unauthorized_request_error_from_dict = MfaUnauthorizedRequestError.from_dict(mfa_unauthorized_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PageInfo.md b/docs/PageInfo.md index 59af3fdb..a09abf05 100644 --- a/docs/PageInfo.md +++ b/docs/PageInfo.md @@ -25,7 +25,7 @@ print(PageInfo.to_json()) # convert the object into a dict page_info_dict = page_info_instance.to_dict() # create an instance of PageInfo from a dict -page_info_form_dict = page_info.from_dict(page_info_dict) +page_info_from_dict = PageInfo.from_dict(page_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PriorityEnum.md b/docs/PriorityEnum.md index 4428007c..818eee74 100644 --- a/docs/PriorityEnum.md +++ b/docs/PriorityEnum.md @@ -2,10 +2,11 @@ The priority specified by the user. Not supported on MMS. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `DEFAULT` (value: `'default'`) + +* `HIGH` (value: `'high'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md index 4f4106d7..465f44ea 100644 --- a/docs/RecordingAvailableCallback.md +++ b/docs/RecordingAvailableCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -23,10 +23,10 @@ Name | Type | Description | Notes **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **duration** | **str** | The duration of the recording in ISO-8601 format | [optional] **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] -**channels** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] +**channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] ## Example @@ -44,7 +44,7 @@ print(RecordingAvailableCallback.to_json()) # convert the object into a dict recording_available_callback_dict = recording_available_callback_instance.to_dict() # create an instance of RecordingAvailableCallback from a dict -recording_available_callback_form_dict = recording_available_callback.from_dict(recording_available_callback_dict) +recording_available_callback_from_dict = RecordingAvailableCallback.from_dict(recording_available_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md index 348cf597..50ce4188 100644 --- a/docs/RecordingCompleteCallback.md +++ b/docs/RecordingCompleteCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -26,7 +26,7 @@ Name | Type | Description | Notes **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] ## Example @@ -44,7 +44,7 @@ print(RecordingCompleteCallback.to_json()) # convert the object into a dict recording_complete_callback_dict = recording_complete_callback_instance.to_dict() # create an instance of RecordingCompleteCallback from a dict -recording_complete_callback_form_dict = recording_complete_callback.from_dict(recording_complete_callback_dict) +recording_complete_callback_from_dict = RecordingCompleteCallback.from_dict(recording_complete_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RecordingStateEnum.md b/docs/RecordingStateEnum.md index 70b3ad3b..9c1c6d4a 100644 --- a/docs/RecordingStateEnum.md +++ b/docs/RecordingStateEnum.md @@ -2,10 +2,11 @@ The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PAUSED` (value: `'paused'`) + +* `RECORDING` (value: `'recording'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RecordingTranscriptionMetadata.md b/docs/RecordingTranscriptionMetadata.md new file mode 100644 index 00000000..e858c75c --- /dev/null +++ b/docs/RecordingTranscriptionMetadata.md @@ -0,0 +1,33 @@ +# RecordingTranscriptionMetadata + +If the recording was transcribed, metadata about the transcription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique transcription ID | [optional] +**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] +**completed_time** | **datetime** | The time that the transcription was completed | [optional] +**url** | **str** | The URL of the [transcription](#operation/getCallTranscription) | [optional] + +## Example + +```python +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of RecordingTranscriptionMetadata from a JSON string +recording_transcription_metadata_instance = RecordingTranscriptionMetadata.from_json(json) +# print the JSON string representation of the object +print(RecordingTranscriptionMetadata.to_json()) + +# convert the object into a dict +recording_transcription_metadata_dict = recording_transcription_metadata_instance.to_dict() +# create an instance of RecordingTranscriptionMetadata from a dict +recording_transcription_metadata_from_dict = RecordingTranscriptionMetadata.from_dict(recording_transcription_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RecordingTranscriptions.md b/docs/RecordingTranscriptions.md new file mode 100644 index 00000000..6379fc6c --- /dev/null +++ b/docs/RecordingTranscriptions.md @@ -0,0 +1,29 @@ +# RecordingTranscriptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transcripts** | [**List[Transcription]**](Transcription.md) | | [optional] + +## Example + +```python +from bandwidth.models.recording_transcriptions import RecordingTranscriptions + +# TODO update the JSON string below +json = "{}" +# create an instance of RecordingTranscriptions from a JSON string +recording_transcriptions_instance = RecordingTranscriptions.from_json(json) +# print the JSON string representation of the object +print(RecordingTranscriptions.to_json()) + +# convert the object into a dict +recording_transcriptions_dict = recording_transcriptions_instance.to_dict() +# create an instance of RecordingTranscriptions from a dict +recording_transcriptions_from_dict = RecordingTranscriptions.from_dict(recording_transcriptions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md index 091195ea..82589940 100644 --- a/docs/RecordingsApi.md +++ b/docs/RecordingsApi.md @@ -4,24 +4,24 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**delete_call_transcription**](RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription [**delete_recording**](RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording [**delete_recording_media**](RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media +[**delete_recording_transcription**](RecordingsApi.md#delete_recording_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription [**download_call_recording**](RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording [**get_call_recording**](RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording -[**get_call_transcription**](RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription +[**get_recording_transcription**](RecordingsApi.md#get_recording_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription [**list_account_call_recordings**](RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings [**list_call_recordings**](RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings [**transcribe_call_recording**](RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request [**update_call_recording_state**](RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording -# **delete_call_transcription** -> delete_call_transcription(account_id, call_id, recording_id) +# **delete_recording** +> delete_recording(account_id, call_id, recording_id) -Delete Transcription +Delete Recording -Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. +Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. ### Example @@ -58,10 +58,10 @@ with bandwidth.ApiClient(configuration) as api_client: recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. try: - # Delete Transcription - api_instance.delete_call_transcription(account_id, call_id, recording_id) + # Delete Recording + api_instance.delete_recording(account_id, call_id, recording_id) except Exception as e: - print("Exception when calling RecordingsApi->delete_call_transcription: %s\n" % e) + print("Exception when calling RecordingsApi->delete_recording: %s\n" % e) ``` @@ -92,7 +92,7 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | The transcription was successfully deleted. | - | +**204** | Recording was deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -104,12 +104,12 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **delete_recording** -> delete_recording(account_id, call_id, recording_id) +# **delete_recording_media** +> delete_recording_media(account_id, call_id, recording_id) -Delete Recording +Delete Recording Media -Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. +Deletes the specified recording's media. ### Example @@ -146,10 +146,10 @@ with bandwidth.ApiClient(configuration) as api_client: recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. try: - # Delete Recording - api_instance.delete_recording(account_id, call_id, recording_id) + # Delete Recording Media + api_instance.delete_recording_media(account_id, call_id, recording_id) except Exception as e: - print("Exception when calling RecordingsApi->delete_recording: %s\n" % e) + print("Exception when calling RecordingsApi->delete_recording_media: %s\n" % e) ``` @@ -180,7 +180,7 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Recording was deleted. | - | +**204** | The recording media was successfully deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -192,12 +192,12 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **delete_recording_media** -> delete_recording_media(account_id, call_id, recording_id) +# **delete_recording_transcription** +> delete_recording_transcription(account_id, call_id, recording_id) -Delete Recording Media +Delete Transcription -Deletes the specified recording's media. +Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` 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. ### Example @@ -234,10 +234,10 @@ with bandwidth.ApiClient(configuration) as api_client: recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID. try: - # Delete Recording Media - api_instance.delete_recording_media(account_id, call_id, recording_id) + # Delete Transcription + api_instance.delete_recording_transcription(account_id, call_id, recording_id) except Exception as e: - print("Exception when calling RecordingsApi->delete_recording_media: %s\n" % e) + print("Exception when calling RecordingsApi->delete_recording_transcription: %s\n" % e) ``` @@ -268,7 +268,7 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | The recording media was successfully deleted. | - | +**204** | The transcription was successfully deleted. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -461,12 +461,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_call_transcription** -> TranscriptionList get_call_transcription(account_id, call_id, recording_id) +# **get_recording_transcription** +> RecordingTranscriptions get_recording_transcription(account_id, call_id, recording_id) Get Transcription -Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. +Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. ### Example @@ -474,7 +474,7 @@ Downloads the specified transcription. If the transcribed recording was multi-c ```python import bandwidth -from bandwidth.models.transcription_list import TranscriptionList +from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.rest import ApiException from pprint import pprint @@ -505,11 +505,11 @@ with bandwidth.ApiClient(configuration) as api_client: try: # Get Transcription - api_response = api_instance.get_call_transcription(account_id, call_id, recording_id) - print("The response of RecordingsApi->get_call_transcription:\n") + api_response = api_instance.get_recording_transcription(account_id, call_id, recording_id) + print("The response of RecordingsApi->get_recording_transcription:\n") pprint(api_response) except Exception as e: - print("Exception when calling RecordingsApi->get_call_transcription: %s\n" % e) + print("Exception when calling RecordingsApi->get_recording_transcription: %s\n" % e) ``` @@ -525,7 +525,7 @@ Name | Type | Description | Notes ### Return type -[**TranscriptionList**](TranscriptionList.md) +[**RecordingTranscriptions**](RecordingTranscriptions.md) ### Authorization @@ -540,7 +540,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Transcription found | - | +**200** | Transcription found. | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | diff --git a/docs/RedirectCallback.md b/docs/RedirectCallback.md index fe76b359..77f4eb06 100644 --- a/docs/RedirectCallback.md +++ b/docs/RedirectCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -20,7 +20,7 @@ Name | Type | Description | Notes **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] ## Example @@ -38,7 +38,7 @@ print(RedirectCallback.to_json()) # convert the object into a dict redirect_callback_dict = redirect_callback_instance.to_dict() # create an instance of RedirectCallback from a dict -redirect_callback_form_dict = redirect_callback.from_dict(redirect_callback_dict) +redirect_callback_from_dict = RedirectCallback.from_dict(redirect_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RedirectMethodEnum.md b/docs/RedirectMethodEnum.md index 3b86ecc4..a0291d34 100644 --- a/docs/RedirectMethodEnum.md +++ b/docs/RedirectMethodEnum.md @@ -2,10 +2,11 @@ The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.

Not allowed if `state` is `completed`. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `GET` (value: `'GET'`) + +* `POST` (value: `'POST'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/StirShaken.md b/docs/StirShaken.md index b629563a..17c4ddc5 100644 --- a/docs/StirShaken.md +++ b/docs/StirShaken.md @@ -24,7 +24,7 @@ print(StirShaken.to_json()) # convert the object into a dict stir_shaken_dict = stir_shaken_instance.to_dict() # create an instance of StirShaken from a dict -stir_shaken_form_dict = stir_shaken.from_dict(stir_shaken_dict) +stir_shaken_from_dict = StirShaken.from_dict(stir_shaken_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Tag.md b/docs/Tag.md index 442994e3..73c866b4 100644 --- a/docs/Tag.md +++ b/docs/Tag.md @@ -23,7 +23,7 @@ print(Tag.to_json()) # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TnLookupRequestError.md b/docs/TnLookupRequestError.md index 0aa9071f..24ccaa19 100644 --- a/docs/TnLookupRequestError.md +++ b/docs/TnLookupRequestError.md @@ -22,7 +22,7 @@ print(TnLookupRequestError.to_json()) # convert the object into a dict tn_lookup_request_error_dict = tn_lookup_request_error_instance.to_dict() # create an instance of TnLookupRequestError from a dict -tn_lookup_request_error_form_dict = tn_lookup_request_error.from_dict(tn_lookup_request_error_dict) +tn_lookup_request_error_from_dict = TnLookupRequestError.from_dict(tn_lookup_request_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TranscribeRecording.md b/docs/TranscribeRecording.md index e9bbd336..2ff5165b 100644 --- a/docs/TranscribeRecording.md +++ b/docs/TranscribeRecording.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **callback_url** | **str** | The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization. | [optional] -**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] +**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] @@ -28,7 +28,7 @@ print(TranscribeRecording.to_json()) # convert the object into a dict transcribe_recording_dict = transcribe_recording_instance.to_dict() # create an instance of TranscribeRecording from a dict -transcribe_recording_form_dict = transcribe_recording.from_dict(transcribe_recording_dict) +transcribe_recording_from_dict = TranscribeRecording.from_dict(transcribe_recording_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Transcription.md b/docs/Transcription.md index 4315b924..5f9a2508 100644 --- a/docs/Transcription.md +++ b/docs/Transcription.md @@ -23,7 +23,7 @@ print(Transcription.to_json()) # convert the object into a dict transcription_dict = transcription_instance.to_dict() # create an instance of Transcription from a dict -transcription_form_dict = transcription.from_dict(transcription_dict) +transcription_from_dict = Transcription.from_dict(transcription_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md index f4d39a38..16a1c93c 100644 --- a/docs/TranscriptionAvailableCallback.md +++ b/docs/TranscriptionAvailableCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -25,7 +25,7 @@ Name | Type | Description | Notes **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] **transcription** | [**Transcription**](Transcription.md) | | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] ## Example @@ -43,7 +43,7 @@ print(TranscriptionAvailableCallback.to_json()) # convert the object into a dict transcription_available_callback_dict = transcription_available_callback_instance.to_dict() # create an instance of TranscriptionAvailableCallback from a dict -transcription_available_callback_form_dict = transcription_available_callback.from_dict(transcription_available_callback_dict) +transcription_available_callback_from_dict = TranscriptionAvailableCallback.from_dict(transcription_available_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TranscriptionsApi.md b/docs/TranscriptionsApi.md new file mode 100644 index 00000000..695660b6 --- /dev/null +++ b/docs/TranscriptionsApi.md @@ -0,0 +1,279 @@ +# bandwidth.TranscriptionsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_real_time_transcription**](TranscriptionsApi.md#delete_real_time_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Delete a specific transcription +[**get_real_time_transcription**](TranscriptionsApi.md#get_real_time_transcription) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Retrieve a specific transcription +[**list_real_time_transcriptions**](TranscriptionsApi.md#list_real_time_transcriptions) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions | Enumerate transcriptions made with StartTranscription + + +# **delete_real_time_transcription** +> delete_real_time_transcription(account_id, call_id, transcription_id) + +Delete a specific transcription + +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. + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.TranscriptionsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + transcription_id = 't-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Transcription ID. + + try: + # Delete a specific transcription + api_instance.delete_real_time_transcription(account_id, call_id, transcription_id) + except Exception as e: + print("Exception when calling TranscriptionsApi->delete_real_time_transcription: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **transcription_id** | **str**| Programmable Voice API Transcription ID. | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Transcription data was deleted. | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_real_time_transcription** +> CallTranscriptionResponse get_real_time_transcription(account_id, call_id, transcription_id) + +Retrieve a specific transcription + +Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.models.call_transcription_response import CallTranscriptionResponse +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.TranscriptionsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + transcription_id = 't-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Transcription ID. + + try: + # Retrieve a specific transcription + api_response = api_instance.get_real_time_transcription(account_id, call_id, transcription_id) + print("The response of TranscriptionsApi->get_real_time_transcription:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TranscriptionsApi->get_real_time_transcription: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + **transcription_id** | **str**| Programmable Voice API Transcription ID. | + +### Return type + +[**CallTranscriptionResponse**](CallTranscriptionResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Transcription found. | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_real_time_transcriptions** +> List[CallTranscriptionMetadata] list_real_time_transcriptions(account_id, call_id) + +Enumerate transcriptions made with StartTranscription + +Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.TranscriptionsApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID. + + try: + # Enumerate transcriptions made with StartTranscription + api_response = api_instance.list_real_time_transcriptions(account_id, call_id) + print("The response of TranscriptionsApi->list_real_time_transcriptions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TranscriptionsApi->list_real_time_transcriptions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **call_id** | **str**| Programmable Voice API Call ID. | + +### Return type + +[**List[CallTranscriptionMetadata]**](CallTranscriptionMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Transcription found. | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**405** | Method Not Allowed | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | * Retry-After - When you should try your request again.
| +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md index 032b0a79..6e33e551 100644 --- a/docs/TransferAnswerCallback.md +++ b/docs/TransferAnswerCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -19,7 +19,7 @@ Name | Type | Description | Notes **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] ## Example @@ -37,7 +37,7 @@ print(TransferAnswerCallback.to_json()) # convert the object into a dict transfer_answer_callback_dict = transfer_answer_callback_instance.to_dict() # create an instance of TransferAnswerCallback from a dict -transfer_answer_callback_form_dict = transfer_answer_callback.from_dict(transfer_answer_callback_dict) +transfer_answer_callback_from_dict = TransferAnswerCallback.from_dict(transfer_answer_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md index 2cf4a2d9..c96e8f5b 100644 --- a/docs/TransferCompleteCallback.md +++ b/docs/TransferCompleteCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -19,7 +19,7 @@ Name | Type | Description | Notes **start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional] **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] **error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] @@ -40,7 +40,7 @@ print(TransferCompleteCallback.to_json()) # convert the object into a dict transfer_complete_callback_dict = transfer_complete_callback_instance.to_dict() # create an instance of TransferCompleteCallback from a dict -transfer_complete_callback_form_dict = transfer_complete_callback.from_dict(transfer_complete_callback_dict) +transfer_complete_callback_from_dict = TransferCompleteCallback.from_dict(transfer_complete_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md index e3b040cb..a6af2474 100644 --- a/docs/TransferDisconnectCallback.md +++ b/docs/TransferDisconnectCallback.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **event_time** | **datetime** | 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] **account_id** | **str** | The user account associated with the call. | [optional] **application_id** | **str** | The id of the application associated with the call. | [optional] -**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] +**var_from** | **str** | The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555). | [optional] **to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] **call_id** | **str** | The call id associated with the event. | [optional] @@ -21,7 +21,7 @@ Name | Type | Description | Notes **answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional] **end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional] **tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] -**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] +**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] **cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] **error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional] @@ -42,7 +42,7 @@ print(TransferDisconnectCallback.to_json()) # convert the object into a dict transfer_disconnect_callback_dict = transfer_disconnect_callback_instance.to_dict() # create an instance of TransferDisconnectCallback from a dict -transfer_disconnect_callback_form_dict = transfer_disconnect_callback.from_dict(transfer_disconnect_callback_dict) +transfer_disconnect_callback_from_dict = TransferDisconnectCallback.from_dict(transfer_disconnect_callback_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md index 9e824bec..be0a78a5 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**state** | [**CallStateEnum**](CallStateEnum.md) | | [optional] +**state** | [**CallStateEnum**](CallStateEnum.md) | | [optional] [default to CallStateEnum.ACTIVE] **redirect_url** | **str** | The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`. | [optional] -**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] +**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to RedirectMethodEnum.POST] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] **redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. | [optional] -**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] +**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to RedirectMethodEnum.POST] **fallback_username** | **str** | Basic auth username. | [optional] **fallback_password** | **str** | Basic auth password. | [optional] **tag** | **str** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] @@ -31,7 +31,7 @@ print(UpdateCall.to_json()) # convert the object into a dict update_call_dict = update_call_instance.to_dict() # create an instance of UpdateCall from a dict -update_call_form_dict = update_call.from_dict(update_call_dict) +update_call_from_dict = UpdateCall.from_dict(update_call_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateCallRecording.md b/docs/UpdateCallRecording.md index 08b3fbf4..d5cee602 100644 --- a/docs/UpdateCallRecording.md +++ b/docs/UpdateCallRecording.md @@ -22,7 +22,7 @@ print(UpdateCallRecording.to_json()) # convert the object into a dict update_call_recording_dict = update_call_recording_instance.to_dict() # create an instance of UpdateCallRecording from a dict -update_call_recording_form_dict = update_call_recording.from_dict(update_call_recording_dict) +update_call_recording_from_dict = UpdateCallRecording.from_dict(update_call_recording_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateConference.md b/docs/UpdateConference.md index 1f218b69..a5045294 100644 --- a/docs/UpdateConference.md +++ b/docs/UpdateConference.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional] +**status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional] [default to ConferenceStateEnum.ACTIVE] **redirect_url** | **str** | The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. | [optional] -**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] +**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to RedirectMethodEnum.POST] **username** | **str** | Basic auth username. | [optional] **password** | **str** | Basic auth password. | [optional] **redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`. | [optional] -**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] +**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to RedirectMethodEnum.POST] **fallback_username** | **str** | Basic auth username. | [optional] **fallback_password** | **str** | Basic auth password. | [optional] @@ -30,7 +30,7 @@ print(UpdateConference.to_json()) # convert the object into a dict update_conference_dict = update_conference_instance.to_dict() # create an instance of UpdateConference from a dict -update_conference_form_dict = update_conference.from_dict(update_conference_dict) +update_conference_from_dict = UpdateConference.from_dict(update_conference_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateConferenceMember.md b/docs/UpdateConferenceMember.md index 06e7246e..484bf85b 100644 --- a/docs/UpdateConferenceMember.md +++ b/docs/UpdateConferenceMember.md @@ -24,7 +24,7 @@ print(UpdateConferenceMember.to_json()) # convert the object into a dict update_conference_member_dict = update_conference_member_instance.to_dict() # create an instance of UpdateConferenceMember from a dict -update_conference_member_form_dict = update_conference_member.from_dict(update_conference_member_dict) +update_conference_member_from_dict = UpdateConferenceMember.from_dict(update_conference_member_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VerifyCodeRequest.md b/docs/VerifyCodeRequest.md index da5bbbaa..89a4651c 100644 --- a/docs/VerifyCodeRequest.md +++ b/docs/VerifyCodeRequest.md @@ -25,7 +25,7 @@ print(VerifyCodeRequest.to_json()) # convert the object into a dict verify_code_request_dict = verify_code_request_instance.to_dict() # create an instance of VerifyCodeRequest from a dict -verify_code_request_form_dict = verify_code_request.from_dict(verify_code_request_dict) +verify_code_request_from_dict = VerifyCodeRequest.from_dict(verify_code_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VerifyCodeResponse.md b/docs/VerifyCodeResponse.md index f66f28d1..a0cb9b65 100644 --- a/docs/VerifyCodeResponse.md +++ b/docs/VerifyCodeResponse.md @@ -22,7 +22,7 @@ print(VerifyCodeResponse.to_json()) # convert the object into a dict verify_code_response_dict = verify_code_response_instance.to_dict() # create an instance of VerifyCodeResponse from a dict -verify_code_response_form_dict = verify_code_response.from_dict(verify_code_response_dict) +verify_code_response_from_dict = VerifyCodeResponse.from_dict(verify_code_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VoiceApiError.md b/docs/VoiceApiError.md index 650bed82..90d6b253 100644 --- a/docs/VoiceApiError.md +++ b/docs/VoiceApiError.md @@ -24,7 +24,7 @@ print(VoiceApiError.to_json()) # convert the object into a dict voice_api_error_dict = voice_api_error_instance.to_dict() # create an instance of VoiceApiError from a dict -voice_api_error_form_dict = voice_api_error.from_dict(voice_api_error_dict) +voice_api_error_from_dict = VoiceApiError.from_dict(voice_api_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VoiceCodeResponse.md b/docs/VoiceCodeResponse.md index 898c1088..0593bce7 100644 --- a/docs/VoiceCodeResponse.md +++ b/docs/VoiceCodeResponse.md @@ -22,7 +22,7 @@ print(VoiceCodeResponse.to_json()) # convert the object into a dict voice_code_response_dict = voice_code_response_instance.to_dict() # create an instance of VoiceCodeResponse from a dict -voice_code_response_form_dict = voice_code_response.from_dict(voice_code_response_dict) +voice_code_response_from_dict = VoiceCodeResponse.from_dict(voice_code_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/openapitools.json b/openapitools.json index 55716882..f227cf2d 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.4.0" + "version": "7.7.0" } } diff --git a/test/integration/__init__.py b/test/smoke/__init__.py similarity index 100% rename from test/integration/__init__.py rename to test/smoke/__init__.py diff --git a/test/integration/bwmatchers/one_of_string.py b/test/smoke/bwmatchers/one_of_string.py similarity index 100% rename from test/integration/bwmatchers/one_of_string.py rename to test/smoke/bwmatchers/one_of_string.py diff --git a/test/integration/test_calls_api.py b/test/smoke/test_calls_api.py similarity index 95% rename from test/integration/test_calls_api.py rename to test/smoke/test_calls_api.py index 9cd2dffa..10b3bf97 100644 --- a/test/integration/test_calls_api.py +++ b/test/smoke/test_calls_api.py @@ -1,5 +1,5 @@ """ -Integration test for Bandwidth's Voice Voice Calls API +Integration test for Bandwidth's Voice Calls API """ from bandwidth import ApiResponse from test.utils.env_variables import * @@ -43,8 +43,8 @@ def setUp(self): password='bad_password' ) unauthorized_api_client = bandwidth.ApiClient(unauthorizedConfiguration) - self.unauthorized_api_instance = calls_api.CallsApi(unauthorized_api_client) - + self.unauthorized_api_instance = calls_api.CallsApi(unauthorized_api_client) + # Forbidden API Client forbiddenConfiguration = bandwidth.Configuration( @@ -52,12 +52,14 @@ def setUp(self): password=FORBIDDEN_PASSWORD ) forbidden_api_client = bandwidth.ApiClient(forbiddenConfiguration) - self.forbidden_api_instance = calls_api.CallsApi(forbidden_api_client) + self.forbidden_api_instance = calls_api.CallsApi(forbidden_api_client) self.account_id = BW_ACCOUNT_ID self.createCallBody = CreateCall( - to=USER_NUMBER, - var_from=BW_NUMBER, - application_id=BW_VOICE_APPLICATION_ID, + to=USER_NUMBER, + var_from=BW_NUMBER, + privacy=True, + display_name="Anonymous", + application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL, answer_method=CallbackMethodEnum("POST"), username="mySecretUsername", @@ -100,7 +102,7 @@ def setUp(self): self.TEST_SLEEP_LONG = 15 def tearDown(self): - callCleanup(self) + callCleanup(self) def assertApiException(self, context: ApiException, expectedException: ApiException, expected_status_code: int): """Validates that common API exceptions, (401, 403, and 404) are properly formatted @@ -140,10 +142,10 @@ def test_create_call_bad_request(self): """Validate a bad (400) request """ call_body = CreateCall(to="invalidNumberFormat", var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL) - + with self.assertRaises(ApiException) as context: self.calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body) - + assert_that(context.exception.status, 400) def test_create_call_unauthorized(self) -> None: @@ -200,20 +202,20 @@ def test_get_call_state_forbidden(self) -> None: with self.assertRaises(ForbiddenException) as context: self.forbidden_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId) - self.assertApiException(context, ForbiddenException, 403) + self.assertApiException(context, ForbiddenException, 403) def test_get_call_state_not_found(self): """Validate an invalid Get Call State Request due to a bad callID """ with self.assertRaises(NotFoundException) as context: self.calls_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId) - + self.assertApiException(context, NotFoundException, 404) def test_update_call(self): """Validate an UpdateCall Request """ - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) call_id = create_call_response.call_id @@ -241,7 +243,7 @@ def test_update_call(self): # hanging-up the call update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) assert_that(update_call_response.status_code, 200) - + def test_update_call_bad_request(self): """Validate a bad (400) update call request """ @@ -251,14 +253,14 @@ def test_update_call_bad_request(self): #Adding the call to the self.callIdArray self.callIdArray.append(call_id) - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) with self.assertRaises(ApiException) as context: badRequestBody = UpdateCall(states="badRequest") self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, badRequestBody) - + assert_that(context.exception.status, 400) - + # hanging-up the call time.sleep(self.TEST_SLEEP) update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) @@ -281,7 +283,7 @@ def test_update_call_forbidden(self): #Adding the call to the self.callIdArray self.callIdArray.append(call_id) - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) with self.assertRaises(ForbiddenException) as context: self.forbidden_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) @@ -298,7 +300,7 @@ def test_update_call_not_found(self): """ with self.assertRaises(NotFoundException) as context: self.calls_api_instance.update_call(BW_ACCOUNT_ID, self.testCallId, self.updateStateCompleted) - + self.assertApiException(context, NotFoundException, 404) def test_update_call_bxml(self): @@ -313,13 +315,13 @@ def test_update_call_bxml(self): time.sleep(self.TEST_SLEEP) update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody) assert_that(update_call_bxml_response.status_code, 204) - - time.sleep(self.TEST_SLEEP) + + time.sleep(self.TEST_SLEEP) # hanging-up the call update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) assert_that(update_call_response.status_code, 200) - def test_update_call_bxml_bad_request(self): + def test_update_call_bxml_bad_request(self): """Validate a bad (400) update call bxml request """ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody) @@ -328,16 +330,16 @@ def test_update_call_bxml_bad_request(self): #Adding the call to the self.callIdArray self.callIdArray.append(call_id) - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) invalidBxmlBody = "invalidBXML" with self.assertRaises(ApiException) as context: self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, invalidBxmlBody) - + assert_that(context.exception.status, 400) - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) # hanging-up the call update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted) assert_that(update_call_response.status_code, 200) @@ -361,7 +363,7 @@ def test_update_call_bxml_forbidden(self): #Adding the call to the self.callIdArray self.callIdArray.append(call_id) - time.sleep(self.TEST_SLEEP) + time.sleep(self.TEST_SLEEP) with self.assertRaises(ForbiddenException) as context: self.forbidden_api_instance.update_call_bxml(BW_ACCOUNT_ID, call_id, self.testBxmlBody) @@ -373,8 +375,8 @@ def test_update_call_bxml_not_found(self): """ with self.assertRaises(NotFoundException) as context: self.calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, self.testCallId, self.testBxmlBody) - - self.assertApiException(context, NotFoundException, 404) + + self.assertApiException(context, NotFoundException, 404) if __name__ == '__main__': unittest.main() diff --git a/test/integration/test_conferences_api.py b/test/smoke/test_conferences_api.py similarity index 99% rename from test/integration/test_conferences_api.py rename to test/smoke/test_conferences_api.py index e222c7b4..4af01266 100644 --- a/test/integration/test_conferences_api.py +++ b/test/smoke/test_conferences_api.py @@ -1,5 +1,5 @@ """ -Integration tests for Bandwidth's Voice Voice Conferences API +Integration tests for Bandwidth's Voice Conferences API """ from cgi import test diff --git a/test/integration/test_media_api.py b/test/smoke/test_media_api.py similarity index 97% rename from test/integration/test_media_api.py rename to test/smoke/test_media_api.py index 06b753af..23147811 100644 --- a/test/integration/test_media_api.py +++ b/test/smoke/test_media_api.py @@ -1,5 +1,5 @@ """ -Integration test for Bandwidth's Media API +Integration test for Bandwidth's Messaging Media API """ import uuid @@ -104,22 +104,22 @@ def deleteMedia(self) -> None: """ api_response_with_http_info = self.api_instance.delete_media_with_http_info( self.account_id, self.media_id) - + logging.debug(api_response_with_http_info) assert_that(api_response_with_http_info.status_code, equal_to(204)) # returns void self.api_instance.delete_media(self.account_id, self.media_id) - + def _steps(self): call_order = ['uploadMedia', 'listMedia', 'getMedia', 'deleteMedia'] - for name in call_order: + for name in call_order: yield name, getattr(self, name) def test_steps(self) -> None: """Test each function from _steps.call_order in specified order """ - + for name, step in self._steps(): step() diff --git a/test/integration/test_messages_api.py b/test/smoke/test_messages_api.py similarity index 96% rename from test/integration/test_messages_api.py rename to test/smoke/test_messages_api.py index 8e5bcb27..074350a0 100644 --- a/test/integration/test_messages_api.py +++ b/test/smoke/test_messages_api.py @@ -1,13 +1,5 @@ """ - Bandwidth - - - Bandwidth's Communication APIs # noqa: E501 - - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech +Integration test for Bandwidth's Messaging API """ import os diff --git a/test/integration/test_mfa_api.py b/test/smoke/test_mfa_api.py similarity index 99% rename from test/integration/test_mfa_api.py rename to test/smoke/test_mfa_api.py index c6c410df..176c08df 100644 --- a/test/integration/test_mfa_api.py +++ b/test/smoke/test_mfa_api.py @@ -79,7 +79,7 @@ def assertAuthException(self, context: Exception, expected_exception: Exception, ) def testSuccessfulMfaGenerateMessagingCodeRequest(self) -> None: - """Test a successful MFA messaging code request + """Test a successful MFA messaging code request """ api_response_with_http_info = self.api_instance.generate_messaging_code_with_http_info( self.account_id, self.messaging_code_request diff --git a/test/integration/test_phone_number_lookup_api.py b/test/smoke/test_phone_number_lookup_api.py similarity index 100% rename from test/integration/test_phone_number_lookup_api.py rename to test/smoke/test_phone_number_lookup_api.py diff --git a/test/integration/test_recordings_api.py b/test/smoke/test_recordings_api.py similarity index 96% rename from test/integration/test_recordings_api.py rename to test/smoke/test_recordings_api.py index 17c9c4bf..4415f2c9 100644 --- a/test/integration/test_recordings_api.py +++ b/test/smoke/test_recordings_api.py @@ -1,14 +1,6 @@ """ - Bandwidth - - Bandwidth's Communication APIs # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by: https://openapi-generator.tech +Integration test for Bandwidth's Voice Recordings API """ - - import os from typing import Dict, List, Tuple import unittest @@ -219,8 +211,8 @@ def test_successful_call_recording(self) -> None: - get_call_recording - download_call_recording - transcribe_call_recording - - get_call_transcription - - delete_call_transcription + - get_recording_transcription + - delete_recording_transcription - delete_recording_media - delete_recording """ @@ -288,7 +280,7 @@ def test_successful_call_recording(self) -> None: assert_that(call_status['callTranscribed'], equal_to(True)) # Get the transcription - transcription_response = self.recordings_api_instance.get_call_transcription_with_http_info( + transcription_response = self.recordings_api_instance.get_recording_transcription_with_http_info( BW_ACCOUNT_ID, call_id, recording_id) assert_that(transcription_response.status_code, equal_to(200)) # Check response code @@ -302,11 +294,11 @@ def test_successful_call_recording(self) -> None: )) # Delete the transcription - delete_transcription_response = self.recordings_api_instance.delete_call_transcription_with_http_info( + delete_transcription_response = self.recordings_api_instance.delete_recording_transcription_with_http_info( BW_ACCOUNT_ID, call_id, recording_id) assert_that(delete_transcription_response.status_code, equal_to(204)) # Check response code - assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args( + assert_that(calling(self.recordings_api_instance.get_recording_transcription).with_args( BW_ACCOUNT_ID, call_id, recording_id), raises(NotFoundException)) # Delete Recording media @@ -454,28 +446,28 @@ def test_4xx_errors(self) -> None: assert_that(call_status['callTranscribed'], equal_to(True)) # Use the unauthorized client to get transcripion (401) - assert_that(calling(self.unauthorized_recordings_api_instance.get_call_transcription).with_args( + assert_that(calling(self.unauthorized_recordings_api_instance.get_recording_transcription).with_args( BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException)) # Non-existent account id (403) - assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args( + assert_that(calling(self.recordings_api_instance.get_recording_transcription).with_args( "not an account id", call_id, recording_id), raises(ForbiddenException)) # Non-existent recording id (404) - assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args( + assert_that(calling(self.recordings_api_instance.get_recording_transcription).with_args( BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException)) # Delete Transcription # Use the unauthorized client to delete transcripion (401) - assert_that(calling(self.unauthorized_recordings_api_instance.delete_call_transcription).with_args( + assert_that(calling(self.unauthorized_recordings_api_instance.delete_recording_transcription).with_args( BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException)) # Non-existent account id (403) - assert_that(calling(self.recordings_api_instance.delete_call_transcription).with_args( + assert_that(calling(self.recordings_api_instance.delete_recording_transcription).with_args( "not an account id", call_id, recording_id), raises(ForbiddenException)) # Non-existent recording id (404) - assert_that(calling(self.recordings_api_instance.delete_call_transcription).with_args( + assert_that(calling(self.recordings_api_instance.delete_recording_transcription).with_args( BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException)) # Delete Recording Media diff --git a/test/smoke/test_statistics_api.py b/test/smoke/test_statistics_api.py new file mode 100644 index 00000000..2e99f0e7 --- /dev/null +++ b/test/smoke/test_statistics_api.py @@ -0,0 +1,41 @@ +""" +Integration test for Bandwidth's Statistics API +""" +import unittest +import logging + +from hamcrest import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.statistics_api import StatisticsApi +from bandwidth.models import AccountStatistics +from test.utils.env_variables import * + + +class TestStatisticsApi(unittest.TestCase): + """StatisticsApi integration Test + """ + + def setUp(self): + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD + ) + self.api_client = ApiClient(configuration) + self.api_instance = StatisticsApi(self.api_client) + self.account_id = BW_ACCOUNT_ID + + def test_get_statistics(self): + api_response_with_http_info = self.api_instance.get_statistics_with_http_info(self.account_id) + + logging.debug(api_response_with_http_info) + assert_that(api_response_with_http_info.status_code, equal_to(200)) + + api_response = self.api_instance.get_statistics(self.account_id) + assert_that(api_response, instance_of(AccountStatistics)) + assert_that(api_response, has_properties( + 'current_call_queue_size', instance_of(int), + 'max_call_queue_size', instance_of(int) + )) + +if __name__ == '__main__': + unittest.main() diff --git a/test/smoke/test_transcriptions_api.py b/test/smoke/test_transcriptions_api.py new file mode 100644 index 00000000..dda936ef --- /dev/null +++ b/test/smoke/test_transcriptions_api.py @@ -0,0 +1,154 @@ +""" +Integration test for Bandwidth's Voice Transcriptions API +""" +import unittest +import time + +from hamcrest import * +from bandwidth import ApiClient, Configuration +from bandwidth.rest import RESTClientObject, RESTResponse +from bandwidth.api.transcriptions_api import TranscriptionsApi +from bandwidth.api.calls_api import CallsApi +from bandwidth.models import CreateCall, CallTranscriptionMetadata, CallTranscriptionResponse, CallTranscription +from test.utils.env_variables import * + + +class TestTranscriptionsApi(unittest.TestCase): + """TranscriptionsApi integration Test""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD + ) + api_client = ApiClient(configuration) + + self.calls_api_instance = CallsApi(api_client) + self.transcriptions_api_instance = TranscriptionsApi(api_client) + + # Rest client for interacting with Manteca + self.rest_client = RESTClientObject(Configuration.get_default_copy()) + + # Call ID Array + self.callIdArray = [] + self.SLEEP_TIME_SEC = 3 + + # Transcription ID + self.transcription_id: str + + def create_call_transcription(self) -> None: + + # Initialize the call with Manteca + response = self.rest_client.request( + method='POST', + url=MANTECA_BASE_URL + '/tests', + body={ + 'os': OPERATING_SYSTEM, + 'language': 'python' + PYTHON_VERSION, + 'type': 'CALL' + }, + headers={ + 'Content-Type': 'application/json' + } + ) + + # Get the test id from the response + test_id = response.response.data.decode("utf-8") + answer_url = MANTECA_BASE_URL + '/bxml/idle' + + # Make a CreateCall body and assign the appropriate params + call_body = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER, + application_id=MANTECA_APPLICATION_ID, answer_url=answer_url, tag=test_id) + + # Make the call + create_call_response: CreateCallResponse = self.calls_api_instance.create_call( + BW_ACCOUNT_ID, call_body) + # assert_that(create_call_response.status_code, equal_to(201)) + + # Get the call id from the response + self.call_id = create_call_response.call_id + + # Adding the call to the callIdArray + self.callIdArray.append(create_call_response.call_id) + + + time.sleep(self.SLEEP_TIME_SEC) + start_transcription_bxml = "" + start_response = self.calls_api_instance.update_call_bxml_with_http_info( + BW_ACCOUNT_ID, self.call_id, start_transcription_bxml) + assert_that(start_response.status_code, equal_to(204)) + + stop_transcription_bxml = "" + stop_response = self.calls_api_instance.update_call_bxml_with_http_info( + BW_ACCOUNT_ID, self.call_id, stop_transcription_bxml) + assert_that(stop_response.status_code, equal_to(204)) + time.sleep(self.SLEEP_TIME_SEC) + + end_response = self.calls_api_instance.update_call_with_http_info( + BW_ACCOUNT_ID, self.call_id, {"state": "completed"}) + assert_that(end_response.status_code, equal_to(200)) + + def list_real_time_transcriptions(self) -> None: + """Test case for list_real_time_transcriptions + + Enumerate transcriptions made with StartTranscription + """ + time.sleep(self.SLEEP_TIME_SEC * 20) + response = self.transcriptions_api_instance.list_real_time_transcriptions_with_http_info( + BW_ACCOUNT_ID, self.call_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(CallTranscriptionMetadata)) + assert_that(response.data[0].transcription_id, instance_of(str)) + assert_that(response.data[0].transcription_url, instance_of(str)) + + self.transcription_id = response.data[0].transcription_id + + def get_real_time_transcription(self) -> None: + """Test case for get_real_time_transcription + + Retrieve a specific transcription + """ + response = self.transcriptions_api_instance.get_real_time_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.transcription_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(CallTranscriptionResponse)) + assert_that(response.data.account_id, equal_to(BW_ACCOUNT_ID)) + assert_that(response.data.call_id, equal_to(self.call_id)) + assert_that(response.data.transcription_id, equal_to(self.transcription_id)) + assert_that(response.data.tracks, instance_of(list)) + assert_that(response.data.tracks[0], instance_of(CallTranscription)) + assert_that(response.data.tracks[0].track, equal_to('inbound')) + assert_that(response.data.tracks[0].confidence, instance_of(float)) + + def delete_real_time_transcription(self) -> None: + """Test case for delete_real_time_transcription + + Delete a specific transcription + """ + response = self.transcriptions_api_instance.delete_real_time_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.transcription_id) + + assert_that(response.status_code, equal_to(200)) + + def _steps(self): + call_order = [ + 'create_call_transcription', + 'list_real_time_transcriptions', + 'get_real_time_transcription', + 'delete_real_time_transcription' + ] + for name in call_order: + yield name, getattr(self, name) + + def test_steps(self) -> None: + """Test each function from _steps.call_order in specified order + """ + + for name, step in self._steps(): + step() + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/bxml/__init__.py b/test/unit/api/__init__.py similarity index 100% rename from test/unit/bxml/__init__.py rename to test/unit/api/__init__.py diff --git a/test/unit/api/test_calls_api.py b/test/unit/api/test_calls_api.py new file mode 100644 index 00000000..5770f8bd --- /dev/null +++ b/test/unit/api/test_calls_api.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.calls_api import CallsApi +from bandwidth.models.call_state import CallState +from bandwidth.models.call_state_enum import CallStateEnum +from bandwidth.models.update_call import UpdateCall +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.create_call import CreateCall +from bandwidth.models.create_call_response import CreateCallResponse +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum +from bandwidth.models.callback_method_enum import CallbackMethodEnum + + + +class TestCallsApi(unittest.TestCase): + """CallsApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.calls_api_instance = CallsApi(api_client) + + def test_create_call(self) -> None: + """Test case for create_call + + Create Call + """ + call_body = CreateCall( + to=USER_NUMBER, + var_from=BW_NUMBER, + application_id=BW_VOICE_APPLICATION_ID, + answer_url=BASE_CALLBACK_URL, + answer_method=CallbackMethodEnum("POST"), + username="mySecretUsername", + password="mySecretPassword1!", + answer_fallback_url="https://www.myFallbackServer.com/webhooks/answer", + answer_fallback_method=CallbackMethodEnum("POST"), + fallback_username="mySecretUsername", + fallback_password="mySecretPassword1!", + disconnect_url="https://myServer.com/bandwidth/webhooks/disconnectUrl", + disconnect_method=CallbackMethodEnum("POST"), + call_timeout=30.0, + callback_timeout=15.0, + machine_detection=MachineDetectionConfiguration( + mode=MachineDetectionModeEnum("async"), + detection_timeout=15.0, + silence_timeout=10.0, + speech_threshold=10.0, + speech_end_threshold=5.0, + machine_speech_end_threshold=5.0, + delay_result=False, + callback_url="https://myServer.com/bandwidth/webhooks/machineDetectionComplete", + callback_method=CallbackMethodEnum("POST"), + username="mySecretUsername", + password="mySecretPassword1!", + fallback_url="https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete", + fallback_method=CallbackMethodEnum("POST"), + fallback_username="mySecretUsername", + fallback_password="mySecretPassword1!", + ), + priority=5, + tag="tag_example", + ) + response = self.calls_api_instance.create_call_with_http_info( + BW_ACCOUNT_ID, + call_body + ) + + assert_that(response.status_code, equal_to(201)) + assert_that(response.data, instance_of(CreateCallResponse)) + assert_that(response.data.application_id, has_length(36)) + assert_that(response.data.account_id, has_length(7)) + assert_that(response.data.call_id, has_length(47)) + assert_that(response.data.to, has_length(12)) + assert_that(response.data.var_from, has_length(12)) + assert_that(response.data.enqueued_time, instance_of(datetime)) + assert_that(response.data.call_url, starts_with('http')) + assert_that(response.data.call_timeout, greater_than(0)) + assert_that(response.data.callback_timeout, greater_than(0)) + assert_that(response.data.tag, instance_of(str)) + assert_that(response.data.answer_method, is_in(CallbackMethodEnum)) + assert_that(response.data.answer_url, starts_with('http')) + assert_that(response.data.answer_fallback_method, is_in(CallbackMethodEnum)) + assert_that(response.data.answer_fallback_url, starts_with('http')) + assert_that(response.data.disconnect_method, is_in(CallbackMethodEnum)) + assert_that(response.data.disconnect_url, starts_with('http')) + assert_that(response.data.username, instance_of(str)) + assert_that(response.data.password, instance_of(str)) + assert_that(response.data.fallback_username, instance_of(str)) + assert_that(response.data.fallback_password, instance_of(str)) + assert_that(response.data.priority, greater_than(0)) + + + def test_get_call_state(self) -> None: + """Test case for get_call_state + + Get Call State Information + """ + response = self.calls_api_instance.get_call_state_with_http_info( + BW_ACCOUNT_ID, + "c-abc123" + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(CallState)) + assert_that(response.data.application_id, has_length(36)) + assert_that(response.data.account_id, has_length(7)) + assert_that(response.data.call_id, has_length(47)) + assert_that(response.data.parent_call_id, has_length(47)) + assert_that(response.data.to, has_length(12)) + assert_that(response.data.var_from, has_length(12)) + assert_that(response.data.direction, is_in(CallDirectionEnum)) + assert_that(response.data.state, instance_of(str)) + assert_that(response.data.stir_shaken, instance_of(object)) + assert_that(response.data.identity, instance_of(str)) + assert_that(response.data.enqueued_time, instance_of(datetime)) + assert_that(response.data.start_time, instance_of(datetime)) + assert_that(response.data.answer_time, instance_of(datetime)) + assert_that(response.data.end_time, instance_of(datetime)) + assert_that(response.data.disconnect_cause, instance_of(str)) + assert_that(response.data, has_property('error_message')) + assert_that(response.data, has_property('error_id')) + assert_that(response.data.last_update, instance_of(datetime)) + + def test_list_calls(self) -> None: + """Test case for list_calls + + Get Calls + """ + response = self.calls_api_instance.list_calls_with_http_info( + BW_ACCOUNT_ID + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(CallState)) + assert_that(response.data[0].application_id, has_length(36)) + assert_that(response.data[0].account_id, has_length(7)) + assert_that(response.data[0].call_id, has_length(47)) + assert_that(response.data[0].parent_call_id, has_length(47)) + assert_that(response.data[0].to, has_length(12)) + assert_that(response.data[0].var_from, has_length(12)) + assert_that(response.data[0].direction, is_in(CallDirectionEnum)) + assert_that(response.data[0].state, instance_of(str)) + assert_that(response.data[0].stir_shaken, instance_of(object)) + assert_that(response.data[0].identity, instance_of(str)) + assert_that(response.data[0].enqueued_time, instance_of(datetime)) + assert_that(response.data[0].start_time, instance_of(datetime)) + assert_that(response.data[0].answer_time, instance_of(datetime)) + assert_that(response.data[0].end_time, instance_of(datetime)) + assert_that(response.data[0].disconnect_cause, instance_of(str)) + assert_that(response.data[0], has_property('error_message')) + assert_that(response.data[0], has_property('error_id')) + assert_that(response.data[0].last_update, instance_of(datetime)) + + def test_update_call(self) -> None: + """Test case for update_call + + Update Call + """ + update_call_body = UpdateCall( + state=CallStateEnum("active"), + redirect_url="https://myServer.com/bandwidth/webhooks/redirect", + ) + + response = self.calls_api_instance.update_call_with_http_info( + BW_ACCOUNT_ID, + "c-abc123", + update_call_body + ) + + assert_that(response.status_code, equal_to(200)) + + def test_update_call_bxml(self) -> None: + """Test case for update_call_bxml + + Update Call BXML + """ + update_call_bxml = 'This is a test bxml response' + + response = self.calls_api_instance.update_call_bxml_with_http_info( + BW_ACCOUNT_ID, + "c-abc123", + update_call_bxml + ) + + assert_that(response.status_code, equal_to(204)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_conferences_api.py b/test/unit/api/test_conferences_api.py new file mode 100644 index 00000000..d44a901f --- /dev/null +++ b/test/unit/api/test_conferences_api.py @@ -0,0 +1,194 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.conferences_api import ConferencesApi +from bandwidth.models.conference import Conference +from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.conference_member import ConferenceMember +from bandwidth.models.update_conference import UpdateConference +from bandwidth.models.conference_state_enum import ConferenceStateEnum +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata +from bandwidth.models.file_format_enum import FileFormatEnum + + +class TestConferencesApi(unittest.TestCase): + """ConferencesApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.conferences_api_instance = ConferencesApi(api_client) + + def test_list_conferences(self) -> None: + """Test case for list_conferences + + Get Conferences + """ + response = self.conferences_api_instance.list_conferences_with_http_info(BW_ACCOUNT_ID) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(Conference)) + assert_that(response.data[0].id, has_length(50)) + assert_that(response.data[0].name, instance_of(str)) + assert_that(response.data[0].created_time, instance_of(datetime)) + assert_that(response.data[0].completed_time, instance_of(datetime)) + assert_that(response.data[0].conference_event_url, starts_with('http')) + assert_that(response.data[0].conference_event_method, is_in(CallbackMethodEnum)) + assert_that(response.data[0].tag, instance_of(str)) + + def test_get_conference(self) -> None: + """Test case for get_conference + + Get Conference Information + """ + response = self.conferences_api_instance.get_conference_with_http_info(BW_ACCOUNT_ID, 'conferenceId') + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(Conference)) + assert_that(response.data.id, has_length(50)) + assert_that(response.data.name, instance_of(str)) + assert_that(response.data.created_time, instance_of(datetime)) + assert_that(response.data.completed_time, instance_of(datetime)) + assert_that(response.data.conference_event_url, starts_with('http')) + assert_that(response.data.conference_event_method, is_in(CallbackMethodEnum)) + assert_that(response.data.tag, instance_of(str)) + + def test_get_conference_member(self) -> None: + """Test case for get_conference_member + + Get Conference Member + """ + response = self.conferences_api_instance.get_conference_member_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', 'memberId') + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ConferenceMember)) + assert_that(response.data.call_id, has_length(47)) + assert_that(response.data.conference_id, has_length(50)) + assert_that(response.data.member_url, starts_with('http')) + assert_that(response.data.mute, instance_of(bool)) + assert_that(response.data.hold, instance_of(bool)) + assert_that(response.data.call_ids_to_coach, instance_of(list)) + + def test_update_conference_member(self) -> None: + """Test case for update_conference_member + + Update Conference Member + """ + update_conference_member = { 'mute': True } + + response = self.conferences_api_instance.update_conference_member_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', 'memberId', update_conference_member) + + assert_that(response.status_code, equal_to(204)) + + def test_update_conference(self) -> None: + """Test case for update_conference + + Update Conference + """ + update_conference = UpdateConference( + status=ConferenceStateEnum('active') + ) + + response = self.conferences_api_instance.update_conference_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', update_conference) + + assert_that(response.status_code, equal_to(204)) + + def test_update_conference_bxml(self) -> None: + """Test case for update_conference_bxml + + Update Conference BXML + """ + update_conference_bxml = 'updateConferenceBxml' + + response = self.conferences_api_instance.update_conference_bxml_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', update_conference_bxml) + + assert_that(response.status_code, equal_to(204)) + + def test_list_conference_recordings(self) -> None: + """Test case for list_conference_recordings + + Get Conference Recordings + """ + response = self.conferences_api_instance.list_conference_recordings_with_http_info(BW_ACCOUNT_ID, 'conferenceId') + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(ConferenceRecordingMetadata)) + assert_that(response.data[0].account_id, has_length(7)) + assert_that(response.data[0].conference_id, has_length(50)) + assert_that(response.data[0].name, instance_of(str)) + assert_that(response.data[0].recording_id, has_length(47)) + assert_that(response.data[0].duration, starts_with('PT')) + assert_that(response.data[0].channels, instance_of(int)) + assert_that(response.data[0].start_time, instance_of(datetime)) + assert_that(response.data[0].end_time, instance_of(datetime)) + assert_that(response.data[0].file_format, is_in(FileFormatEnum)) + assert_that(response.data[0].status, instance_of(str)) + assert_that(response.data[0].media_url, starts_with('http')) + + def test_get_conference_recording(self) -> None: + """Test case for get_conference_recording + + Get Conference Recording Information + """ + response = self.conferences_api_instance.get_conference_recording_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', 'recordingId') + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(ConferenceRecordingMetadata)) + assert_that(response.data.account_id, has_length(7)) + assert_that(response.data.conference_id, has_length(50)) + assert_that(response.data.name, instance_of(str)) + assert_that(response.data.recording_id, has_length(47)) + assert_that(response.data.duration, starts_with('PT')) + assert_that(response.data.channels, instance_of(int)) + assert_that(response.data.start_time, instance_of(datetime)) + assert_that(response.data.end_time, instance_of(datetime)) + assert_that(response.data.file_format, is_in(FileFormatEnum)) + assert_that(response.data.status, instance_of(str)) + assert_that(response.data.media_url, starts_with('http')) + + def test_download_conference_recording(self) -> None: + """Test case for download_conference_recording + + Download Conference Recording + """ + response = self.conferences_api_instance.download_conference_recording_with_http_info( + BW_ACCOUNT_ID, 'conferenceId', 'recordingId', _headers={'Accept': 'audio/vnd.wave'}) + # might be an issue with the client, cause I think the accept header gets written to + # application/json no matter what + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(bytes)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_media_api.py b/test/unit/api/test_media_api.py new file mode 100644 index 00000000..53632a7a --- /dev/null +++ b/test/unit/api/test_media_api.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.media_api import MediaApi +from bandwidth.models.media import Media + + +class TestMediaApi(unittest.TestCase): + """MediaApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.media_api_instance = MediaApi(api_client) + + def test_upload_media(self) -> None: + """Test case for upload_media + + Upload Media + """ + file = open("./test/fixtures/python_cat.jpeg", "rb") + response = self.media_api_instance.upload_media_with_http_info( + account_id=BW_ACCOUNT_ID, + media_id='media_name.jpeg', + body=bytes(file.read()), + _content_type='image/jpeg', + cache_control='no-cache' + ) + + assert_that(response.status_code, equal_to(204)) + + def test_list_media(self) -> None: + """Test case for list_media + + List Media + """ + response = self.media_api_instance.list_media_with_http_info(BW_ACCOUNT_ID) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(Media)) + assert_that(response.data[0].content, instance_of(str)) + assert_that(response.data[0].content_length, instance_of(int)) + assert_that(response.data[0].media_name, instance_of(str)) + + def test_get_media(self) -> None: + """Test case for get_media + + Get Media + """ + response = self.media_api_instance.get_media_with_http_info( + BW_ACCOUNT_ID, 'media_name.jpeg', _headers={'Accept': 'application/octet-stream'}) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(bytes)) + + def test_delete_media(self) -> None: + """Test case for delete_media + + Delete Media + """ + response = self.media_api_instance.delete_media_with_http_info(BW_ACCOUNT_ID, 'media_name.jpeg') + + assert_that(response.status_code, equal_to(204)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_messages_api.py b/test/unit/api/test_messages_api.py new file mode 100644 index 00000000..0e477c4f --- /dev/null +++ b/test/unit/api/test_messages_api.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.messages_api import MessagesApi +from bandwidth.models.message_request import MessageRequest +from bandwidth.models.message import Message +from bandwidth.models.messages_list import MessagesList +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.message_status_enum import MessageStatusEnum +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum +from bandwidth.models.message_type_enum import MessageTypeEnum +from bandwidth.models.page_info import PageInfo + + +class TestMessagesApi(unittest.TestCase): + """MessagesApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.messages_api_instance = MessagesApi(api_client) + + def test_create_message(self) -> None: + """Test case for create_message + + Create Message + """ + message_request = MessageRequest( + application_id=BW_MESSAGING_APPLICATION_ID, + to=[USER_NUMBER], + var_from=BW_NUMBER, + text="Hello from Bandwidth" + ) + response = self.messages_api_instance.create_message_with_http_info(BW_ACCOUNT_ID, message_request) + + assert_that(response.status_code, equal_to(202)) + assert_that(response.data, instance_of(Message)) + assert_that(response.data.id, has_length(29)) + assert_that(response.data.owner, has_length(12)) + assert_that(response.data.application_id, has_length(36)) + assert_that(response.data.time, instance_of(datetime)) + assert_that(response.data.segment_count, instance_of(int)) + assert_that(response.data.direction, is_in(MessageDirectionEnum)) + assert_that(response.data.to, instance_of(list)) + assert_that(response.data.to[0], has_length(12)) + assert_that(response.data.var_from, has_length(12)) + assert_that(response.data.media, instance_of(list)) + assert_that(response.data.media[0], starts_with('http')) + assert_that(response.data.text, instance_of(str)) + assert_that(response.data.tag, instance_of(str)) + assert_that(response.data.priority, is_in(PriorityEnum)) + assert_that(response.data.expiration, instance_of(datetime)) + + def test_list_messages(self) -> None: + """Test case for list_messages + + List Messages + """ + response = self.messages_api_instance.list_messages_with_http_info(BW_ACCOUNT_ID) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(MessagesList)) + assert_that(response.data.total_count, instance_of(int)) + assert_that(response.data.page_info, instance_of(PageInfo)) + assert_that(response.data.page_info.prev_page, starts_with('http')) + assert_that(response.data.page_info.next_page, starts_with('http')) + assert_that(response.data.page_info.prev_page_token, instance_of(str)) + assert_that(response.data.page_info.next_page_token, instance_of(str)) + assert_that(response.data.messages, instance_of(list)) + assert_that(response.data.messages[0].message_id, has_length(29)) + assert_that(response.data.messages[0].account_id, has_length(7)) + assert_that(response.data.messages[0].source_tn, has_length(12)) + assert_that(response.data.messages[0].destination_tn, has_length(12)) + assert_that(response.data.messages[0].message_status, is_in(MessageStatusEnum)) + assert_that(response.data.messages[0].message_direction, is_in(ListMessageDirectionEnum)) + assert_that(response.data.messages[0].message_type, is_in(MessageTypeEnum)) + assert_that(response.data.messages[0].segment_count, instance_of(int)) + assert_that(response.data.messages[0].error_code, instance_of(int)) + assert_that(response.data.messages[0].receive_time, instance_of(datetime)) + assert_that(response.data.messages[0].carrier_name, instance_of(str)) + assert_that(response.data.messages[0].message_size, instance_of(int)) + assert_that(response.data.messages[0].message_length, instance_of(int)) + assert_that(response.data.messages[0].attachment_count, instance_of(int)) + assert_that(response.data.messages[0].recipient_count, instance_of(int)) + assert_that(response.data.messages[0].campaign_class, instance_of(str)) + assert_that(response.data.messages[0].campaign_id, instance_of(str)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_mfa_api.py b/test/unit/api/test_mfa_api.py new file mode 100644 index 00000000..06462597 --- /dev/null +++ b/test/unit/api/test_mfa_api.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.mfa_api import MFAApi +from bandwidth.models.code_request import CodeRequest +from bandwidth.models.messaging_code_response import MessagingCodeResponse +from bandwidth.models.voice_code_response import VoiceCodeResponse +from bandwidth.models.verify_code_request import VerifyCodeRequest +from bandwidth.models.verify_code_response import VerifyCodeResponse + + +class TestMFAApi(unittest.TestCase): + """MFAApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.mfa_api_instance = MFAApi(api_client) + + def test_generate_messaging_code(self) -> None: + """Test case for generate_messaging_code + + Messaging Authentication Code + """ + code_request = CodeRequest( + application_id=BW_MESSAGING_APPLICATION_ID, + to=USER_NUMBER, + var_from=BW_NUMBER, + message="Your temporary {NAME} {SCOPE} code is {CODE}", + digits=6 + ) + + response = self.mfa_api_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, code_request) + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(MessagingCodeResponse)) + assert_that(response.data.message_id, has_length(29)) + + def test_generate_voice_code(self) -> None: + """Test case for generate_voice_code + + Voice Authentication Code + """ + code_request = CodeRequest( + application_id=BW_VOICE_APPLICATION_ID, + to=USER_NUMBER, + var_from=BW_NUMBER, + message="Your temporary {NAME} {SCOPE} code is {CODE}", + digits=6 + ) + + response = self.mfa_api_instance.generate_voice_code_with_http_info(BW_ACCOUNT_ID, code_request) + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(VoiceCodeResponse)) + assert_that(response.data.call_id, has_length(47)) + + def test_verify_code(self) -> None: + """Test case for verify_code + + Verify Authentication Code + """ + verify_request = VerifyCodeRequest( + to=USER_NUMBER, + scope='2FA', + expiration_time_in_minutes=3, + code='12345' + ) + + response = self.mfa_api_instance.verify_code_with_http_info(BW_ACCOUNT_ID, verify_request) + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(VerifyCodeResponse)) + assert_that(response.data.valid, instance_of(bool)) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_phone_number_lookup_api.py b/test/unit/api/test_phone_number_lookup_api.py new file mode 100644 index 00000000..ce39af50 --- /dev/null +++ b/test/unit/api/test_phone_number_lookup_api.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi +from bandwidth.models.lookup_request import LookupRequest +from bandwidth.models.create_lookup_response import CreateLookupResponse +from bandwidth.models.lookup_status_enum import LookupStatusEnum +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.models.lookup_result import LookupResult + + +class TestPhoneNumberLookupApi(unittest.TestCase): + """PhoneNumberLookupApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.phone_number_lookup_api_instance = PhoneNumberLookupApi(api_client) + + def test_create_lookup(self) -> None: + """Test case for create_lookup + + Create Lookup + """ + lookup_request = LookupRequest(tns=[BW_NUMBER]) + + response = self.phone_number_lookup_api_instance.create_lookup_with_http_info(BW_ACCOUNT_ID, lookup_request) + + assert_that(response.status_code, equal_to(202)) + assert_that(response.data, instance_of(CreateLookupResponse)) + assert_that(response.data.request_id, has_length(36)) + assert_that(response.data.status, is_in(LookupStatusEnum)) + + def test_get_lookup_status(self) -> None: + """Test case for get_lookup_status + + Get Lookup Request Status + """ + response = self.phone_number_lookup_api_instance.get_lookup_status_with_http_info( + BW_ACCOUNT_ID, + 'request-id', + _headers={'Prefer': 'example=lookupMultipleNumbersPartialCompleteExample'} + ) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(LookupStatus)) + assert_that(response.data.request_id, has_length(36)) + assert_that(response.data.status, is_in(LookupStatusEnum)) + assert_that(response.data.result, instance_of(list)) + assert_that(response.data.result[0], instance_of(LookupResult)) + assert_that(response.data.result[0].response_code, instance_of(int)) + assert_that(response.data.result[0].message, instance_of(str)) + assert_that(response.data.result[0].e_164_format, has_length(12)) + assert_that(response.data.result[0].formatted, has_length(14)) + assert_that(response.data.result[0].country, instance_of(str)) + assert_that(response.data.result[0].line_type, instance_of(str)) + assert_that(response.data.result[0].line_provider, instance_of(str)) + assert_that(response.data.result[0].mobile_country_code, instance_of(str)) + assert_that(response.data.result[0].mobile_network_code, instance_of(str)) + assert_that(response.data.failed_telephone_numbers, instance_of(list)) + assert_that(response.data.failed_telephone_numbers[0], instance_of(str)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_recordings_api.py b/test/unit/api/test_recordings_api.py new file mode 100644 index 00000000..5a9ce298 --- /dev/null +++ b/test/unit/api/test_recordings_api.py @@ -0,0 +1,236 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.recordings_api import RecordingsApi +from bandwidth.models.update_call_recording import UpdateCallRecording +from bandwidth.models.recording_state_enum import RecordingStateEnum +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.call_direction_enum import CallDirectionEnum +from bandwidth.models.file_format_enum import FileFormatEnum +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata +from bandwidth.models.recording_transcriptions import RecordingTranscriptions +from bandwidth.models.transcription import Transcription +from bandwidth.models.transcribe_recording import TranscribeRecording + + +class TestRecordingsApi(unittest.TestCase): + """RecordingsApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.recordings_api_instance = RecordingsApi(api_client) + + self.call_id = "c-1234" + self.recording_id = "r-1234" + + def test_update_call_recording_state(self) -> None: + """Test case for update_call_recording_state + + Update Recording + """ + update_call_recording = UpdateCallRecording( + state=RecordingStateEnum("paused") + ) + + response = self.recordings_api_instance.update_call_recording_state_with_http_info( + BW_ACCOUNT_ID, self.call_id, update_call_recording) + + assert_that(response.status_code, equal_to(200)) + + def test_list_account_call_recordings(self) -> None: + """Test case for list_account_call_recordings + + Get Call Recordings + """ + response = self.recordings_api_instance.list_account_call_recordings_with_http_info(BW_ACCOUNT_ID) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(CallRecordingMetadata)) + assert_that(response.data[0].application_id, has_length(36)) + assert_that(response.data[0].account_id, has_length(7)) + assert_that(response.data[0].call_id, has_length(47)) + assert_that(response.data[0].parent_call_id, has_length(47)) + assert_that(response.data[0].recording_id, has_length(47)) + assert_that(response.data[0].to, has_length(12)) + assert_that(response.data[0].var_from, has_length(12)) + assert_that(response.data[0].transfer_caller_id, has_length(12)) + assert_that(response.data[0].transfer_to, has_length(12)) + assert_that(response.data[0].duration, starts_with('PT')) + assert_that(response.data[0].direction, is_in(CallDirectionEnum)) + assert_that(response.data[0].channels, instance_of(int)) + assert_that(response.data[0].start_time, instance_of(datetime)) + assert_that(response.data[0].end_time, instance_of(datetime)) + assert_that(response.data[0].file_format, is_in(FileFormatEnum)) + assert_that(response.data[0].status, instance_of(str)) + assert_that(response.data[0].media_url, starts_with('http')) + assert_that(response.data[0].transcription, instance_of(RecordingTranscriptionMetadata)) + assert_that(response.data[0].transcription.id, has_length(38)) + assert_that(response.data[0].transcription.status, instance_of(str)) + assert_that(response.data[0].transcription.completed_time, instance_of(datetime)) + assert_that(response.data[0].transcription.url, starts_with('http')) + + def test_list_call_recordings(self) -> None: + """Test case for list_call_recordings + + List Call Recordings + """ + response = self.recordings_api_instance.list_call_recordings_with_http_info(BW_ACCOUNT_ID, self.call_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(CallRecordingMetadata)) + assert_that(response.data[0].application_id, has_length(36)) + assert_that(response.data[0].account_id, has_length(7)) + assert_that(response.data[0].call_id, has_length(47)) + assert_that(response.data[0].parent_call_id, has_length(47)) + assert_that(response.data[0].recording_id, has_length(47)) + assert_that(response.data[0].to, has_length(12)) + assert_that(response.data[0].var_from, has_length(12)) + assert_that(response.data[0].transfer_caller_id, has_length(12)) + assert_that(response.data[0].transfer_to, has_length(12)) + assert_that(response.data[0].duration, starts_with('PT')) + assert_that(response.data[0].direction, is_in(CallDirectionEnum)) + assert_that(response.data[0].channels, instance_of(int)) + assert_that(response.data[0].start_time, instance_of(datetime)) + assert_that(response.data[0].end_time, instance_of(datetime)) + assert_that(response.data[0].file_format, is_in(FileFormatEnum)) + assert_that(response.data[0].status, instance_of(str)) + assert_that(response.data[0].media_url, starts_with('http')) + assert_that(response.data[0].transcription, instance_of(RecordingTranscriptionMetadata)) + assert_that(response.data[0].transcription.id, has_length(38)) + assert_that(response.data[0].transcription.status, instance_of(str)) + assert_that(response.data[0].transcription.completed_time, instance_of(datetime)) + assert_that(response.data[0].transcription.url, starts_with('http')) + + def test_get_call_recording(self) -> None: + """Test case for get_call_recording + + Get Call Recording + """ + response = self.recordings_api_instance.get_call_recording_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(CallRecordingMetadata)) + assert_that(response.data.application_id, has_length(36)) + assert_that(response.data.account_id, has_length(7)) + assert_that(response.data.call_id, has_length(47)) + assert_that(response.data.parent_call_id, has_length(47)) + assert_that(response.data.recording_id, has_length(47)) + assert_that(response.data.to, has_length(12)) + assert_that(response.data.var_from, has_length(12)) + assert_that(response.data.transfer_caller_id, has_length(12)) + assert_that(response.data.transfer_to, has_length(12)) + assert_that(response.data.duration, starts_with('PT')) + assert_that(response.data.direction, is_in(CallDirectionEnum)) + assert_that(response.data.channels, instance_of(int)) + assert_that(response.data.start_time, instance_of(datetime)) + assert_that(response.data.end_time, instance_of(datetime)) + assert_that(response.data.file_format, is_in(FileFormatEnum)) + assert_that(response.data.status, instance_of(str)) + assert_that(response.data.media_url, starts_with('http')) + assert_that(response.data.transcription, instance_of(RecordingTranscriptionMetadata)) + assert_that(response.data.transcription.id, has_length(38)) + assert_that(response.data.transcription.status, instance_of(str)) + assert_that(response.data.transcription.completed_time, instance_of(datetime)) + assert_that(response.data.transcription.url, starts_with('http')) + + def test_download_call_recording(self) -> None: + """Test case for download_call_recording + + Download Recording + """ + response = self.recordings_api_instance.download_call_recording_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id, _headers={'Accept': 'audio/vnd.wave'}) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(bytes)) + + def test_transcribe_call_recording(self) -> None: + """Test case for transcribe_call_recording + + Create Transcription Request + """ + transcribe_recording = TranscribeRecording( + callback_url="http://callback.url", + tag="tag" + ) + + response = self.recordings_api_instance.transcribe_call_recording_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id, transcribe_recording) + + assert_that(response.status_code, equal_to(204)) + + def test_get_recording_transcription(self) -> None: + """Test case for get_recording_transcription + + Get Transcription + """ + response = self.recordings_api_instance.get_recording_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(RecordingTranscriptions)) + assert_that(response.data.transcripts, instance_of(list)) + assert_that(response.data.transcripts[0], instance_of(Transcription)) + assert_that(response.data.transcripts[0].text, instance_of(str)) + assert_that(response.data.transcripts[0].confidence, instance_of(float)) + + def test_delete_recording_transcription(self) -> None: + """Test case for delete_recording_transcription + + Delete Transcription + """ + response = self.recordings_api_instance.delete_recording_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id) + + assert_that(response.status_code, equal_to(204)) + + def test_delete_recording_media(self) -> None: + """Test case for delete_recording_media + + Delete Recording Media + """ + response = self.recordings_api_instance.delete_recording_media_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id) + + assert_that(response.status_code, equal_to(204)) + + def test_delete_recording(self) -> None: + """Test case for delete_recording + + Delete Recording + """ + response = self.recordings_api_instance.delete_recording_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.recording_id) + + assert_that(response.status_code, equal_to(204)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_statistics_api.py b/test/unit/api/test_statistics_api.py new file mode 100644 index 00000000..42ab61dc --- /dev/null +++ b/test/unit/api/test_statistics_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.statistics_api import StatisticsApi +from bandwidth.models.account_statistics import AccountStatistics + + +class TestStatisticsApi(unittest.TestCase): + """StatisticsApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.statistics_api_instance = StatisticsApi(api_client) + + def test_get_statistics(self) -> None: + """Test case for get_statistics + + Get Account Statistics + """ + response = self.statistics_api_instance.get_statistics_with_http_info(BW_ACCOUNT_ID) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(AccountStatistics)) + assert_that(response.data.current_call_queue_size, instance_of(int)) + assert_that(response.data.max_call_queue_size, instance_of(int)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/api/test_transcriptions_api.py b/test/unit/api/test_transcriptions_api.py new file mode 100644 index 00000000..068448de --- /dev/null +++ b/test/unit/api/test_transcriptions_api.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.transcriptions_api import TranscriptionsApi +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata +from bandwidth.models.call_transcription_response import CallTranscriptionResponse +from bandwidth.models.call_transcription_detected_language_enum import CallTranscriptionDetectedLanguageEnum +from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum +from bandwidth.models.call_transcription import CallTranscription + + +class TestTranscriptionsApi(unittest.TestCase): + """TranscriptionsApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.transcriptions_api_instance = TranscriptionsApi(api_client) + + self.call_id = "c-abc123" + self.transcription_id = "t-abc123" + + def test_list_real_time_transcriptions(self) -> None: + """Test case for list_real_time_transcriptions + + Enumerate transcriptions made with StartTranscription + """ + response = self.transcriptions_api_instance.list_real_time_transcriptions_with_http_info( + BW_ACCOUNT_ID, self.call_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(list)) + assert_that(response.data[0], instance_of(CallTranscriptionMetadata)) + assert_that(response.data[0].transcription_id, instance_of(str)) + assert_that(response.data[0].transcription_url, instance_of(str)) + + def test_get_real_time_transcription(self) -> None: + """Test case for get_real_time_transcription + + Retrieve a specific transcription + """ + response = self.transcriptions_api_instance.get_real_time_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.transcription_id) + + assert_that(response.status_code, equal_to(200)) + assert_that(response.data, instance_of(CallTranscriptionResponse)) + assert_that(response.data.account_id, has_length(7)) + assert_that(response.data.call_id, has_length(47)) + assert_that(response.data.transcription_id, instance_of(str)) + assert_that(response.data.tracks, instance_of(list)) + assert_that(response.data.tracks[0], instance_of(CallTranscription)) + assert_that(response.data.tracks[0].detected_language, is_in(CallTranscriptionDetectedLanguageEnum)) + assert_that(response.data.tracks[0].track, is_in(CallTranscriptionTrackEnum)) + assert_that(response.data.tracks[0].transcript, instance_of(str)) + assert_that(response.data.tracks[0].confidence, instance_of(float)) + + def test_delete_real_time_transcription(self) -> None: + """Test case for delete_real_time_transcription + + Delete a specific transcription + """ + response = self.transcriptions_api_instance.delete_real_time_transcription_with_http_info( + BW_ACCOUNT_ID, self.call_id, self.transcription_id) + + assert_that(response.status_code, equal_to(200)) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/__init__.py b/test/unit/models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unit/models/bxml/__init__.py b/test/unit/models/bxml/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/unit/bxml/test_base_classes.py b/test/unit/models/bxml/test_base_classes.py similarity index 56% rename from test/unit/bxml/test_base_classes.py rename to test/unit/models/bxml/test_base_classes.py index 6528c2ec..65d774ae 100644 --- a/test/unit/bxml/test_base_classes.py +++ b/test/unit/models/bxml/test_base_classes.py @@ -9,9 +9,7 @@ import pytest import unittest -from bandwidth.models.bxml import Root -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import TerminalVerb +from bandwidth.models.bxml import Root, Verb, NestableVerb class TestBaseClasses(unittest.TestCase): @@ -20,30 +18,29 @@ def setUp(self): self.root = Root(tag="TestRoot") self.verb1 = Verb(tag="TestVerb1", content="test") self.verb2 = Verb(tag="TestVerb2") - self.verb3 = Verb(tag="TestVerb3") - self.terminal_verb = TerminalVerb(tag="TestTerminalVerb") + self.nestable_verb = NestableVerb(tag="TestNestableVerb") def test_root(self): self.root.add_verb(self.verb1) self.root.add_verb(self.verb2) expected_bxml = "\ntest" - assert(type(self.root[0]) == Verb) - assert(len(self.root) == 2) - assert(expected_bxml == self.root.to_bxml()) + assert type(self.root[0]) == Verb + assert len(self.root) == 2 + assert expected_bxml == self.root.to_bxml() - def test_verb(self): - self.verb3.add_verb(self.verb1) + def test_nestable_verb(self): + self.nestable_verb.add_verb(self.verb1) - expected_bxml = "test" - assert(type(self.verb3[0]) == Verb) - assert(len(self.verb3) == 1) - assert(expected_bxml == self.verb3.to_bxml()) + expected_bxml = "test" + assert type(self.nestable_verb[0]) == Verb + assert len(self.nestable_verb) == 1 + assert expected_bxml == self.nestable_verb.to_bxml() def test_adding_verbs_to_root_during_creation(self): self.root2 = Root(tag="TestRoot2", nested_verbs=[self.verb1, self.verb2]) - assert(len(self.root2) == 2) + assert len(self.root2) == 2 def test_adding_verbs_to_terminal_verb(self): with pytest.raises(AttributeError): diff --git a/test/unit/bxml/test_bridge.py b/test/unit/models/bxml/test_bridge.py similarity index 67% rename from test/unit/bxml/test_bridge.py rename to test/unit/models/bxml/test_bridge.py index c41e9be7..2435c2e7 100644 --- a/test/unit/bxml/test_bridge.py +++ b/test/unit/models/bxml/test_bridge.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Bridge +from bandwidth.models.bxml import Bridge, Verb class TestBridge(unittest.TestCase): @@ -19,8 +18,11 @@ def setUp(self): bridge_complete_url="https://example.com", tag="test" ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.bridge, Bridge) + assert isinstance(self.bridge, Verb) def test_to_bxml(self): expected = '+19198675309' - assert(expected == self.bridge.to_bxml()) + assert expected == self.bridge.to_bxml() diff --git a/test/unit/bxml/test_bxml.py b/test/unit/models/bxml/test_bxml.py similarity index 69% rename from test/unit/bxml/test_bxml.py rename to test/unit/models/bxml/test_bxml.py index 77d1a577..f0a6f0e0 100644 --- a/test/unit/bxml/test_bxml.py +++ b/test/unit/models/bxml/test_bxml.py @@ -13,10 +13,13 @@ class TestBxml(unittest.TestCase): def setUp(self): - self.response = Bxml() + self.bxml = Bxml() + + def test_instance(self): + assert isinstance(self.bxml, Bxml) def test_bxml_init(self): """Test initializing the root """ expected_bxml = "\n" - assert self.response.to_bxml() == expected_bxml + assert self.bxml.to_bxml() == expected_bxml diff --git a/test/unit/bxml/test_conference.py b/test/unit/models/bxml/test_conference.py similarity index 83% rename from test/unit/bxml/test_conference.py rename to test/unit/models/bxml/test_conference.py index 35d9733b..059b4a4f 100644 --- a/test/unit/bxml/test_conference.py +++ b/test/unit/models/bxml/test_conference.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Conference +from bandwidth.models.bxml import Conference, Verb class TestConference(unittest.TestCase): @@ -30,8 +29,11 @@ def setUp(self): tag = "tag", callback_timeout = "5", ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.conference, Conference) + assert isinstance(self.conference, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.conference.to_bxml()) + assert expected == self.conference.to_bxml() diff --git a/test/unit/bxml/test_forward.py b/test/unit/models/bxml/test_forward.py similarity index 76% rename from test/unit/bxml/test_forward.py rename to test/unit/models/bxml/test_forward.py index 17a0d2b1..66e9ec96 100644 --- a/test/unit/bxml/test_forward.py +++ b/test/unit/models/bxml/test_forward.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml.verbs.forward import Forward +from bandwidth.models.bxml import Forward, Verb class TestForward(unittest.TestCase): @@ -21,8 +20,11 @@ def setUp(self): diversion_reason="away", uui="93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt" ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.forward, Forward) + assert isinstance(self.forward, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.forward.to_bxml()) + assert expected == self.forward.to_bxml() diff --git a/test/unit/bxml/test_gather.py b/test/unit/models/bxml/test_gather.py similarity index 85% rename from test/unit/bxml/test_gather.py rename to test/unit/models/bxml/test_gather.py index e330e36c..3993ec6b 100644 --- a/test/unit/bxml/test_gather.py +++ b/test/unit/models/bxml/test_gather.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.models.bxml import PlayAudio,SpeakSentence,Gather +from bandwidth.models.bxml import PlayAudio, SpeakSentence, Gather, Verb, NestableVerb class TestGather(unittest.TestCase): @@ -41,18 +41,23 @@ def setUp(self): audio_verbs=[self.play_audio] ) + def test_instance(self): + assert isinstance(self.gather, Gather) + assert isinstance(self.gather, NestableVerb) + assert isinstance(self.gather, Verb) + def test_defaults(self): gather = Gather( audio_verbs=[self.play_audio] ) expected = 'https://audio.url/audio1.wav' - assert(expected == gather.to_bxml()) + assert expected == gather.to_bxml() def test_to_bxml(self): expected = 'https://audio.url/audio1.wav' - assert(expected == self.gather.to_bxml()) + assert expected == self.gather.to_bxml() def test_add_verb(self): expected = 'https://audio.url/audio1.wavHello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.' self.gather.add_verb(self.speak_sentence) - assert(expected == self.gather.to_bxml()) + assert expected == self.gather.to_bxml() diff --git a/test/unit/bxml/test_hangup.py b/test/unit/models/bxml/test_hangup.py similarity index 54% rename from test/unit/bxml/test_hangup.py rename to test/unit/models/bxml/test_hangup.py index 9e2edb0f..66a86ba3 100644 --- a/test/unit/bxml/test_hangup.py +++ b/test/unit/models/bxml/test_hangup.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml.verbs.hangup import Hangup +from bandwidth.models.bxml import Hangup, Verb class TestHangup(unittest.TestCase): def setUp(self): self.hangup = Hangup() - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.hangup, Hangup) + assert isinstance(self.hangup, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.hangup.to_bxml()) + assert expected == self.hangup.to_bxml() diff --git a/test/unit/bxml/test_pause.py b/test/unit/models/bxml/test_pause.py similarity index 56% rename from test/unit/bxml/test_pause.py rename to test/unit/models/bxml/test_pause.py index ae9d8471..f20df5e3 100644 --- a/test/unit/bxml/test_pause.py +++ b/test/unit/models/bxml/test_pause.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Pause +from bandwidth.models.bxml import Pause, Verb class TestPause(unittest.TestCase): def setUp(self): self.pause = Pause(duration=30) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.pause, Pause) + assert isinstance(self.pause, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.pause.to_bxml()) + assert expected == self.pause.to_bxml() diff --git a/test/unit/bxml/test_pause_recording.py b/test/unit/models/bxml/test_pause_recording.py similarity index 54% rename from test/unit/bxml/test_pause_recording.py rename to test/unit/models/bxml/test_pause_recording.py index ce20eca6..ee411d79 100644 --- a/test/unit/bxml/test_pause_recording.py +++ b/test/unit/models/bxml/test_pause_recording.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import PauseRecording +from bandwidth.models.bxml import PauseRecording, Verb class TestPauseRecording(unittest.TestCase): def setUp(self): self.pause_recording = PauseRecording() - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.pause_recording, PauseRecording) + assert isinstance(self.pause_recording, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.pause_recording.to_bxml()) + assert expected == self.pause_recording.to_bxml() diff --git a/test/unit/bxml/test_phone_number.py b/test/unit/models/bxml/test_phone_number.py similarity index 70% rename from test/unit/bxml/test_phone_number.py rename to test/unit/models/bxml/test_phone_number.py index 3c4cff5e..aee3442a 100644 --- a/test/unit/bxml/test_phone_number.py +++ b/test/unit/models/bxml/test_phone_number.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import PhoneNumber +from bandwidth.models.bxml import PhoneNumber, Verb class TestPhoneNumber(unittest.TestCase): @@ -20,8 +19,11 @@ def setUp(self): transfer_answer_method="POST", tag="" ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.phone_number, PhoneNumber) + assert isinstance(self.phone_number, Verb) def test_to_bxml(self): expected = '+19195551234' - assert(expected == self.phone_number.to_bxml()) + assert expected == self.phone_number.to_bxml() diff --git a/test/unit/bxml/test_play_audio.py b/test/unit/models/bxml/test_play_audio.py similarity index 66% rename from test/unit/bxml/test_play_audio.py rename to test/unit/models/bxml/test_play_audio.py index e430719b..22e48eb6 100644 --- a/test/unit/bxml/test_play_audio.py +++ b/test/unit/models/bxml/test_play_audio.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import PlayAudio +from bandwidth.models.bxml import PlayAudio, Verb class TestPlayAudio(unittest.TestCase): @@ -18,9 +17,11 @@ def setUp(self): username="user", password="pass" ) - self.test_verb = Verb(tag="test") + def test_instance(self): + assert isinstance(self.play_audio, PlayAudio) + assert isinstance(self.play_audio, Verb) def test_to_bxml(self): expected = 'https://audio.url/audio1.wav' - assert(expected == self.play_audio.to_bxml()) + assert expected == self.play_audio.to_bxml() diff --git a/test/unit/bxml/test_record.py b/test/unit/models/bxml/test_record.py similarity index 59% rename from test/unit/bxml/test_record.py rename to test/unit/models/bxml/test_record.py index 3b08a7a5..d7b350ea 100644 --- a/test/unit/bxml/test_record.py +++ b/test/unit/models/bxml/test_record.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Record +from bandwidth.models.bxml import Record, Verb class TestRecord(unittest.TestCase): @@ -16,8 +15,11 @@ class TestRecord(unittest.TestCase): def setUp(self): self.record = Record() self.record.max_duration = 10 - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.record, Record) + assert isinstance(self.record, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.record.to_bxml()) + assert expected == self.record.to_bxml() diff --git a/test/unit/bxml/test_redirect.py b/test/unit/models/bxml/test_redirect.py similarity index 60% rename from test/unit/bxml/test_redirect.py rename to test/unit/models/bxml/test_redirect.py index 2e955004..c836c3f7 100644 --- a/test/unit/bxml/test_redirect.py +++ b/test/unit/models/bxml/test_redirect.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Redirect +from bandwidth.models.bxml import Redirect, Verb class TestRedirect(unittest.TestCase): def setUp(self): self.redirect = Redirect("https://example.com/redirect") - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.redirect, Redirect) + assert isinstance(self.redirect, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.redirect.to_bxml()) + assert expected == self.redirect.to_bxml() diff --git a/test/unit/bxml/test_response.py b/test/unit/models/bxml/test_response.py similarity index 85% rename from test/unit/bxml/test_response.py rename to test/unit/models/bxml/test_response.py index b90b9b41..5d8a1320 100644 --- a/test/unit/bxml/test_response.py +++ b/test/unit/models/bxml/test_response.py @@ -15,6 +15,9 @@ class TestResponse(unittest.TestCase): def setUp(self): self.response = Response() + def test_instance(self): + assert isinstance(self.response, Response) + def test_response_init(self): """Test initializing the root """ diff --git a/test/unit/bxml/test_resume_recording.py b/test/unit/models/bxml/test_resume_recording.py similarity index 54% rename from test/unit/bxml/test_resume_recording.py rename to test/unit/models/bxml/test_resume_recording.py index bc7a3bf2..3ea13b60 100644 --- a/test/unit/bxml/test_resume_recording.py +++ b/test/unit/models/bxml/test_resume_recording.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import ResumeRecording +from bandwidth.models.bxml import ResumeRecording, Verb class TestResumeRecording(unittest.TestCase): def setUp(self): self.resume_recording = ResumeRecording() - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.resume_recording, ResumeRecording) + assert isinstance(self.resume_recording, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.resume_recording.to_bxml()) + assert expected == self.resume_recording.to_bxml() diff --git a/test/unit/bxml/test_ring.py b/test/unit/models/bxml/test_ring.py similarity index 61% rename from test/unit/bxml/test_ring.py rename to test/unit/models/bxml/test_ring.py index 613fc71c..14df46eb 100644 --- a/test/unit/bxml/test_ring.py +++ b/test/unit/models/bxml/test_ring.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml.verbs.ring import Ring +from bandwidth.models.bxml.verbs.ring import Ring, Verb class TestRing(unittest.TestCase): @@ -18,8 +17,11 @@ def setUp(self): duration=30, answer_call=True, ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.ring, Ring) + assert isinstance(self.ring, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.ring.to_bxml()) + assert expected == self.ring.to_bxml() diff --git a/test/unit/bxml/test_send_dtmf.py b/test/unit/models/bxml/test_send_dtmf.py similarity index 62% rename from test/unit/bxml/test_send_dtmf.py rename to test/unit/models/bxml/test_send_dtmf.py index ebe51035..5536cb8b 100644 --- a/test/unit/bxml/test_send_dtmf.py +++ b/test/unit/models/bxml/test_send_dtmf.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml.verbs.send_dtmf import SendDtmf +from bandwidth.models.bxml.verbs.send_dtmf import SendDtmf, Verb class TestSendDtmf(unittest.TestCase): @@ -19,8 +18,11 @@ def setUp(self): tone_duration=3, tone_interval=5 ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.send_dtmf, SendDtmf) + assert isinstance(self.send_dtmf, Verb) def test_to_bxml(self): expected = '1234' - assert(expected == self.send_dtmf.to_bxml()) + assert expected == self.send_dtmf.to_bxml() diff --git a/test/unit/bxml/test_sip_uri.py b/test/unit/models/bxml/test_sip_uri.py similarity index 75% rename from test/unit/bxml/test_sip_uri.py rename to test/unit/models/bxml/test_sip_uri.py index f4f78c21..c8abb464 100644 --- a/test/unit/bxml/test_sip_uri.py +++ b/test/unit/models/bxml/test_sip_uri.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import SipUri +from bandwidth.models.bxml import SipUri, Verb class TestSipUri(unittest.TestCase): @@ -21,8 +20,11 @@ def setUp(self): transfer_answer_method="POST", tag="test" ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.sip_uri, SipUri) + assert isinstance(self.sip_uri, Verb) def test_to_bxml(self): expected = 'sip:1-999-123-4567@voip-provider.example.net' - assert(expected == self.sip_uri.to_bxml()) + assert expected == self.sip_uri.to_bxml() diff --git a/test/unit/bxml/test_speak_sentence.py b/test/unit/models/bxml/test_speak_sentence.py similarity index 77% rename from test/unit/bxml/test_speak_sentence.py rename to test/unit/models/bxml/test_speak_sentence.py index bb362040..6d9b1d8f 100644 --- a/test/unit/bxml/test_speak_sentence.py +++ b/test/unit/models/bxml/test_speak_sentence.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import SpeakSentence, Response +from bandwidth.models.bxml import SpeakSentence, Response, Verb class TestSpeakSentence(unittest.TestCase): @@ -19,14 +18,16 @@ def setUp(self): voice="julie" ) - self.test_verb = Verb(tag="test") + def test_instance(self): + assert isinstance(self.speak_sentence, SpeakSentence) + assert isinstance(self.speak_sentence, Verb) def test_to_bxml(self): expected = 'Hello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.' - assert(expected == self.speak_sentence.to_bxml()) + assert expected == self.speak_sentence.to_bxml() def test_to_bxml_within_response(self): expected = '\nHello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.' response = Response() response.add_verb(self.speak_sentence) - assert(expected == response.to_bxml()) + assert expected == response.to_bxml() diff --git a/test/unit/bxml/test_start_gather.py b/test/unit/models/bxml/test_start_gather.py similarity index 69% rename from test/unit/bxml/test_start_gather.py rename to test/unit/models/bxml/test_start_gather.py index a4766c1b..b490f547 100644 --- a/test/unit/bxml/test_start_gather.py +++ b/test/unit/models/bxml/test_start_gather.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import StartGather +from bandwidth.models.bxml import StartGather, Verb class TestStartGather(unittest.TestCase): @@ -21,8 +20,11 @@ def setUp(self): password="pass", tag="tag" ) - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.start_gather, StartGather) + assert isinstance(self.start_gather, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.start_gather.to_bxml()) + assert expected == self.start_gather.to_bxml() diff --git a/test/unit/bxml/test_start_recording.py b/test/unit/models/bxml/test_start_recording.py similarity index 79% rename from test/unit/bxml/test_start_recording.py rename to test/unit/models/bxml/test_start_recording.py index d298fc07..bb459701 100644 --- a/test/unit/bxml/test_start_recording.py +++ b/test/unit/models/bxml/test_start_recording.py @@ -7,8 +7,7 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import StartRecording +from bandwidth.models.bxml import StartRecording, Verb class TestStartRecording(unittest.TestCase): @@ -26,9 +25,11 @@ def setUp(self): file_format = "wav", multi_channel = True ) - self.test_verb = Verb(tag="test") + def test_instance(self): + assert isinstance(self.start_recording, StartRecording) + assert isinstance(self.start_recording, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.start_recording.to_bxml()) + assert expected == self.start_recording.to_bxml() diff --git a/test/unit/bxml/test_start_stream.py b/test/unit/models/bxml/test_start_stream.py similarity index 78% rename from test/unit/bxml/test_start_stream.py rename to test/unit/models/bxml/test_start_stream.py index 8f1f3825..8013e916 100644 --- a/test/unit/bxml/test_start_stream.py +++ b/test/unit/models/bxml/test_start_stream.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.models.bxml import StartStream, StreamParam +from bandwidth.models.bxml import StartStream, StreamParam, Verb, NestableVerb class TestStartStream(unittest.TestCase): @@ -34,11 +34,16 @@ def setUp(self): password = "pass" ) + def test_instance(self): + assert isinstance(self.start_stream, StartStream) + assert isinstance(self.start_stream, NestableVerb) + assert isinstance(self.start_stream, Verb) + def test_to_bxml(self): expected = '' - assert(expected == self.start_stream.to_bxml()) + assert expected == self.start_stream.to_bxml() def test_add_verb(self): expected = '' self.start_stream.add_verb(self.stream_param2) - assert(expected == self.start_stream.to_bxml()) + assert expected == self.start_stream.to_bxml() diff --git a/test/unit/bxml/test_start_transcription.py b/test/unit/models/bxml/test_start_transcription.py similarity index 81% rename from test/unit/bxml/test_start_transcription.py rename to test/unit/models/bxml/test_start_transcription.py index 90f25a39..61861c52 100644 --- a/test/unit/bxml/test_start_transcription.py +++ b/test/unit/models/bxml/test_start_transcription.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.models.bxml import StartTranscription, CustomParam +from bandwidth.models.bxml import StartTranscription, CustomParam, Verb, NestableVerb class TestStartTranscription(unittest.TestCase): @@ -34,11 +34,16 @@ def setUp(self) -> None: custom_params=[self.custom_param1] ) + def test_instance(self): + assert isinstance(self.start_transcription, StartTranscription) + assert isinstance(self.start_transcription, NestableVerb) + assert isinstance(self.start_transcription, Verb) + def test_to_bxml(self): expected = '' - assert(expected == self.start_transcription.to_bxml()) + assert expected == self.start_transcription.to_bxml() def test_add_verb(self): expected = '' self.start_transcription.add_verb(self.custom_param2) - assert(expected == self.start_transcription.to_bxml()) + assert expected == self.start_transcription.to_bxml() diff --git a/test/unit/bxml/test_stop_gather.py b/test/unit/models/bxml/test_stop_gather.py similarity index 54% rename from test/unit/bxml/test_stop_gather.py rename to test/unit/models/bxml/test_stop_gather.py index dca837eb..47f4c487 100644 --- a/test/unit/bxml/test_stop_gather.py +++ b/test/unit/models/bxml/test_stop_gather.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import StopGather +from bandwidth.models.bxml import StopGather, Verb class TestStopGather(unittest.TestCase): def setUp(self): self.stop_gather = StopGather() - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.stop_gather, StopGather) + assert isinstance(self.stop_gather, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.stop_gather.to_bxml()) + assert expected == self.stop_gather.to_bxml() diff --git a/test/unit/bxml/test_stop_recording.py b/test/unit/models/bxml/test_stop_recording.py similarity index 63% rename from test/unit/bxml/test_stop_recording.py rename to test/unit/models/bxml/test_stop_recording.py index 57ede215..0cc4989e 100644 --- a/test/unit/bxml/test_stop_recording.py +++ b/test/unit/models/bxml/test_stop_recording.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml.verbs.stop_recording import StopRecording +from bandwidth.models.bxml.verbs.stop_recording import StopRecording, Verb class TestStopRecording(unittest.TestCase): def setUp(self): self.stop_recording = StopRecording() - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.stop_recording, StopRecording) + assert isinstance(self.stop_recording, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.stop_recording.to_bxml()) + assert expected == self.stop_recording.to_bxml() diff --git a/test/unit/bxml/test_stop_stream.py b/test/unit/models/bxml/test_stop_stream.py similarity index 56% rename from test/unit/bxml/test_stop_stream.py rename to test/unit/models/bxml/test_stop_stream.py index 93772d08..055ab3d2 100644 --- a/test/unit/bxml/test_stop_stream.py +++ b/test/unit/models/bxml/test_stop_stream.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import StopStream +from bandwidth.models.bxml import StopStream, Verb class TestStopStream(unittest.TestCase): def setUp(self): self.stop_stream = StopStream(name="conf") - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.stop_stream, StopStream) + assert isinstance(self.stop_stream, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.stop_stream.to_bxml()) + assert expected == self.stop_stream.to_bxml() diff --git a/test/unit/bxml/test_stop_transcription.py b/test/unit/models/bxml/test_stop_transcription.py similarity index 59% rename from test/unit/bxml/test_stop_transcription.py rename to test/unit/models/bxml/test_stop_transcription.py index 0015fdab..814882a4 100644 --- a/test/unit/bxml/test_stop_transcription.py +++ b/test/unit/models/bxml/test_stop_transcription.py @@ -7,7 +7,7 @@ """ import unittest -from bandwidth.models.bxml import StopTranscription +from bandwidth.models.bxml import StopTranscription, Verb class TestStopTranscription(unittest.TestCase): @@ -16,6 +16,10 @@ def setUp(self) -> None: name="transcription1" ) + def test_instance(self): + assert isinstance(self.stop_transcription, StopTranscription) + assert isinstance(self.stop_transcription, Verb) + def test_to_bxml(self): expected = '' - assert(expected == self.stop_transcription.to_bxml()) + assert expected == self.stop_transcription.to_bxml() diff --git a/test/unit/bxml/test_stream_param.py b/test/unit/models/bxml/test_stream_param.py similarity index 60% rename from test/unit/bxml/test_stream_param.py rename to test/unit/models/bxml/test_stream_param.py index 1fed11dc..96ce2776 100644 --- a/test/unit/bxml/test_stream_param.py +++ b/test/unit/models/bxml/test_stream_param.py @@ -7,9 +7,7 @@ """ import unittest - -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import StreamParam +from bandwidth.models.bxml import StreamParam, Verb class TestStreamParam(unittest.TestCase): @@ -19,9 +17,11 @@ def setUp(self): name="name1", value="value1" ) - self.test_verb = Verb(tag="test") + def test_instance(self): + assert isinstance(self.stream_param, StreamParam) + assert isinstance(self.stream_param, Verb) def test_to_bxml(self): expected = '' - assert(expected == self.stream_param.to_bxml()) + assert expected == self.stream_param.to_bxml() diff --git a/test/unit/bxml/test_tag.py b/test/unit/models/bxml/test_tag.py similarity index 56% rename from test/unit/bxml/test_tag.py rename to test/unit/models/bxml/test_tag.py index 32679eee..c34c6e8f 100644 --- a/test/unit/bxml/test_tag.py +++ b/test/unit/models/bxml/test_tag.py @@ -7,16 +7,18 @@ """ import unittest -from bandwidth.models.bxml import Verb -from bandwidth.models.bxml import Tag +from bandwidth.models.bxml import Tag, Verb class TestTag(unittest.TestCase): def setUp(self): self.tag = Tag(content="Test") - self.test_verb = Verb(tag="test") + + def test_instance(self): + assert isinstance(self.tag, Tag) + assert isinstance(self.tag, Verb) def test_to_bxml(self): expected = 'Test' - assert(expected == self.tag.to_bxml()) + assert expected == self.tag.to_bxml() diff --git a/test/unit/bxml/test_transfer.py b/test/unit/models/bxml/test_transfer.py similarity index 75% rename from test/unit/bxml/test_transfer.py rename to test/unit/models/bxml/test_transfer.py index b63f0c2f..6e667835 100644 --- a/test/unit/bxml/test_transfer.py +++ b/test/unit/models/bxml/test_transfer.py @@ -7,9 +7,7 @@ """ import unittest -from bandwidth.models.bxml.verbs.transfer import Transfer -from bandwidth.models.bxml import PhoneNumber -from bandwidth.models.bxml import SipUri +from bandwidth.models.bxml import Transfer, PhoneNumber, SipUri, Verb, NestableVerb class TestTransfer(unittest.TestCase): @@ -31,11 +29,16 @@ def setUp(self): tag = "test" ) + def test_instance(self): + assert isinstance(self.transfer, Transfer) + assert isinstance(self.transfer, NestableVerb) + assert isinstance(self.transfer, Verb) + def test_to_bxml(self): expected = 'sip@bw.com' - assert(expected == self.transfer.to_bxml()) + assert expected == self.transfer.to_bxml() def test_add_verb(self): expected = 'sip@bw.com+19195551234' self.transfer.add_transfer_recipient(self.phone_number) - assert(expected == self.transfer.to_bxml()) + assert expected == self.transfer.to_bxml() diff --git a/test/unit/test_account_statistics.py b/test/unit/models/test_account_statistics.py similarity index 60% rename from test/unit/test_account_statistics.py rename to test/unit/models/test_account_statistics.py index e7038499..f3870d8a 100644 --- a/test/unit/test_account_statistics.py +++ b/test/unit/models/test_account_statistics.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.account_statistics import AccountStatistics # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.account_statistics import AccountStatistics class TestAccountStatistics(unittest.TestCase): """AccountStatistics unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> AccountStatistics: """Test AccountStatistics - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `AccountStatistics` - """ - model = bandwidth.models.account_statistics.AccountStatistics() # noqa: E501 - if include_optional : + if include_optional: return AccountStatistics( - current_call_queue_size = 0, + current_call_queue_size = 0, max_call_queue_size = 900 ) - else : + else: return AccountStatistics( ) - """ def testAccountStatistics(self): """Test AccountStatistics""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, AccountStatistics) + assert instance.current_call_queue_size == 0 + assert instance.max_call_queue_size == 900 if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_answer_callback.py b/test/unit/models/test_answer_callback.py new file mode 100644 index 00000000..0688bbd8 --- /dev/null +++ b/test/unit/models/test_answer_callback.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.answer_callback import AnswerCallback +from bandwidth.models.machine_detection_result import MachineDetectionResult + +class TestAnswerCallback(unittest.TestCase): + """AnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnswerCallback: + """Test AnswerCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return AnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = MachineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else: + return AnswerCallback( + ) + + def testAnswerCallback(self): + """Test AnswerCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, AnswerCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert isinstance(instance.machine_detection_result, MachineDetectionResult) + assert instance.machine_detection_result.value == 'answering-machine' + assert instance.machine_detection_result.duration == 'PT4.9891287S' + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_bridge_complete_callback.py b/test/unit/models/test_bridge_complete_callback.py new file mode 100644 index 00000000..51a09a68 --- /dev/null +++ b/test/unit/models/test_bridge_complete_callback.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback + +class TestBridgeCompleteCallback(unittest.TestCase): + """BridgeCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BridgeCompleteCallback: + """Test BridgeCompleteCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return BridgeCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else: + return BridgeCompleteCallback( + ) + + def testBridgeCompleteCallback(self): + """Test BridgeCompleteCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BridgeCompleteCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert instance.cause == 'busy' + assert instance.error_message == 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call' + assert instance.error_id == '4642074b-7b58-478b-96e4-3a60955c6765' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_bridge_target_complete_callback.py b/test/unit/models/test_bridge_target_complete_callback.py new file mode 100644 index 00000000..c289c0f5 --- /dev/null +++ b/test/unit/models/test_bridge_target_complete_callback.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback + +class TestBridgeTargetCompleteCallback(unittest.TestCase): + """BridgeTargetCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BridgeTargetCompleteCallback: + """Test BridgeTargetCompleteCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return BridgeTargetCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag' + ) + else: + return BridgeTargetCompleteCallback( + ) + + def testBridgeTargetCompleteCallback(self): + """Test BridgeTargetCompleteCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BridgeTargetCompleteCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_call_direction_enum.py b/test/unit/models/test_call_direction_enum.py similarity index 78% rename from test/unit/test_call_direction_enum.py rename to test/unit/models/test_call_direction_enum.py index 7e7c152f..b55d731e 100644 --- a/test/unit/test_call_direction_enum.py +++ b/test/unit/models/test_call_direction_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.call_direction_enum import CallDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.call_direction_enum import CallDirectionEnum class TestCallDirectionEnum(unittest.TestCase): """CallDirectionEnum unit test stubs""" @@ -31,7 +28,11 @@ def tearDown(self): def testCallDirectionEnum(self): """Test CallDirectionEnum""" - # inst = CallDirectionEnum() + inbound = CallDirectionEnum('inbound') + outbound = CallDirectionEnum('outbound') + assert inbound == 'inbound' + assert outbound == 'outbound' + if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_call_recording_metadata.py b/test/unit/models/test_call_recording_metadata.py new file mode 100644 index 00000000..b189a717 --- /dev/null +++ b/test/unit/models/test_call_recording_metadata.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.call_recording_metadata import CallRecordingMetadata +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata + +class TestCallRecordingMetadata(unittest.TestCase): + """CallRecordingMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CallRecordingMetadata: + """Test CallRecordingMetadata + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CallRecordingMetadata( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + to = '+15555555555', + var_from = '+15555555555', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555', + duration = 'PT13.67S', + direction = 'inbound', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + transcription = RecordingTranscriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', ) + ) + else: + return CallRecordingMetadata( + ) + + def testCallRecordingMetadata(self): + """Test CallRecordingMetadata""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CallRecordingMetadata) + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.account_id == '9900000' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert instance.to == '+15555555555' + assert instance.var_from == '+15555555555' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + assert instance.duration == 'PT13.67S' + assert instance.direction == 'inbound' + assert instance.channels == 1 + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.file_format == 'wav' + assert instance.status == 'completed' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + assert isinstance(instance.transcription, RecordingTranscriptionMetadata) + assert instance.transcription.id == 't-387bd648-18f3-4823-9d16-746bca0003c9' + assert instance.transcription.status == 'completed' + assert isinstance(instance.transcription.completed_time, datetime) + assert instance.transcription.url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_call_state.py b/test/unit/models/test_call_state.py new file mode 100644 index 00000000..22d7ec6a --- /dev/null +++ b/test/unit/models/test_call_state.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.call_state import CallState + +class TestCallState(unittest.TestCase): + """CallState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CallState: + """Test CallState + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CallState( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + direction = 'inbound', + state = 'disconnected', + stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, + identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken', + enqueued_time = '2022-06-16T13:15:07.160Z', + start_time = '2022-06-16T13:15:07.160Z', + answer_time = '2022-06-16T13:15:18.126Z', + end_time = '2022-06-16T13:15:18.314Z', + disconnect_cause = '', + error_message = '', + error_id = '', + last_update = '2022-06-16T13:15:18.314Z' + ) + else: + return CallState( + ) + + def testCallState(self): + """Test CallState""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CallState) + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.account_id == '9900000' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.to == '+19195551234' + assert instance.var_from == '+19195554321' + assert instance.direction == 'inbound' + assert instance.state == 'disconnected' + assert instance.stir_shaken == {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"} + assert instance.identity == 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.disconnect_cause == '' + assert instance.error_message == '' + assert instance.error_id == '' + assert isinstance(instance.last_update, datetime) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_call_state_enum.py b/test/unit/models/test_call_state_enum.py similarity index 72% rename from test/unit/test_call_state_enum.py rename to test/unit/models/test_call_state_enum.py index e4eb0653..34b6e0d1 100644 --- a/test/unit/test_call_state_enum.py +++ b/test/unit/models/test_call_state_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.call_state_enum import CallStateEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.call_state_enum import CallStateEnum class TestCallStateEnum(unittest.TestCase): """CallStateEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testCallStateEnum(self): """Test CallStateEnum""" - # inst = CallStateEnum() + active = CallStateEnum('active') + completed = CallStateEnum('completed') + assert active == 'active' + assert completed == 'completed' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_call_transcription.py b/test/unit/models/test_call_transcription.py new file mode 100644 index 00000000..322df88e --- /dev/null +++ b/test/unit/models/test_call_transcription.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.call_transcription import CallTranscription + +class TestCallTranscription(unittest.TestCase): + """CallTranscription unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CallTranscription: + """Test CallTranscription + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + instance = CallTranscription() + if include_optional: + return CallTranscription( + detected_language = 'en-US', + track = 'inbound', + transcript = 'Hello World! This is an example.', + confidence = 0.9 + ) + else: + return CallTranscription( + ) + + def testCallTranscription(self): + """Test CallTranscription""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CallTranscription) + assert instance.detected_language == 'en-US' + assert instance.track == 'inbound' + assert instance.transcript == 'Hello World! This is an example.' + assert instance.confidence == 0.9 + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_call_transcription_detected_language_enum.py b/test/unit/models/test_call_transcription_detected_language_enum.py new file mode 100644 index 00000000..68c6d56b --- /dev/null +++ b/test/unit/models/test_call_transcription_detected_language_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.call_transcription_detected_language_enum import CallTranscriptionDetectedLanguageEnum + +class TestCallTranscriptionDetectedLanguageEnum(unittest.TestCase): + """CallTranscriptionDetectedLanguageEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallTranscriptionDetectedLanguageEnum(self): + """Test CallTranscriptionDetectedLanguageEnum""" + enus = CallTranscriptionDetectedLanguageEnum('en-US') + esus = CallTranscriptionDetectedLanguageEnum('es-US') + frfr = CallTranscriptionDetectedLanguageEnum('fr-FR') + assert enus == 'en-US' + assert esus == 'es-US' + assert frfr == 'fr-FR' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_call_transcription_metadata.py b/test/unit/models/test_call_transcription_metadata.py new file mode 100644 index 00000000..d5740473 --- /dev/null +++ b/test/unit/models/test_call_transcription_metadata.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata + +class TestCallTranscriptionMetadata(unittest.TestCase): + """CallTranscriptionMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CallTranscriptionMetadata: + """Test CallTranscriptionMetadata + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CallTranscriptionMetadata( + transcription_id = 't-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b', + transcription_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b' + ) + else: + return CallTranscriptionMetadata( + ) + + def testCallTranscriptionMetadata(self): + """Test CallTranscriptionMetadata""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CallTranscriptionMetadata) + assert instance.transcription_id == 't-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b' + assert instance.transcription_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_call_transcription_response.py b/test/unit/models/test_call_transcription_response.py new file mode 100644 index 00000000..acd2e64f --- /dev/null +++ b/test/unit/models/test_call_transcription_response.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.call_transcription_response import CallTranscriptionResponse + +class TestCallTranscriptionResponse(unittest.TestCase): + """CallTranscriptionResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CallTranscriptionResponse: + """Test CallTranscriptionResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CallTranscriptionResponse( + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + transcription_id = 't-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b', + tracks = [{"detectedLanguage":"en-US","track":"inbound","transcript":"Hello World! This is an example.","confidence":0.9}] + ) + else: + return CallTranscriptionResponse( + ) + + def testCallTranscriptionResponse(self): + """Test CallTranscriptionResponse""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CallTranscriptionResponse) + assert instance.account_id == '9900000' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.transcription_id == 't-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b' + assert instance.tracks[0].detected_language == 'en-US' + assert instance.tracks[0].track == 'inbound' + assert instance.tracks[0].transcript == 'Hello World! This is an example.' + assert instance.tracks[0].confidence == 0.9 + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_call_transcription_track_enum.py b/test/unit/models/test_call_transcription_track_enum.py new file mode 100644 index 00000000..e76e5535 --- /dev/null +++ b/test/unit/models/test_call_transcription_track_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum + +class TestCallTranscriptionTrackEnum(unittest.TestCase): + """CallTranscriptionTrackEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallTranscriptionTrackEnum(self): + """Test CallTranscriptionTrackEnum""" + inbound = CallTranscriptionTrackEnum('inbound') + outbound = CallTranscriptionTrackEnum('outbound') + assert inbound == 'inbound' + assert outbound == 'outbound' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_callback_method_enum.py b/test/unit/models/test_callback_method_enum.py similarity index 81% rename from test/unit/test_callback_method_enum.py rename to test/unit/models/test_callback_method_enum.py index a91471a3..05d8c9df 100644 --- a/test/unit/test_callback_method_enum.py +++ b/test/unit/models/test_callback_method_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.callback_method_enum import CallbackMethodEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.callback_method_enum import CallbackMethodEnum class TestCallbackMethodEnum(unittest.TestCase): """CallbackMethodEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testCallbackMethodEnum(self): """Test CallbackMethodEnum""" - # inst = CallbackMethodEnum() + post = CallbackMethodEnum('POST') + get = CallbackMethodEnum('GET') + assert post == 'POST' + assert get == 'GET' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_code_request.py b/test/unit/models/test_code_request.py similarity index 59% rename from test/unit/test_code_request.py rename to test/unit/models/test_code_request.py index 9df98c86..c28344f1 100644 --- a/test/unit/test_code_request.py +++ b/test/unit/models/test_code_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.code_request import CodeRequest # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.code_request import CodeRequest class TestCodeRequest(unittest.TestCase): """CodeRequest unit test stubs""" @@ -29,24 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CodeRequest: """Test CodeRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `CodeRequest` - """ - model = bandwidth.models.code_request.CodeRequest() # noqa: E501 - if include_optional : + if include_optional: return CodeRequest( - to = '+19195551234', - var_from = '+19195554321', - application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', - scope = '2FA', - message = 'Your temporary {NAME} {SCOPE} code is {CODE}', + to = '+19195551234', + var_from = '+19195554321', + application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', + scope = '2FA', + message = 'Your temporary {NAME} {SCOPE} code is {CODE}', digits = 6 ) - else : + else: return CodeRequest( to = '+19195551234', var_from = '+19195554321', @@ -54,12 +48,18 @@ def make_instance(self, include_optional): message = 'Your temporary {NAME} {SCOPE} code is {CODE}', digits = 6, ) - """ def testCodeRequest(self): """Test CodeRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CodeRequest) + assert instance.to == '+19195551234' + assert instance.var_from == '+19195554321' + assert instance.application_id == '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1' + assert instance.scope == '2FA' + assert instance.message == 'Your temporary {NAME} {SCOPE} code is {CODE}' + assert instance.digits == 6 if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_conference.py b/test/unit/models/test_conference.py new file mode 100644 index 00000000..6af4a889 --- /dev/null +++ b/test/unit/models/test_conference.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.conference import Conference +from bandwidth.models.conference_member import ConferenceMember + +class TestConference(unittest.TestCase): + """Conference unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Conference: + """Test Conference + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Conference( + id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + created_time = '2022-06-17T22:19:40.375Z', + completed_time = '2022-06-17T22:20Z', + conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent', + conference_event_method = 'POST', + tag = 'my custom tag', + active_members = [ + ConferenceMember( + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, + call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], ) + ] + ) + else: + return Conference( + ) + + def testConference(self): + """Test Conference""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Conference) + assert instance.id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert isinstance(instance.created_time, datetime) + assert isinstance(instance.completed_time, datetime) + assert instance.conference_event_url == 'https://myServer.example/bandwidth/webhooks/conferenceEvent' + assert instance.conference_event_method == 'POST' + assert instance.tag == 'my custom tag' + assert isinstance(instance.active_members, list) + assert len(instance.active_members) == 1 + assert isinstance(instance.active_members[0], ConferenceMember) + assert instance.active_members[0].call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.active_members[0].conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.active_members[0].member_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.active_members[0].mute == False + assert instance.active_members[0].hold == False + assert instance.active_members[0].call_ids_to_coach == ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_completed_callback.py b/test/unit/models/test_conference_completed_callback.py similarity index 55% rename from test/unit/test_conference_completed_callback.py rename to test/unit/models/test_conference_completed_callback.py index 7b4be3bc..a68ecb52 100644 --- a/test/unit/test_conference_completed_callback.py +++ b/test/unit/models/test_conference_completed_callback.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback class TestConferenceCompletedCallback(unittest.TestCase): """ConferenceCompletedCallback unit test stubs""" @@ -29,31 +27,33 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ConferenceCompletedCallback: """Test ConferenceCompletedCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `ConferenceCompletedCallback` - """ - model = bandwidth.models.conference_completed_callback.ConferenceCompletedCallback() # noqa: E501 - if include_optional : + if include_optional: return ConferenceCompletedCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', tag = 'exampleTag' ) - else : + else: return ConferenceCompletedCallback( ) - """ def testConferenceCompletedCallback(self): """Test ConferenceCompletedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceCompletedCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.tag == 'exampleTag' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_created_callback.py b/test/unit/models/test_conference_created_callback.py similarity index 55% rename from test/unit/test_conference_created_callback.py rename to test/unit/models/test_conference_created_callback.py index af7eff5b..26f130d1 100644 --- a/test/unit/test_conference_created_callback.py +++ b/test/unit/models/test_conference_created_callback.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.conference_created_callback import ConferenceCreatedCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.conference_created_callback import ConferenceCreatedCallback class TestConferenceCreatedCallback(unittest.TestCase): """ConferenceCreatedCallback unit test stubs""" @@ -29,31 +27,33 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ConferenceCreatedCallback: """Test ConferenceCreatedCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `ConferenceCreatedCallback` - """ - model = bandwidth.models.conference_created_callback.ConferenceCreatedCallback() # noqa: E501 - if include_optional : + if include_optional: return ConferenceCreatedCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', tag = 'exampleTag' ) - else : + else: return ConferenceCreatedCallback( ) - """ def testConferenceCreatedCallback(self): """Test ConferenceCreatedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceCreatedCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.tag == 'exampleTag' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_member.py b/test/unit/models/test_conference_member.py similarity index 54% rename from test/unit/test_conference_member.py rename to test/unit/models/test_conference_member.py index 51222320..fb9e3aab 100644 --- a/test/unit/test_conference_member.py +++ b/test/unit/models/test_conference_member.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.conference_member import ConferenceMember # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.conference_member import ConferenceMember class TestConferenceMember(unittest.TestCase): """ConferenceMember unit test stubs""" @@ -29,32 +26,35 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ConferenceMember: """Test ConferenceMember - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `ConferenceMember` - """ - model = bandwidth.models.conference_member.ConferenceMember() # noqa: E501 - if include_optional : + if include_optional: return ConferenceMember( - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - mute = False, - hold = False, + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + mute = False, + hold = False, call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] ) - else : + else: return ConferenceMember( ) - """ def testConferenceMember(self): """Test ConferenceMember""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceMember) + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.member_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.mute == False + assert instance.hold == False + assert instance.call_ids_to_coach == ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_conference_member_exit_callback.py b/test/unit/models/test_conference_member_exit_callback.py new file mode 100644 index 00000000..5a37fcdf --- /dev/null +++ b/test/unit/models/test_conference_member_exit_callback.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback + +class TestConferenceMemberExitCallback(unittest.TestCase): + """ConferenceMemberExitCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConferenceMemberExitCallback: + """Test ConferenceMemberExitCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ConferenceMemberExitCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else: + return ConferenceMemberExitCallback( + ) + + def testConferenceMemberExitCallback(self): + """Test ConferenceMemberExitCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceMemberExitCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_conference_member_join_callback.py b/test/unit/models/test_conference_member_join_callback.py new file mode 100644 index 00000000..999c4adc --- /dev/null +++ b/test/unit/models/test_conference_member_join_callback.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback + +class TestConferenceMemberJoinCallback(unittest.TestCase): + """ConferenceMemberJoinCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConferenceMemberJoinCallback: + """Test ConferenceMemberJoinCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ConferenceMemberJoinCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + tag = 'exampleTag' + ) + else: + return ConferenceMemberJoinCallback( + ) + + def testConferenceMemberJoinCallback(self): + """Test ConferenceMemberJoinCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceMemberJoinCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_conference_recording_available_callback.py b/test/unit/models/test_conference_recording_available_callback.py new file mode 100644 index 00000000..d9c5e676 --- /dev/null +++ b/test/unit/models/test_conference_recording_available_callback.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback + +class TestConferenceRecordingAvailableCallback(unittest.TestCase): + """ConferenceRecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConferenceRecordingAvailableCallback: + """Test ConferenceRecordingAvailableCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ConferenceRecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + account_id = '9900000', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + tag = 'exampleTag', + status = 'completed' + ) + else: + return ConferenceRecordingAvailableCallback( + ) + + def testConferenceRecordingAvailableCallback(self): + """Test ConferenceRecordingAvailableCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceRecordingAvailableCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.account_id == '9900000' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert instance.channels == 1 + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.duration == 'PT13.67S' + assert instance.file_format == 'wav' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + assert instance.tag == 'exampleTag' + assert instance.status == 'completed' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_conference_recording_metadata.py b/test/unit/models/test_conference_recording_metadata.py new file mode 100644 index 00000000..bceb0ee5 --- /dev/null +++ b/test/unit/models/test_conference_recording_metadata.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata + +class TestConferenceRecordingMetadata(unittest.TestCase): + """ConferenceRecordingMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConferenceRecordingMetadata: + """Test ConferenceRecordingMetadata + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ConferenceRecordingMetadata( + account_id = '9900000', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + duration = 'PT13.67S', + channels = 1, + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + file_format = 'wav', + status = 'completed', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + ) + else: + return ConferenceRecordingMetadata( + ) + + def testConferenceRecordingMetadata(self): + """Test ConferenceRecordingMetadata""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceRecordingMetadata) + assert instance.account_id == '9900000' + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert instance.duration == 'PT13.67S' + assert instance.channels == 1 + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.file_format == 'wav' + assert instance.status == 'completed' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_conference_redirect_callback.py b/test/unit/models/test_conference_redirect_callback.py similarity index 55% rename from test/unit/test_conference_redirect_callback.py rename to test/unit/models/test_conference_redirect_callback.py index 4edd30dd..55c84edd 100644 --- a/test/unit/test_conference_redirect_callback.py +++ b/test/unit/models/test_conference_redirect_callback.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback class TestConferenceRedirectCallback(unittest.TestCase): """ConferenceRedirectCallback unit test stubs""" @@ -29,31 +27,33 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ConferenceRedirectCallback: """Test ConferenceRedirectCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `ConferenceRedirectCallback` - """ - model = bandwidth.models.conference_redirect_callback.ConferenceRedirectCallback() # noqa: E501 - if include_optional : + if include_optional: return ConferenceRedirectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', + name = 'my-conference-name', tag = 'exampleTag' ) - else : + else: return ConferenceRedirectCallback( ) - """ def testConferenceRedirectCallback(self): """Test ConferenceRedirectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ConferenceRedirectCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.conference_id == 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + assert instance.name == 'my-conference-name' + assert instance.tag == 'exampleTag' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_conference_state_enum.py b/test/unit/models/test_conference_state_enum.py similarity index 78% rename from test/unit/test_conference_state_enum.py rename to test/unit/models/test_conference_state_enum.py index 87caff31..24fb25fb 100644 --- a/test/unit/test_conference_state_enum.py +++ b/test/unit/models/test_conference_state_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.conference_state_enum import ConferenceStateEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.conference_state_enum import ConferenceStateEnum class TestConferenceStateEnum(unittest.TestCase): """ConferenceStateEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testConferenceStateEnum(self): """Test ConferenceStateEnum""" - # inst = ConferenceStateEnum() + active = ConferenceStateEnum('active') + completed = ConferenceStateEnum('completed') + assert active == 'active' + assert completed == 'completed' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_create_call.py b/test/unit/models/test_create_call.py new file mode 100644 index 00000000..25b402d7 --- /dev/null +++ b/test/unit/models/test_create_call.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.create_call import CreateCall +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration + +class TestCreateCall(unittest.TestCase): + """CreateCall unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateCall: + """Test CreateCall + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CreateCall( + to = '+19195551234', + var_from = '+15555551212', + privacy = False, + display_name = 'John Doe', + uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + answer_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer', + answer_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect', + disconnect_method = 'POST', + call_timeout = 30, + callback_timeout = 15, + machine_detection = MachineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', ), + priority = 5, + tag = 'arbitrary text here' + ) + else: + return CreateCall( + to = '+19195551234', + var_from = '+15555551212', + application_id = '1234-qwer-5679-tyui', + answer_url = 'https://www.myCallbackServer.example/webhooks/answer', + ) + + def testCreateCall(self): + """Test CreateCall""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateCall) + assert instance.to == '+19195551234' + assert instance.var_from == '+15555551212' + assert instance.privacy == False + assert instance.display_name == 'John Doe' + assert instance.uui == 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64' + assert instance.application_id == '1234-qwer-5679-tyui' + assert instance.answer_url == 'https://www.myCallbackServer.example/webhooks/answer' + assert instance.answer_method == 'POST' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.answer_fallback_url == 'https://www.myFallbackServer.example/webhooks/answer' + assert instance.answer_fallback_method == 'POST' + assert instance.fallback_username == 'mySecretUsername' + assert instance.fallback_password == 'mySecretPassword1!' + assert instance.disconnect_url == 'https://www.myCallbackServer.example/webhooks/disconnect' + assert instance.disconnect_method == 'POST' + assert instance.call_timeout == 30 + assert instance.callback_timeout == 15 + assert isinstance(instance.machine_detection, MachineDetectionConfiguration) + assert instance.machine_detection.mode == 'async' + assert instance.machine_detection.detection_timeout == 15 + assert instance.machine_detection.silence_timeout == 10 + assert instance.machine_detection.speech_threshold == 10 + assert instance.machine_detection.speech_end_threshold == 5 + assert instance.machine_detection.machine_speech_end_threshold == 5 + assert instance.machine_detection.delay_result == False + assert instance.machine_detection.callback_url == 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete' + assert instance.machine_detection.callback_method == 'POST' + assert instance.machine_detection.username == 'mySecretUsername' + assert instance.machine_detection.password == 'mySecretPassword1!' + assert instance.machine_detection.fallback_url == 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete' + assert instance.machine_detection.fallback_method == 'POST' + assert instance.machine_detection.fallback_username == 'mySecretUsername' + assert instance.machine_detection.fallback_password == 'mySecretPassword1!' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_create_call_response.py b/test/unit/models/test_create_call_response.py new file mode 100644 index 00000000..eaf2a1d3 --- /dev/null +++ b/test/unit/models/test_create_call_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.create_call_response import CreateCallResponse + +class TestCreateCallResponse(unittest.TestCase): + """CreateCallResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateCallResponse: + """Test CreateCallResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + enqueued_time = '2022-06-16T13:15:07.160Z', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_timeout = 30, + callback_timeout = 15, + tag = 'My custom tag value', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + answer_fallback_method = 'POST', + answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + priority = 5 + ) + else: + return CreateCallResponse( + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + account_id = '9900000', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + to = '+19195551234', + var_from = '+19195554321', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + answer_method = 'POST', + answer_url = 'https://myServer.example/bandwidth/webhooks/answer', + disconnect_method = 'POST', + ) + + def testCreateCallResponse(self): + """Test CreateCallResponse""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateCallResponse) + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.account_id == '9900000' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.to == '+19195551234' + assert instance.var_from == '+19195554321' + assert isinstance(instance.enqueued_time, datetime) + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_timeout == 30 + assert instance.callback_timeout == 15 + assert instance.tag == 'My custom tag value' + assert instance.answer_method == 'POST' + assert instance.answer_url == 'https://myServer.example/bandwidth/webhooks/answer' + assert instance.answer_fallback_method == 'POST' + assert instance.answer_fallback_url == 'https://myFallbackServer.example/bandwidth/webhooks/answer' + assert instance.disconnect_method == 'POST' + assert instance.disconnect_url == 'https://myServer.example/bandwidth/webhooks/disconnect' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.fallback_username == 'mySecretUsername' + assert instance.fallback_password == 'mySecretPassword1!' + assert instance.priority == 5 + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_create_lookup_response.py b/test/unit/models/test_create_lookup_response.py similarity index 60% rename from test/unit/test_create_lookup_response.py rename to test/unit/models/test_create_lookup_response.py index 73081e2a..aada4e79 100644 --- a/test/unit/test_create_lookup_response.py +++ b/test/unit/models/test_create_lookup_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.create_lookup_response import CreateLookupResponse # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.create_lookup_response import CreateLookupResponse class TestCreateLookupResponse(unittest.TestCase): """CreateLookupResponse unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CreateLookupResponse: """Test CreateLookupResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `CreateLookupResponse` - """ - model = bandwidth.models.create_lookup_response.CreateLookupResponse() # noqa: E501 - if include_optional : + if include_optional: return CreateLookupResponse( - request_id = '', + request_id = '', status = 'COMPLETE' ) - else : + else: return CreateLookupResponse( ) - """ def testCreateLookupResponse(self): """Test CreateLookupResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateLookupResponse) + assert instance.request_id == '' + assert instance.status == 'COMPLETE' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_create_message_request_error.py b/test/unit/models/test_create_message_request_error.py similarity index 51% rename from test/unit/test_create_message_request_error.py rename to test/unit/models/test_create_message_request_error.py index 031fe199..6f9465c3 100644 --- a/test/unit/test_create_message_request_error.py +++ b/test/unit/models/test_create_message_request_error.py @@ -14,11 +14,9 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.create_message_request_error import CreateMessageRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.create_message_request_error import CreateMessageRequestError +from bandwidth.models.field_error import FieldError class TestCreateMessageRequestError(unittest.TestCase): """CreateMessageRequestError unit test stubs""" @@ -29,35 +27,39 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CreateMessageRequestError: """Test CreateMessageRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `CreateMessageRequestError` - """ - model = bandwidth.models.create_message_request_error.CreateMessageRequestError() # noqa: E501 - if include_optional : + if include_optional: return CreateMessageRequestError( - type = '', - description = '', + type = '', + description = '', field_errors = [ - bandwidth.models.field_error.fieldError( + FieldError( field_name = 'from', - description = ''+invalid' must be replaced with a valid E164 formatted telephone number', ) + description = "'+invalid' must be replaced with a valid E164 formatted telephone number", ) ] ) - else : + else: return CreateMessageRequestError( type = '', description = '', ) - """ def testCreateMessageRequestError(self): """Test CreateMessageRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, CreateMessageRequestError) + assert instance.type == '' + assert instance.description == '' + assert isinstance(instance.field_errors, list) + assert len(instance.field_errors) == 1 + assert isinstance(instance.field_errors[0], FieldError) + assert instance.field_errors[0].field_name == 'from' + assert instance.field_errors[0].description == "'+invalid' must be replaced with a valid E164 formatted telephone number" if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_deferred_result.py b/test/unit/models/test_deferred_result.py similarity index 56% rename from test/unit/test_deferred_result.py rename to test/unit/models/test_deferred_result.py index e9a0fee8..da6490ae 100644 --- a/test/unit/test_deferred_result.py +++ b/test/unit/models/test_deferred_result.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.deferred_result import DeferredResult # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.deferred_result import DeferredResult class TestDeferredResult(unittest.TestCase): """DeferredResult unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> DeferredResult: """Test DeferredResult - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `DeferredResult` - """ - model = bandwidth.models.deferred_result.DeferredResult() # noqa: E501 - if include_optional : + if include_optional: return DeferredResult( - result = None, + result = None, set_or_expired = True ) - else : + else: return DeferredResult( ) - """ def testDeferredResult(self): """Test DeferredResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, DeferredResult) + assert instance.result is None + assert instance.set_or_expired == True if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_disconnect_callback.py b/test/unit/models/test_disconnect_callback.py new file mode 100644 index 00000000..91e2c36d --- /dev/null +++ b/test/unit/models/test_disconnect_callback.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.disconnect_callback import DisconnectCallback + +class TestDisconnectCallback(unittest.TestCase): + """DisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DisconnectCallback: + """Test DisconnectCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return DisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765', + tag = 'exampleTag' + ) + else: + return DisconnectCallback( + ) + + def testDisconnectCallback(self): + """Test DisconnectCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, DisconnectCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.direction == 'inbound' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.cause == 'busy' + assert instance.error_message == 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call' + assert instance.error_id == '4642074b-7b58-478b-96e4-3a60955c6765' + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_diversion.py b/test/unit/models/test_diversion.py new file mode 100644 index 00000000..e96d8c82 --- /dev/null +++ b/test/unit/models/test_diversion.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.diversion import Diversion + +class TestDiversion(unittest.TestCase): + """Diversion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Diversion: + """Test Diversion + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444' + ) + else: + return Diversion( + ) + + def testDiversion(self): + """Test Diversion""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Diversion) + assert instance.reason == 'unavailable' + assert instance.privacy == 'off' + assert instance.screen == 'no' + assert instance.counter == '2' + assert instance.limit == '3' + assert instance.unknown == 'unknownValue' + assert instance.orig_to == '+15558884444' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_dtmf_callback.py b/test/unit/models/test_dtmf_callback.py new file mode 100644 index 00000000..5ab8c3ec --- /dev/null +++ b/test/unit/models/test_dtmf_callback.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.dtmf_callback import DtmfCallback + +class TestDtmfCallback(unittest.TestCase): + """DtmfCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DtmfCallback: + """Test DtmfCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return DtmfCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + direction = 'inbound', + digit = '2', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555', + tag = 'exampleTag' + ) + else: + return DtmfCallback( + ) + + def testDtmfCallback(self): + """Test DtmfCallback""" + instance = self.make_instance(include_optional=True) + self.assertTrue(instance is not None) + self.assertTrue(isinstance(instance, DtmfCallback)) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.direction == 'inbound' + assert instance.digit == '2' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_field_error.py b/test/unit/models/test_field_error.py similarity index 51% rename from test/unit/test_field_error.py rename to test/unit/models/test_field_error.py index 77e049c6..344a7d49 100644 --- a/test/unit/test_field_error.py +++ b/test/unit/models/test_field_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.field_error import FieldError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.field_error import FieldError class TestFieldError(unittest.TestCase): """FieldError unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> FieldError: """Test FieldError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `FieldError` - """ - model = bandwidth.models.field_error.FieldError() # noqa: E501 - if include_optional : + if include_optional: return FieldError( - field_name = 'from', - description = ''+invalid' must be replaced with a valid E164 formatted telephone number' + field_name = 'from', + description = "'+invalid' must be replaced with a valid E164 formatted telephone number" ) - else : + else: return FieldError( ) - """ def testFieldError(self): """Test FieldError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, FieldError) + assert instance.field_name == 'from' + assert instance.description == "'+invalid' must be replaced with a valid E164 formatted telephone number" if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_file_format_enum.py b/test/unit/models/test_file_format_enum.py similarity index 75% rename from test/unit/test_file_format_enum.py rename to test/unit/models/test_file_format_enum.py index 40cf27e0..53b0057b 100644 --- a/test/unit/test_file_format_enum.py +++ b/test/unit/models/test_file_format_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.file_format_enum import FileFormatEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.file_format_enum import FileFormatEnum class TestFileFormatEnum(unittest.TestCase): """FileFormatEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testFileFormatEnum(self): """Test FileFormatEnum""" - # inst = FileFormatEnum() + wav = FileFormatEnum('wav') + mp3 = FileFormatEnum('mp3') + assert wav == 'wav' + assert mp3 == 'mp3' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_gather_callback.py b/test/unit/models/test_gather_callback.py new file mode 100644 index 00000000..28677077 --- /dev/null +++ b/test/unit/models/test_gather_callback.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.gather_callback import GatherCallback + +class TestGatherCallback(unittest.TestCase): + """GatherCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GatherCallback: + """Test GatherCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return GatherCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + digits = '123', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + terminating_digit = '#', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555', + tag = 'exampleTag' + ) + else: + return GatherCallback( + ) + + def testGatherCallback(self): + """Test GatherCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, GatherCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.digits == '123' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.terminating_digit == '#' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + assert instance.tag == 'exampleTag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_inbound_message_callback.py b/test/unit/models/test_inbound_message_callback.py similarity index 54% rename from test/unit/test_inbound_message_callback.py rename to test/unit/models/test_inbound_message_callback.py index d0264bc2..08e91da8 100644 --- a/test/unit/test_inbound_message_callback.py +++ b/test/unit/models/test_inbound_message_callback.py @@ -14,11 +14,10 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.inbound_message_callback import InboundMessageCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.inbound_message_callback import InboundMessageCallback +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage class TestInboundMessageCallback(unittest.TestCase): """InboundMessageCallback unit test stubs""" @@ -29,21 +28,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> InboundMessageCallback: """Test InboundMessageCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `InboundMessageCallback` - """ - model = bandwidth.models.inbound_message_callback.InboundMessageCallback() # noqa: E501 - if include_optional : + if include_optional: return InboundMessageCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-received', - to = '+15552223333', - description = 'Incoming message received', - message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + time = '2016-09-14T18:20:16Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = InboundMessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -51,19 +47,19 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ) ) - else : + else: return InboundMessageCallback( time = '2016-09-14T18:20:16Z', type = 'message-received', to = '+15552223333', description = 'Incoming message received', - message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage( + message = InboundMessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -71,18 +67,35 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ), ) - """ def testInboundMessageCallback(self): """Test InboundMessageCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, InboundMessageCallback) + assert isinstance(instance.time, datetime) + assert instance.type == 'message-received' + assert instance.to == '+15552223333' + assert instance.description == 'Incoming message received' + assert isinstance(instance.message, InboundMessageCallbackMessage) + assert instance.message.id == '1661365814859loidf7mcwd4qacn7' + assert instance.message.owner == '+15553332222' + assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.message.time, datetime) + assert instance.message.segment_count == 1 + assert instance.message.direction == 'in' + assert instance.message.to == ["+15552223333"] + assert instance.message.var_from == '+15553332222' + assert instance.message.text == 'Hello world' + assert instance.message.tag == 'custom string' + assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.message.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_inbound_message_callback_message.py b/test/unit/models/test_inbound_message_callback_message.py similarity index 52% rename from test/unit/test_inbound_message_callback_message.py rename to test/unit/models/test_inbound_message_callback_message.py index 35126e7d..c592fece 100644 --- a/test/unit/test_inbound_message_callback_message.py +++ b/test/unit/models/test_inbound_message_callback_message.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage class TestInboundMessageCallbackMessage(unittest.TestCase): """InboundMessageCallbackMessage unit test stubs""" @@ -29,30 +27,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> InboundMessageCallbackMessage: """Test InboundMessageCallbackMessage - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `InboundMessageCallbackMessage` - """ - model = bandwidth.models.inbound_message_callback_message.InboundMessageCallbackMessage() # noqa: E501 - if include_optional : + if include_optional: return InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default' ) - else : + else: return InboundMessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', @@ -64,12 +59,24 @@ def make_instance(self, include_optional): var_from = '+15553332222', text = 'Hello world', ) - """ def testInboundMessageCallbackMessage(self): """Test InboundMessageCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, InboundMessageCallbackMessage) + assert instance.id == '1661365814859loidf7mcwd4qacn7' + assert instance.owner == '+15553332222' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.time, datetime) + assert instance.segment_count == 1 + assert instance.direction == 'in' + assert instance.to == ["+15552223333"] + assert instance.var_from == '+15553332222' + assert instance.text == 'Hello world' + assert instance.tag == 'custom string' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_initiate_callback.py b/test/unit/models/test_initiate_callback.py new file mode 100644 index 00000000..187b77bb --- /dev/null +++ b/test/unit/models/test_initiate_callback.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.initiate_callback import InitiateCallback +from bandwidth.models.diversion import Diversion +from bandwidth.models.stir_shaken import StirShaken + +class TestInitiateCallback(unittest.TestCase): + """InitiateCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InitiateCallback: + """Test InitiateCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return InitiateCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + start_time = '2022-06-17T22:19:40.375Z', + diversion = Diversion( + reason = 'unavailable', + privacy = 'off', + screen = 'no', + counter = '2', + limit = '3', + unknown = 'unknownValue', + orig_to = '+15558884444', ), + stir_shaken = StirShaken( + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', + originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', ) + ) + else: + return InitiateCallback( + ) + + def testInitiateCallback(self): + """Test InitiateCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, InitiateCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.diversion, Diversion) + assert instance.diversion.reason == 'unavailable' + assert instance.diversion.privacy == 'off' + assert instance.diversion.screen == 'no' + assert instance.diversion.counter == '2' + assert instance.diversion.limit == '3' + assert instance.diversion.unknown == 'unknownValue' + assert instance.diversion.orig_to == '+15558884444' + assert isinstance(instance.stir_shaken, StirShaken) + assert instance.stir_shaken.verstat == 'Tn-Verification-Passed' + assert instance.stir_shaken.attestation_indicator == 'A' + assert instance.stir_shaken.originating_id == '99759086-1335-11ed-9bcf-5f7d464e91af' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_list_message_direction_enum.py b/test/unit/models/test_list_message_direction_enum.py similarity index 77% rename from test/unit/test_list_message_direction_enum.py rename to test/unit/models/test_list_message_direction_enum.py index 72ac6efe..0be98e1d 100644 --- a/test/unit/test_list_message_direction_enum.py +++ b/test/unit/models/test_list_message_direction_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum class TestListMessageDirectionEnum(unittest.TestCase): """ListMessageDirectionEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testListMessageDirectionEnum(self): """Test ListMessageDirectionEnum""" - # inst = ListMessageDirectionEnum() + inbound = ListMessageDirectionEnum('INBOUND') + outbound = ListMessageDirectionEnum('OUTBOUND') + assert inbound == 'INBOUND' + assert outbound == 'OUTBOUND' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_list_message_item.py b/test/unit/models/test_list_message_item.py new file mode 100644 index 00000000..8723b8bb --- /dev/null +++ b/test/unit/models/test_list_message_item.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.list_message_item import ListMessageItem + +class TestListMessageItem(unittest.TestCase): + """ListMessageItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListMessageItem: + """Test ListMessageItem + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return ListMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK' + ) + else: + return ListMessageItem( + ) + + def testListMessageItem(self): + """Test ListMessageItem""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ListMessageItem) + assert instance.message_id == '1589228074636lm4k2je7j7jklbn2' + assert instance.account_id == '9900000' + assert instance.source_tn == '+15554443333' + assert instance.destination_tn == '+15554442222' + assert instance.message_status == 'RECEIVED' + assert instance.message_direction == 'INBOUND' + assert instance.message_type == 'sms' + assert instance.segment_count == 1 + assert instance.error_code == 9902 + assert isinstance(instance.receive_time, datetime) + assert instance.carrier_name == 'other' + assert instance.message_size == 27 + assert instance.message_length == 18 + assert instance.attachment_count == 1 + assert instance.recipient_count == 1 + assert instance.campaign_class == 'T' + assert instance.campaign_id == 'CJEUMDK' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_lookup_request.py b/test/unit/models/test_lookup_request.py similarity index 60% rename from test/unit/test_lookup_request.py rename to test/unit/models/test_lookup_request.py index b9d21bce..5e974aac 100644 --- a/test/unit/test_lookup_request.py +++ b/test/unit/models/test_lookup_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.lookup_request import LookupRequest # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.lookup_request import LookupRequest class TestLookupRequest(unittest.TestCase): """LookupRequest unit test stubs""" @@ -29,32 +26,30 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> LookupRequest: """Test LookupRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `LookupRequest` - """ - model = bandwidth.models.lookup_request.LookupRequest() # noqa: E501 - if include_optional : + if include_optional: return LookupRequest( tns = [ '' ] ) - else : + else: return LookupRequest( tns = [ '' ], ) - """ def testLookupRequest(self): """Test LookupRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, LookupRequest) + assert instance.tns == [''] if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_lookup_result.py b/test/unit/models/test_lookup_result.py new file mode 100644 index 00000000..d8e201cc --- /dev/null +++ b/test/unit/models/test_lookup_result.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.lookup_result import LookupResult + +class TestLookupResult(unittest.TestCase): + """LookupResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LookupResult: + """Test LookupResult + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return LookupResult( + response_code = 0, + message = 'NOERROR', + e_164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010' + ) + else: + return LookupResult( + ) + + def testLookupResult(self): + """Test LookupResult""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, LookupResult) + assert instance.response_code == 0 + assert instance.message == 'NOERROR' + assert instance.e_164_format == '+19195551234' + assert instance.formatted == '(919) 555-1234' + assert instance.country == 'US' + assert instance.line_type == 'Mobile' + assert instance.line_provider == 'Verizon Wireless' + assert instance.mobile_country_code == '310' + assert instance.mobile_network_code == '010' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_lookup_status.py b/test/unit/models/test_lookup_status.py new file mode 100644 index 00000000..b0c082cf --- /dev/null +++ b/test/unit/models/test_lookup_status.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.lookup_status import LookupStatus +from bandwidth.models.lookup_result import LookupResult + +class TestLookupStatus(unittest.TestCase): + """LookupStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LookupStatus: + """Test LookupStatus + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return LookupStatus( + request_id = '004223a0-8b17-41b1-bf81-20732adf5590', + status = 'COMPLETE', + result = [ + LookupResult( + response_code = 0, + message = 'NOERROR', + e_164_format = '+19195551234', + formatted = '(919) 555-1234', + country = 'US', + line_type = 'Mobile', + line_provider = 'Verizon Wireless', + mobile_country_code = '310', + mobile_network_code = '010', ) + ], + failed_telephone_numbers = ["+191955512345"] + ) + else: + return LookupStatus( + ) + + def testLookupStatus(self): + """Test LookupStatus""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, LookupStatus) + assert instance.request_id == '004223a0-8b17-41b1-bf81-20732adf5590' + assert instance.status == 'COMPLETE' + assert isinstance(instance.result, list) + assert len(instance.result) == 1 + assert isinstance(instance.result[0], LookupResult) + assert instance.result[0].response_code == 0 + assert instance.result[0].message == 'NOERROR' + assert instance.result[0].e_164_format == '+19195551234' + assert instance.result[0].formatted == '(919) 555-1234' + assert instance.result[0].country == 'US' + assert instance.result[0].line_type == 'Mobile' + assert instance.result[0].line_provider == 'Verizon Wireless' + assert instance.result[0].mobile_country_code == '310' + assert instance.result[0].mobile_network_code == '010' + assert instance.failed_telephone_numbers == ["+191955512345"] + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_lookup_status_enum.py b/test/unit/models/test_lookup_status_enum.py similarity index 62% rename from test/unit/test_lookup_status_enum.py rename to test/unit/models/test_lookup_status_enum.py index abb4208e..ffb49078 100644 --- a/test/unit/test_lookup_status_enum.py +++ b/test/unit/models/test_lookup_status_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.lookup_status_enum import LookupStatusEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.lookup_status_enum import LookupStatusEnum class TestLookupStatusEnum(unittest.TestCase): """LookupStatusEnum unit test stubs""" @@ -31,7 +28,14 @@ def tearDown(self): def testLookupStatusEnum(self): """Test LookupStatusEnum""" - # inst = LookupStatusEnum() + in_progress = LookupStatusEnum('IN_PROGRESS') + complete = LookupStatusEnum('COMPLETE') + partial_complete = LookupStatusEnum('PARTIAL_COMPLETE') + failed = LookupStatusEnum('FAILED') + assert in_progress == 'IN_PROGRESS' + assert complete == 'COMPLETE' + assert partial_complete == 'PARTIAL_COMPLETE' + assert failed == 'FAILED' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_machine_detection_complete_callback.py b/test/unit/models/test_machine_detection_complete_callback.py new file mode 100644 index 00000000..1a6ca541 --- /dev/null +++ b/test/unit/models/test_machine_detection_complete_callback.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback +from bandwidth.models.machine_detection_result import MachineDetectionResult + +class TestMachineDetectionCompleteCallback(unittest.TestCase): + """MachineDetectionCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MachineDetectionCompleteCallback: + """Test MachineDetectionCompleteCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return MachineDetectionCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + machine_detection_result = MachineDetectionResult( + value = 'answering-machine', + duration = 'PT4.9891287S', ) + ) + else: + return MachineDetectionCompleteCallback( + ) + + def testMachineDetectionCompleteCallback(self): + """Test MachineDetectionCompleteCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MachineDetectionCompleteCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert isinstance(instance.machine_detection_result, MachineDetectionResult) + assert instance.machine_detection_result.value == 'answering-machine' + assert instance.machine_detection_result.duration == 'PT4.9891287S' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_machine_detection_configuration.py b/test/unit/models/test_machine_detection_configuration.py new file mode 100644 index 00000000..a28793be --- /dev/null +++ b/test/unit/models/test_machine_detection_configuration.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration + +class TestMachineDetectionConfiguration(unittest.TestCase): + """MachineDetectionConfiguration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MachineDetectionConfiguration: + """Test MachineDetectionConfiguration + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return MachineDetectionConfiguration( + mode = 'async', + detection_timeout = 15, + silence_timeout = 10, + speech_threshold = 10, + speech_end_threshold = 5, + machine_speech_end_threshold = 5, + delay_result = False, + callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', + fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else: + return MachineDetectionConfiguration( + ) + + def testMachineDetectionConfiguration(self): + """Test MachineDetectionConfiguration""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MachineDetectionConfiguration) + assert instance.mode == 'async' + assert instance.detection_timeout == 15 + assert instance.silence_timeout == 10 + assert instance.speech_threshold == 10 + assert instance.speech_end_threshold == 5 + assert instance.machine_speech_end_threshold == 5 + assert instance.delay_result == False + assert instance.callback_url == 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete' + assert instance.callback_method == 'POST' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.fallback_url == 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete' + assert instance.fallback_method == 'POST' + assert instance.fallback_username == 'mySecretUsername' + assert instance.fallback_password == 'mySecretPassword1!' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_machine_detection_mode_enum.py b/test/unit/models/test_machine_detection_mode_enum.py similarity index 79% rename from test/unit/test_machine_detection_mode_enum.py rename to test/unit/models/test_machine_detection_mode_enum.py index 78928e99..668a3614 100644 --- a/test/unit/test_machine_detection_mode_enum.py +++ b/test/unit/models/test_machine_detection_mode_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum class TestMachineDetectionModeEnum(unittest.TestCase): """MachineDetectionModeEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testMachineDetectionModeEnum(self): """Test MachineDetectionModeEnum""" - # inst = MachineDetectionModeEnum() + sync = MachineDetectionModeEnum('sync') + async_ = MachineDetectionModeEnum('async') + assert sync == 'sync' + assert async_ == 'async' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_machine_detection_result.py b/test/unit/models/test_machine_detection_result.py similarity index 59% rename from test/unit/test_machine_detection_result.py rename to test/unit/models/test_machine_detection_result.py index 845d3360..6cd190df 100644 --- a/test/unit/test_machine_detection_result.py +++ b/test/unit/models/test_machine_detection_result.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.machine_detection_result import MachineDetectionResult # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.machine_detection_result import MachineDetectionResult class TestMachineDetectionResult(unittest.TestCase): """MachineDetectionResult unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MachineDetectionResult: """Test MachineDetectionResult - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MachineDetectionResult` - """ - model = bandwidth.models.machine_detection_result.MachineDetectionResult() # noqa: E501 - if include_optional : + if include_optional: return MachineDetectionResult( - value = 'answering-machine', + value = 'answering-machine', duration = 'PT4.9891287S' ) - else : + else: return MachineDetectionResult( ) - """ def testMachineDetectionResult(self): """Test MachineDetectionResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MachineDetectionResult) + assert instance.value == 'answering-machine' + assert instance.duration == 'PT4.9891287S' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_media.py b/test/unit/models/test_media.py similarity index 54% rename from test/unit/test_media.py rename to test/unit/models/test_media.py index 62011240..de28888c 100644 --- a/test/unit/test_media.py +++ b/test/unit/models/test_media.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.media import Media # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.media import Media class TestMedia(unittest.TestCase): """Media unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Media: """Test Media - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `Media` - """ - model = bandwidth.models.media.Media() # noqa: E501 - if include_optional : + if include_optional: return Media( - content = '', - content_length = 56, + content = '', + content_length = 56, media_name = '' ) - else : + else: return Media( ) - """ def testMedia(self): """Test Media""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Media) + assert instance.content == '' + assert instance.content_length == 56 + assert instance.media_name == '' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_message.py b/test/unit/models/test_message.py new file mode 100644 index 00000000..63b585dc --- /dev/null +++ b/test/unit/models/test_message.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.message import Message + +class TestMessage(unittest.TestCase): + """Message unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Message: + """Test Message + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return Message( + id = '1589228074636lm4k2je7j7jklbn2', + owner = '+15554443333', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2022-09-14T18:20:16Z', + segment_count = 2, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"], + text = 'Hello world', + tag = 'custom tag', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else: + return Message( + ) + + def testMessage(self): + """Test Message""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Message) + assert instance.id == '1589228074636lm4k2je7j7jklbn2' + assert instance.owner == '+15554443333' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.time, datetime) + assert instance.segment_count == 2 + assert instance.direction == 'in' + assert instance.to == ["+15552223333"] + assert instance.var_from == '+15553332222' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png"] + assert instance.text == 'Hello world' + assert instance.tag == 'custom tag' + assert instance.priority == 'default' + assert isinstance(instance.expiration, datetime) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_delivered_callback.py b/test/unit/models/test_message_delivered_callback.py similarity index 54% rename from test/unit/test_message_delivered_callback.py rename to test/unit/models/test_message_delivered_callback.py index 28a9f494..c2b7fafd 100644 --- a/test/unit/test_message_delivered_callback.py +++ b/test/unit/models/test_message_delivered_callback.py @@ -14,11 +14,10 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_delivered_callback import MessageDeliveredCallback +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage class TestMessageDeliveredCallback(unittest.TestCase): """MessageDeliveredCallback unit test stubs""" @@ -29,21 +28,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageDeliveredCallback: """Test MessageDeliveredCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageDeliveredCallback` - """ - model = bandwidth.models.message_delivered_callback.MessageDeliveredCallback() # noqa: E501 - if include_optional : + if include_optional: return MessageDeliveredCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-delivered', - to = '+15552223333', - description = 'Message delivered to carrier.', - message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + time = '2016-09-14T18:20:16Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = MessageDeliveredCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -51,19 +47,19 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ) ) - else : + else: return MessageDeliveredCallback( time = '2016-09-14T18:20:16Z', type = 'message-delivered', to = '+15552223333', description = 'Message delivered to carrier.', - message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage( + message = MessageDeliveredCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -71,18 +67,35 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ), ) - """ def testMessageDeliveredCallback(self): """Test MessageDeliveredCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageDeliveredCallback) + assert isinstance(instance.time, datetime) + assert instance.type == 'message-delivered' + assert instance.to == '+15552223333' + assert instance.description == 'Message delivered to carrier.' + assert isinstance(instance.message, MessageDeliveredCallbackMessage) + assert instance.message.id == '1661365814859loidf7mcwd4qacn7' + assert instance.message.owner == '+15553332222' + assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.message.time, datetime) + assert instance.message.segment_count == 1 + assert instance.message.direction == 'in' + assert instance.message.to == ["+15552223333"] + assert instance.message.var_from == '+15553332222' + assert instance.message.text == 'Hello world' + assert instance.message.tag == 'custom string' + assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.message.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_delivered_callback_message.py b/test/unit/models/test_message_delivered_callback_message.py similarity index 52% rename from test/unit/test_message_delivered_callback_message.py rename to test/unit/models/test_message_delivered_callback_message.py index b7b31569..3f92aede 100644 --- a/test/unit/test_message_delivered_callback_message.py +++ b/test/unit/models/test_message_delivered_callback_message.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage class TestMessageDeliveredCallbackMessage(unittest.TestCase): """MessageDeliveredCallbackMessage unit test stubs""" @@ -29,30 +27,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageDeliveredCallbackMessage: """Test MessageDeliveredCallbackMessage - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageDeliveredCallbackMessage` - """ - model = bandwidth.models.message_delivered_callback_message.MessageDeliveredCallbackMessage() # noqa: E501 - if include_optional : + if include_optional: return MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default' ) - else : + else: return MessageDeliveredCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', @@ -65,12 +60,24 @@ def make_instance(self, include_optional): text = 'Hello world', tag = 'custom string', ) - """ def testMessageDeliveredCallbackMessage(self): """Test MessageDeliveredCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageDeliveredCallbackMessage) + assert instance.id == '1661365814859loidf7mcwd4qacn7' + assert instance.owner == '+15553332222' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.time, datetime) + assert instance.segment_count == 1 + assert instance.direction == 'in' + assert instance.to == ["+15552223333"] + assert instance.var_from == '+15553332222' + assert instance.text == 'Hello world' + assert instance.tag == 'custom string' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_direction_enum.py b/test/unit/models/test_message_direction_enum.py similarity index 81% rename from test/unit/test_message_direction_enum.py rename to test/unit/models/test_message_direction_enum.py index d29a5719..879abb30 100644 --- a/test/unit/test_message_direction_enum.py +++ b/test/unit/models/test_message_direction_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.message_direction_enum import MessageDirectionEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_direction_enum import MessageDirectionEnum class TestMessageDirectionEnum(unittest.TestCase): """MessageDirectionEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testMessageDirectionEnum(self): """Test MessageDirectionEnum""" - # inst = MessageDirectionEnum() + in_ = MessageDirectionEnum('in') + out = MessageDirectionEnum('out') + assert in_ == 'in' + assert out == 'out' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_failed_callback.py b/test/unit/models/test_message_failed_callback.py similarity index 55% rename from test/unit/test_message_failed_callback.py rename to test/unit/models/test_message_failed_callback.py index 08699c8b..dd96c182 100644 --- a/test/unit/test_message_failed_callback.py +++ b/test/unit/models/test_message_failed_callback.py @@ -14,11 +14,10 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_failed_callback import MessageFailedCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_failed_callback import MessageFailedCallback +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage class TestMessageFailedCallback(unittest.TestCase): """MessageFailedCallback unit test stubs""" @@ -29,21 +28,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageFailedCallback: """Test MessageFailedCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageFailedCallback` - """ - model = bandwidth.models.message_failed_callback.MessageFailedCallback() # noqa: E501 - if include_optional : + if include_optional: return MessageFailedCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-failed', - to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + time = '2016-09-14T18:20:16Z', + type = 'message-failed', + to = '+15552223333', + description = 'rejected-unallocated-from-number', + message = MessageFailedCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -51,20 +47,20 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), + priority = 'default', ), error_code = 9902 ) - else : + else: return MessageFailedCallback( time = '2016-09-14T18:20:16Z', type = 'message-failed', to = '+15552223333', description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage( + message = MessageFailedCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -72,19 +68,37 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ), error_code = 9902, ) - """ def testMessageFailedCallback(self): """Test MessageFailedCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageFailedCallback) + assert isinstance(instance.time, datetime) + assert instance.type == 'message-failed' + assert instance.to == '+15552223333' + assert instance.description == 'rejected-unallocated-from-number' + assert isinstance(instance.message, MessageFailedCallbackMessage) + assert instance.message.id == '1661365814859loidf7mcwd4qacn7' + assert instance.message.owner == '+15553332222' + assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.message.time, datetime) + assert instance.message.segment_count == 1 + assert instance.message.direction == 'in' + assert instance.message.to == ["+15552223333"] + assert instance.message.var_from == '+15553332222' + assert instance.message.text == 'Hello world' + assert instance.message.tag == 'custom string' + assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.message.priority == 'default' + assert instance.error_code == 9902 if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_failed_callback_message.py b/test/unit/models/test_message_failed_callback_message.py similarity index 53% rename from test/unit/test_message_failed_callback_message.py rename to test/unit/models/test_message_failed_callback_message.py index 71c42fb5..4c16e048 100644 --- a/test/unit/test_message_failed_callback_message.py +++ b/test/unit/models/test_message_failed_callback_message.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage class TestMessageFailedCallbackMessage(unittest.TestCase): """MessageFailedCallbackMessage unit test stubs""" @@ -29,30 +27,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageFailedCallbackMessage: """Test MessageFailedCallbackMessage - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageFailedCallbackMessage` - """ - model = bandwidth.models.message_failed_callback_message.MessageFailedCallbackMessage() # noqa: E501 - if include_optional : + if include_optional: return MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default' ) - else : + else: return MessageFailedCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', @@ -66,12 +61,24 @@ def make_instance(self, include_optional): tag = 'custom string', priority = 'default', ) - """ def testMessageFailedCallbackMessage(self): """Test MessageFailedCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageFailedCallbackMessage) + assert instance.id == '1661365814859loidf7mcwd4qacn7' + assert instance.owner == '+15553332222' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.time, datetime) + assert instance.segment_count == 1 + assert instance.direction == 'in' + assert instance.to == ["+15552223333"] + assert instance.var_from == '+15553332222' + assert instance.text == 'Hello world' + assert instance.tag == 'custom string' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_request.py b/test/unit/models/test_message_request.py similarity index 51% rename from test/unit/test_message_request.py rename to test/unit/models/test_message_request.py index 950d437a..16e5126a 100644 --- a/test/unit/test_message_request.py +++ b/test/unit/models/test_message_request.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_request import MessageRequest # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_request import MessageRequest class TestMessageRequest(unittest.TestCase): """MessageRequest unit test stubs""" @@ -29,37 +27,42 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageRequest: """Test MessageRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageRequest` - """ - model = bandwidth.models.message_request.MessageRequest() # noqa: E501 - if include_optional : + if include_optional: return MessageRequest( - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - to = ["+15554443333","+15552223333"], - var_from = '+15551113333', - text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - tag = 'custom string', - priority = 'default', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + to = ["+15554443333","+15552223333"], + var_from = '+15551113333', + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + tag = 'custom string', + priority = 'default', expiration = '2021-02-01T11:29:18-05:00' ) - else : + else: return MessageRequest( application_id = '93de2206-9669-4e07-948d-329f4b722ee2', to = ["+15554443333","+15552223333"], var_from = '+15551113333', ) - """ def testMessageRequest(self): """Test MessageRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageRequest) + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert instance.to == ["+15554443333","+15552223333"] + assert instance.var_from == '+15551113333' + assert instance.text == 'Hello world' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.tag == 'custom string' + assert instance.priority == 'default' + assert isinstance(instance.expiration, datetime) if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_sending_callback.py b/test/unit/models/test_message_sending_callback.py similarity index 54% rename from test/unit/test_message_sending_callback.py rename to test/unit/models/test_message_sending_callback.py index b2ab77f3..958a36d0 100644 --- a/test/unit/test_message_sending_callback.py +++ b/test/unit/models/test_message_sending_callback.py @@ -14,11 +14,10 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_sending_callback import MessageSendingCallback # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_sending_callback import MessageSendingCallback +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage class TestMessageSendingCallback(unittest.TestCase): """MessageSendingCallback unit test stubs""" @@ -29,21 +28,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageSendingCallback: """Test MessageSendingCallback - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageSendingCallback` - """ - model = bandwidth.models.message_sending_callback.MessageSendingCallback() # noqa: E501 - if include_optional : + if include_optional: return MessageSendingCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-sending', - to = '+15552223333', - description = 'Message is sending to carrier', - message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + time = '2016-09-14T18:20:16Z', + type = 'message-sending', + to = '+15552223333', + description = 'Message is sending to carrier', + message = MessageSendingCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -51,19 +47,19 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ) ) - else : + else: return MessageSendingCallback( time = '2016-09-14T18:20:16Z', type = 'message-sending', to = '+15552223333', description = 'Message is sending to carrier', - message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage( + message = MessageSendingCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -71,18 +67,35 @@ def make_instance(self, include_optional): segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ), ) - """ def testMessageSendingCallback(self): """Test MessageSendingCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageSendingCallback) + assert isinstance(instance.time, datetime) + assert instance.type == 'message-sending' + assert instance.to == '+15552223333' + assert instance.description == 'Message is sending to carrier' + assert isinstance(instance.message, MessageSendingCallbackMessage) + assert instance.message.id == '1661365814859loidf7mcwd4qacn7' + assert instance.message.owner == '+15553332222' + assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.message.time, datetime) + assert instance.message.segment_count == 1 + assert instance.message.direction == 'in' + assert instance.message.to == ["+15552223333"] + assert instance.message.var_from == '+15553332222' + assert instance.message.text == 'Hello world' + assert instance.message.tag == 'custom string' + assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.message.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_message_sending_callback_message.py b/test/unit/models/test_message_sending_callback_message.py similarity index 54% rename from test/unit/test_message_sending_callback_message.py rename to test/unit/models/test_message_sending_callback_message.py index 9899720f..851e4643 100644 --- a/test/unit/test_message_sending_callback_message.py +++ b/test/unit/models/test_message_sending_callback_message.py @@ -14,11 +14,9 @@ import unittest -import datetime +from datetime import datetime -import bandwidth -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage class TestMessageSendingCallbackMessage(unittest.TestCase): """MessageSendingCallbackMessage unit test stubs""" @@ -29,30 +27,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessageSendingCallbackMessage: """Test MessageSendingCallbackMessage - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessageSendingCallbackMessage` - """ - model = bandwidth.models.message_sending_callback_message.MessageSendingCallbackMessage() # noqa: E501 - if include_optional : + if include_optional: return MessageSendingCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2016-09-14T18:20:16Z', + segment_count = 1, + direction = 'in', + to = ["+15552223333"], + var_from = '+15553332222', + text = 'Hello world', + tag = 'custom string', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default' ) - else : + else: return MessageSendingCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', @@ -66,12 +61,24 @@ def make_instance(self, include_optional): media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ) - """ def testMessageSendingCallbackMessage(self): """Test MessageSendingCallbackMessage""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessageSendingCallbackMessage) + assert instance.id == '1661365814859loidf7mcwd4qacn7' + assert instance.owner == '+15553332222' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert isinstance(instance.time, datetime) + assert instance.segment_count == 1 + assert instance.direction == 'in' + assert instance.to == ["+15552223333"] + assert instance.var_from == '+15553332222' + assert instance.text == 'Hello world' + assert instance.tag == 'custom string' + assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.priority == 'default' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_message_status_enum.py b/test/unit/models/test_message_status_enum.py new file mode 100644 index 00000000..ccf934cf --- /dev/null +++ b/test/unit/models/test_message_status_enum.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.message_status_enum import MessageStatusEnum + +class TestMessageStatusEnum(unittest.TestCase): + """MessageStatusEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageStatusEnum(self): + """Test MessageStatusEnum""" + received = MessageStatusEnum('RECEIVED') + queued = MessageStatusEnum('QUEUED') + sending = MessageStatusEnum('SENDING') + sent = MessageStatusEnum('SENT') + failed = MessageStatusEnum('FAILED') + delivered = MessageStatusEnum('DELIVERED') + accepted = MessageStatusEnum('ACCEPTED') + undelivered = MessageStatusEnum('UNDELIVERED') + assert received == 'RECEIVED' + assert queued == 'QUEUED' + assert sending == 'SENDING' + assert sent == 'SENT' + assert failed == 'FAILED' + assert delivered == 'DELIVERED' + assert accepted == 'ACCEPTED' + assert undelivered == 'UNDELIVERED' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_message_type_enum.py b/test/unit/models/test_message_type_enum.py similarity index 74% rename from test/unit/test_message_type_enum.py rename to test/unit/models/test_message_type_enum.py index 05699d58..fd58f711 100644 --- a/test/unit/test_message_type_enum.py +++ b/test/unit/models/test_message_type_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.message_type_enum import MessageTypeEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.message_type_enum import MessageTypeEnum class TestMessageTypeEnum(unittest.TestCase): """MessageTypeEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testMessageTypeEnum(self): """Test MessageTypeEnum""" - # inst = MessageTypeEnum() + sms = MessageTypeEnum('sms') + mms = MessageTypeEnum('mms') + assert sms == 'sms' + assert mms == 'mms' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_messages_list.py b/test/unit/models/test_messages_list.py new file mode 100644 index 00000000..9a6f6e0a --- /dev/null +++ b/test/unit/models/test_messages_list.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.messages_list import MessagesList +from bandwidth.models.page_info import PageInfo +from bandwidth.models.list_message_item import ListMessageItem + +class TestMessagesList(unittest.TestCase): + """MessagesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MessagesList: + """Test MessagesList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return MessagesList( + total_count = 100, + page_info = PageInfo( + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', + next_page_token = 'GL83PD3C', ), + messages = [ + ListMessageItem( + message_id = '1589228074636lm4k2je7j7jklbn2', + account_id = '9900000', + source_tn = '+15554443333', + destination_tn = '+15554442222', + message_status = 'RECEIVED', + message_direction = 'INBOUND', + message_type = 'sms', + segment_count = 1, + error_code = 9902, + receive_time = '2020-04-07T14:03:07Z', + carrier_name = 'other', + message_size = 27, + message_length = 18, + attachment_count = 1, + recipient_count = 1, + campaign_class = 'T', + campaign_id = 'CJEUMDK', ) + ] + ) + else: + return MessagesList( + ) + + def testMessagesList(self): + """Test MessagesList""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessagesList) + assert instance.total_count == 100 + assert isinstance(instance.page_info, PageInfo) + assert instance.page_info.prev_page == 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902' + assert instance.page_info.next_page == 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C' + assert instance.page_info.prev_page_token == 'DLAPE902' + assert instance.page_info.next_page_token == 'GL83PD3C' + assert isinstance(instance.messages, list) + assert len(instance.messages) == 1 + assert isinstance(instance.messages[0], ListMessageItem) + assert instance.messages[0].message_id == '1589228074636lm4k2je7j7jklbn2' + assert instance.messages[0].account_id == '9900000' + assert instance.messages[0].source_tn == '+15554443333' + assert instance.messages[0].destination_tn == '+15554442222' + assert instance.messages[0].message_status == 'RECEIVED' + assert instance.messages[0].message_direction == 'INBOUND' + assert instance.messages[0].message_type == 'sms' + assert instance.messages[0].segment_count == 1 + assert instance.messages[0].error_code == 9902 + assert isinstance(instance.messages[0].receive_time, datetime) + assert instance.messages[0].carrier_name == 'other' + assert instance.messages[0].message_size == 27 + assert instance.messages[0].message_length == 18 + assert instance.messages[0].attachment_count == 1 + assert instance.messages[0].recipient_count == 1 + assert instance.messages[0].campaign_class == 'T' + assert instance.messages[0].campaign_id == 'CJEUMDK' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_messaging_code_response.py b/test/unit/models/test_messaging_code_response.py similarity index 58% rename from test/unit/test_messaging_code_response.py rename to test/unit/models/test_messaging_code_response.py index 53578365..5e8d8be7 100644 --- a/test/unit/test_messaging_code_response.py +++ b/test/unit/models/test_messaging_code_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.messaging_code_response import MessagingCodeResponse # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.messaging_code_response import MessagingCodeResponse class TestMessagingCodeResponse(unittest.TestCase): """MessagingCodeResponse unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessagingCodeResponse: """Test MessagingCodeResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessagingCodeResponse` - """ - model = bandwidth.models.messaging_code_response.MessagingCodeResponse() # noqa: E501 - if include_optional : + if include_optional: return MessagingCodeResponse( - message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' + message_id = '1589228074636lm4k2je7j7jklbn2' ) - else : + else: return MessagingCodeResponse( ) - """ def testMessagingCodeResponse(self): """Test MessagingCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessagingCodeResponse) + assert instance.message_id == '1589228074636lm4k2je7j7jklbn2' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_messaging_request_error.py b/test/unit/models/test_messaging_request_error.py similarity index 61% rename from test/unit/test_messaging_request_error.py rename to test/unit/models/test_messaging_request_error.py index ec14fc51..e7dd1b76 100644 --- a/test/unit/test_messaging_request_error.py +++ b/test/unit/models/test_messaging_request_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.messaging_request_error import MessagingRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.messaging_request_error import MessagingRequestError class TestMessagingRequestError(unittest.TestCase): """MessagingRequestError unit test stubs""" @@ -29,30 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MessagingRequestError: """Test MessagingRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MessagingRequestError` - """ - model = bandwidth.models.messaging_request_error.MessagingRequestError() # noqa: E501 - if include_optional : + if include_optional: return MessagingRequestError( - type = '', + type = '', description = '' ) - else : + else: return MessagingRequestError( type = '', description = '', ) - """ def testMessagingRequestError(self): """Test MessagingRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MessagingRequestError) + assert instance.type == '' + assert instance.description == '' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_forbidden_request_error.py b/test/unit/models/test_mfa_forbidden_request_error.py similarity index 61% rename from test/unit/test_mfa_forbidden_request_error.py rename to test/unit/models/test_mfa_forbidden_request_error.py index 5a754be2..e5f8331e 100644 --- a/test/unit/test_mfa_forbidden_request_error.py +++ b/test/unit/models/test_mfa_forbidden_request_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError class TestMfaForbiddenRequestError(unittest.TestCase): """MfaForbiddenRequestError unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MfaForbiddenRequestError: """Test MfaForbiddenRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MfaForbiddenRequestError` - """ - model = bandwidth.models.mfa_forbidden_request_error.MfaForbiddenRequestError() # noqa: E501 - if include_optional : + if include_optional: return MfaForbiddenRequestError( message = 'Missing Authentication Token' ) - else : + else: return MfaForbiddenRequestError( ) - """ def testMfaForbiddenRequestError(self): """Test MfaForbiddenRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MfaForbiddenRequestError) + assert instance.message == 'Missing Authentication Token' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_request_error.py b/test/unit/models/test_mfa_request_error.py similarity index 55% rename from test/unit/test_mfa_request_error.py rename to test/unit/models/test_mfa_request_error.py index 2e5423b9..b6ccd7dd 100644 --- a/test/unit/test_mfa_request_error.py +++ b/test/unit/models/test_mfa_request_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.mfa_request_error import MfaRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.mfa_request_error import MfaRequestError class TestMfaRequestError(unittest.TestCase): """MfaRequestError unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MfaRequestError: """Test MfaRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MfaRequestError` - """ - model = bandwidth.models.mfa_request_error.MfaRequestError() # noqa: E501 - if include_optional : + if include_optional: return MfaRequestError( - error = '400 Request is malformed or invalid', + error = '400 Request is malformed or invalid', request_id = '354cc8a3-6701-461e-8fa7-8671703dd898' ) - else : + else: return MfaRequestError( ) - """ def testMfaRequestError(self): """Test MfaRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MfaRequestError) + assert instance.error == '400 Request is malformed or invalid' + assert instance.request_id == '354cc8a3-6701-461e-8fa7-8671703dd898' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_mfa_unauthorized_request_error.py b/test/unit/models/test_mfa_unauthorized_request_error.py similarity index 61% rename from test/unit/test_mfa_unauthorized_request_error.py rename to test/unit/models/test_mfa_unauthorized_request_error.py index c6e719ce..3e5a7bff 100644 --- a/test/unit/test_mfa_unauthorized_request_error.py +++ b/test/unit/models/test_mfa_unauthorized_request_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError class TestMfaUnauthorizedRequestError(unittest.TestCase): """MfaUnauthorizedRequestError unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MfaUnauthorizedRequestError: """Test MfaUnauthorizedRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `MfaUnauthorizedRequestError` - """ - model = bandwidth.models.mfa_unauthorized_request_error.MfaUnauthorizedRequestError() # noqa: E501 - if include_optional : + if include_optional: return MfaUnauthorizedRequestError( message = 'Unauthorized' ) - else : + else: return MfaUnauthorizedRequestError( ) - """ def testMfaUnauthorizedRequestError(self): """Test MfaUnauthorizedRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MfaUnauthorizedRequestError) + assert instance.message == 'Unauthorized' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_page_info.py b/test/unit/models/test_page_info.py similarity index 56% rename from test/unit/test_page_info.py rename to test/unit/models/test_page_info.py index 07dc573a..c79674fd 100644 --- a/test/unit/test_page_info.py +++ b/test/unit/models/test_page_info.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.page_info import PageInfo # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.page_info import PageInfo class TestPageInfo(unittest.TestCase): """PageInfo unit test stubs""" @@ -29,30 +26,31 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PageInfo: """Test PageInfo - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `PageInfo` - """ - model = bandwidth.models.page_info.PageInfo() # noqa: E501 - if include_optional : + if include_optional: return PageInfo( - prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', - next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', - prev_page_token = 'DLAPE902', + prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', + next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', + prev_page_token = 'DLAPE902', next_page_token = 'GL83PD3C' ) - else : + else: return PageInfo( ) - """ def testPageInfo(self): """Test PageInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, PageInfo) + assert instance.prev_page == 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902' + assert instance.next_page == 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C' + assert instance.prev_page_token == 'DLAPE902' + assert instance.next_page_token == 'GL83PD3C' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_priority_enum.py b/test/unit/models/test_priority_enum.py similarity index 73% rename from test/unit/test_priority_enum.py rename to test/unit/models/test_priority_enum.py index 6111bb1d..54ca8c64 100644 --- a/test/unit/test_priority_enum.py +++ b/test/unit/models/test_priority_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.priority_enum import PriorityEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.priority_enum import PriorityEnum class TestPriorityEnum(unittest.TestCase): """PriorityEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testPriorityEnum(self): """Test PriorityEnum""" - # inst = PriorityEnum() + default = PriorityEnum('default') + high = PriorityEnum('high') + assert default == 'default' + assert high == 'high' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_recording_available_callback.py b/test/unit/models/test_recording_available_callback.py new file mode 100644 index 00000000..836fafce --- /dev/null +++ b/test/unit/models/test_recording_available_callback.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.recording_available_callback import RecordingAvailableCallback + +class TestRecordingAvailableCallback(unittest.TestCase): + """RecordingAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecordingAvailableCallback: + """Test RecordingAvailableCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return RecordingAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 1, + tag = 'exampleTag', + status = 'completed', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555' + ) + else: + return RecordingAvailableCallback( + ) + + def testRecordingAvailableCallback(self): + """Test RecordingAvailableCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RecordingAvailableCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.duration == 'PT13.67S' + assert instance.file_format == 'wav' + assert instance.channels == 1 + assert instance.tag == 'exampleTag' + assert instance.status == 'completed' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_recording_complete_callback.py b/test/unit/models/test_recording_complete_callback.py new file mode 100644 index 00000000..6ed07ca1 --- /dev/null +++ b/test/unit/models/test_recording_complete_callback.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.recording_complete_callback import RecordingCompleteCallback + +class TestRecordingCompleteCallback(unittest.TestCase): + """RecordingCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecordingCompleteCallback: + """Test RecordingCompleteCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return RecordingCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + channels = 1, + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555' + ) + else: + return RecordingCompleteCallback( + ) + + def testRecordingCompleteCallback(self): + """Test RecordingCompleteCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RecordingCompleteCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.duration == 'PT13.67S' + assert instance.file_format == 'wav' + assert instance.channels == 1 + assert instance.tag == 'exampleTag' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_recording_state_enum.py b/test/unit/models/test_recording_state_enum.py similarity index 78% rename from test/unit/test_recording_state_enum.py rename to test/unit/models/test_recording_state_enum.py index de388697..85d34468 100644 --- a/test/unit/test_recording_state_enum.py +++ b/test/unit/models/test_recording_state_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.recording_state_enum import RecordingStateEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.recording_state_enum import RecordingStateEnum class TestRecordingStateEnum(unittest.TestCase): """RecordingStateEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testRecordingStateEnum(self): """Test RecordingStateEnum""" - # inst = RecordingStateEnum() + paused = RecordingStateEnum('paused') + recording = RecordingStateEnum('recording') + assert paused == 'paused' + assert recording == 'recording' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_recording_transcription_metadata.py b/test/unit/models/test_recording_transcription_metadata.py new file mode 100644 index 00000000..4682eb88 --- /dev/null +++ b/test/unit/models/test_recording_transcription_metadata.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.recording_transcription_metadata import RecordingTranscriptionMetadata + +class TestRecordingTranscriptionMetadata(unittest.TestCase): + """RecordingTranscriptionMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecordingTranscriptionMetadata: + """Test RecordingTranscriptionMetadata + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return RecordingTranscriptionMetadata( + id = 't-387bd648-18f3-4823-9d16-746bca0003c9', + status = 'completed', + completed_time = '2022-06-13T18:46:29.715Z', + url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' + ) + else: + return RecordingTranscriptionMetadata( + ) + + def testRecordingTranscriptionMetadata(self): + """Test RecordingTranscriptionMetadata""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RecordingTranscriptionMetadata) + assert instance.id == 't-387bd648-18f3-4823-9d16-746bca0003c9' + assert instance.status == 'completed' + assert isinstance(instance.completed_time, datetime) + assert instance.url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_recording_transcriptions.py b/test/unit/models/test_recording_transcriptions.py new file mode 100644 index 00000000..c5e876ee --- /dev/null +++ b/test/unit/models/test_recording_transcriptions.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.recording_transcriptions import RecordingTranscriptions +from bandwidth.models.transcription import Transcription + +class TestRecordingTranscriptions(unittest.TestCase): + """RecordingTranscriptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecordingTranscriptions: + """Test RecordingTranscriptions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return RecordingTranscriptions( + transcripts = [ + Transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ) + ] + ) + else: + return RecordingTranscriptions( + ) + + def testRecordingTranscriptions(self): + """Test RecordingTranscriptions""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RecordingTranscriptions) + assert len(instance.transcripts) == 1 + assert isinstance(instance.transcripts[0], Transcription) + assert instance.transcripts[0].text == 'Nice talking to you, friend!' + assert instance.transcripts[0].confidence == 0.9 + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_redirect_callback.py b/test/unit/models/test_redirect_callback.py new file mode 100644 index 00000000..8a275585 --- /dev/null +++ b/test/unit/models/test_redirect_callback.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.redirect_callback import RedirectCallback + +class TestRedirectCallback(unittest.TestCase): + """RedirectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RedirectCallback: + """Test RedirectCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return RedirectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555' + ) + else: + return RedirectCallback( + ) + + def testRedirectCallback(self): + """Test RedirectCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RedirectCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_redirect_method_enum.py b/test/unit/models/test_redirect_method_enum.py similarity index 81% rename from test/unit/test_redirect_method_enum.py rename to test/unit/models/test_redirect_method_enum.py index b1908a31..6f8fa1b7 100644 --- a/test/unit/test_redirect_method_enum.py +++ b/test/unit/models/test_redirect_method_enum.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.redirect_method_enum import RedirectMethodEnum # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.redirect_method_enum import RedirectMethodEnum class TestRedirectMethodEnum(unittest.TestCase): """RedirectMethodEnum unit test stubs""" @@ -31,7 +28,10 @@ def tearDown(self): def testRedirectMethodEnum(self): """Test RedirectMethodEnum""" - # inst = RedirectMethodEnum() + get = RedirectMethodEnum('GET') + post = RedirectMethodEnum('POST') + assert get == 'GET' + assert post == 'POST' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_stir_shaken.py b/test/unit/models/test_stir_shaken.py similarity index 54% rename from test/unit/test_stir_shaken.py rename to test/unit/models/test_stir_shaken.py index 17fff122..7be43992 100644 --- a/test/unit/test_stir_shaken.py +++ b/test/unit/models/test_stir_shaken.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.stir_shaken import StirShaken # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.stir_shaken import StirShaken class TestStirShaken(unittest.TestCase): """StirShaken unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StirShaken: """Test StirShaken - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `StirShaken` - """ - model = bandwidth.models.stir_shaken.StirShaken() # noqa: E501 - if include_optional : + if include_optional: return StirShaken( - verstat = 'Tn-Verification-Passed', - attestation_indicator = 'A', + verstat = 'Tn-Verification-Passed', + attestation_indicator = 'A', originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af' ) - else : + else: return StirShaken( ) - """ def testStirShaken(self): """Test StirShaken""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, StirShaken) + assert instance.verstat == 'Tn-Verification-Passed' + assert instance.attestation_indicator == 'A' + assert instance.originating_id == '99759086-1335-11ed-9bcf-5f7d464e91af' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_tag.py b/test/unit/models/test_tag.py similarity index 56% rename from test/unit/test_tag.py rename to test/unit/models/test_tag.py index c773cad7..5c5bd978 100644 --- a/test/unit/test_tag.py +++ b/test/unit/models/test_tag.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.tag import Tag # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.tag import Tag class TestTag(unittest.TestCase): """Tag unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Tag: """Test Tag - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `Tag` - """ - model = bandwidth.models.tag.Tag() # noqa: E501 - if include_optional : + if include_optional: return Tag( - key = '', + key = '', value = '' ) - else : + else: return Tag( ) - """ def testTag(self): """Test Tag""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Tag) + assert instance.key == '' + assert instance.value == '' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_tn_lookup_request_error.py b/test/unit/models/test_tn_lookup_request_error.py similarity index 61% rename from test/unit/test_tn_lookup_request_error.py rename to test/unit/models/test_tn_lookup_request_error.py index ae62fa79..7f752257 100644 --- a/test/unit/test_tn_lookup_request_error.py +++ b/test/unit/models/test_tn_lookup_request_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.tn_lookup_request_error import TnLookupRequestError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.tn_lookup_request_error import TnLookupRequestError class TestTnLookupRequestError(unittest.TestCase): """TnLookupRequestError unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> TnLookupRequestError: """Test TnLookupRequestError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `TnLookupRequestError` - """ - model = bandwidth.models.tn_lookup_request_error.TnLookupRequestError() # noqa: E501 - if include_optional : + if include_optional: return TnLookupRequestError( message = 'example error message' ) - else : + else: return TnLookupRequestError( ) - """ def testTnLookupRequestError(self): """Test TnLookupRequestError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TnLookupRequestError) + assert instance.message == 'example error message' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcribe_recording.py b/test/unit/models/test_transcribe_recording.py similarity index 50% rename from test/unit/test_transcribe_recording.py rename to test/unit/models/test_transcribe_recording.py index 6bc69901..3b002125 100644 --- a/test/unit/test_transcribe_recording.py +++ b/test/unit/models/test_transcribe_recording.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.transcribe_recording import TranscribeRecording # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.transcribe_recording import TranscribeRecording class TestTranscribeRecording(unittest.TestCase): """TranscribeRecording unit test stubs""" @@ -29,33 +26,37 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> TranscribeRecording: """Test TranscribeRecording - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `TranscribeRecording` - """ - model = bandwidth.models.transcribe_recording.TranscribeRecording() # noqa: E501 - if include_optional : + if include_optional: return TranscribeRecording( - callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - tag = 'exampleTag', - callback_timeout = 5.5, + callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable', + callback_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + tag = 'exampleTag', + callback_timeout = 5.5, detect_language = True ) - else : + else: return TranscribeRecording( ) - """ def testTranscribeRecording(self): """Test TranscribeRecording""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TranscribeRecording) + assert instance.callback_url == 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable' + assert instance.callback_method == 'POST' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.tag == 'exampleTag' + assert instance.callback_timeout == 5.5 + assert instance.detect_language == True if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_transcription.py b/test/unit/models/test_transcription.py similarity index 55% rename from test/unit/test_transcription.py rename to test/unit/models/test_transcription.py index 0913bc68..2f4b0af1 100644 --- a/test/unit/test_transcription.py +++ b/test/unit/models/test_transcription.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.transcription import Transcription # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.transcription import Transcription class TestTranscription(unittest.TestCase): """Transcription unit test stubs""" @@ -29,28 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Transcription: """Test Transcription - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `Transcription` - """ - model = bandwidth.models.transcription.Transcription() # noqa: E501 - if include_optional : + if include_optional: return Transcription( - text = 'Nice talking to you, friend!', + text = 'Nice talking to you, friend!', confidence = 0.9 ) - else : + else: return Transcription( ) - """ def testTranscription(self): """Test Transcription""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Transcription) + assert instance.text == 'Nice talking to you, friend!' + assert instance.confidence == 0.9 if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_transcription_available_callback.py b/test/unit/models/test_transcription_available_callback.py new file mode 100644 index 00000000..937f2e04 --- /dev/null +++ b/test/unit/models/test_transcription_available_callback.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback +from bandwidth.models.transcription import Transcription + +class TestTranscriptionAvailableCallback(unittest.TestCase): + """TranscriptionAvailableCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TranscriptionAvailableCallback: + """Test TranscriptionAvailableCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return TranscriptionAvailableCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + end_time = '2022-06-17T22:20Z', + duration = 'PT13.67S', + file_format = 'wav', + tag = 'exampleTag', + transcription = Transcription( + text = 'Nice talking to you, friend!', + confidence = 0.9, ), + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555' + ) + else: + return TranscriptionAvailableCallback( + ) + + def testTranscriptionAvailableCallback(self): + """Test TranscriptionAvailableCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TranscriptionAvailableCallback) + assert instance.event_type == 'bridgeComplete' + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.media_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert instance.recording_id == 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.duration == 'PT13.67S' + assert instance.file_format == 'wav' + assert instance.tag == 'exampleTag' + assert isinstance(instance.transcription, Transcription) + assert instance.transcription.text == 'Nice talking to you, friend!' + assert instance.transcription.confidence == 0.9 + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_transfer_answer_callback.py b/test/unit/models/test_transfer_answer_callback.py new file mode 100644 index 00000000..b1c420ea --- /dev/null +++ b/test/unit/models/test_transfer_answer_callback.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.transfer_answer_callback import TransferAnswerCallback + +class TestTransferAnswerCallback(unittest.TestCase): + """TransferAnswerCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferAnswerCallback: + """Test TransferAnswerCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return TransferAnswerCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555' + ) + else: + return TransferAnswerCallback( + ) + + def testTransferAnswerCallback(self): + """Test TransferAnswerCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TransferAnswerCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_transfer_complete_callback.py b/test/unit/models/test_transfer_complete_callback.py new file mode 100644 index 00000000..256ce779 --- /dev/null +++ b/test/unit/models/test_transfer_complete_callback.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.transfer_complete_callback import TransferCompleteCallback + +class TestTransferCompleteCallback(unittest.TestCase): + """TransferCompleteCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferCompleteCallback: + """Test TransferCompleteCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return TransferCompleteCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else: + return TransferCompleteCallback( + ) + + def testTransferCompleteCallback(self): + """Test TransferCompleteCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TransferCompleteCallback) + assert instance.event_type == 'bridgeComplete' + assert isinstance(instance.event_time, datetime) + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert instance.tag == 'exampleTag' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + assert instance.cause == 'busy' + assert instance.error_message == 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call' + assert instance.error_id == '4642074b-7b58-478b-96e4-3a60955c6765' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_transfer_disconnect_callback.py b/test/unit/models/test_transfer_disconnect_callback.py new file mode 100644 index 00000000..cf5f4e50 --- /dev/null +++ b/test/unit/models/test_transfer_disconnect_callback.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +from datetime import datetime + +from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback + +class TestTransferDisconnectCallback(unittest.TestCase): + """TransferDisconnectCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferDisconnectCallback: + """Test TransferDisconnectCallback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return TransferDisconnectCallback( + event_type = 'bridgeComplete', + event_time = '2022-06-17T22:19:40.375Z', + account_id = '9900000', + application_id = '04e88489-df02-4e34-a0ee-27a91849555f', + var_from = '+15555555555', + to = '+15555555555', + direction = 'inbound', + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', + enqueued_time = '2022-06-17T22:20Z', + start_time = '2022-06-17T22:19:40.375Z', + answer_time = '2022-06-17T22:20Z', + end_time = '2022-06-17T22:20Z', + tag = 'exampleTag', + transfer_caller_id = '+15555555555', + transfer_to = '+15555555555', + cause = 'busy', + error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', + error_id = '4642074b-7b58-478b-96e4-3a60955c6765' + ) + else: + return TransferDisconnectCallback( + ) + + def testTransferDisconnectCallback(self): + """Test TransferDisconnectCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, TransferDisconnectCallback) + assert instance.event_type == 'bridgeComplete' + assert instance.account_id == '9900000' + assert instance.application_id == '04e88489-df02-4e34-a0ee-27a91849555f' + assert instance.var_from == '+15555555555' + assert instance.to == '+15555555555' + assert instance.direction == 'inbound' + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.call_url == 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.parent_call_id == 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d' + assert isinstance(instance.enqueued_time, datetime) + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.answer_time, datetime) + assert isinstance(instance.end_time, datetime) + assert instance.tag == 'exampleTag' + assert instance.transfer_caller_id == '+15555555555' + assert instance.transfer_to == '+15555555555' + assert instance.cause == 'busy' + assert instance.error_message == 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call' + assert instance.error_id == '4642074b-7b58-478b-96e4-3a60955c6765' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_update_call.py b/test/unit/models/test_update_call.py new file mode 100644 index 00000000..ea3b8d6e --- /dev/null +++ b/test/unit/models/test_update_call.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.update_call import UpdateCall + +class TestUpdateCall(unittest.TestCase): + """UpdateCall unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateCall: + """Test UpdateCall + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return UpdateCall( + state = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!', + tag = 'My Custom Tag' + ) + else: + return UpdateCall( + ) + + def testUpdateCall(self): + """Test UpdateCall""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, UpdateCall) + assert instance.state == 'active' + assert instance.redirect_url == 'https://myServer.example/bandwidth/webhooks/redirect' + assert instance.redirect_method == 'POST' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.redirect_fallback_url == 'https://myFallbackServer.example/bandwidth/webhooks/redirect' + assert instance.redirect_fallback_method == 'POST' + assert instance.fallback_username == 'mySecretUsername' + assert instance.fallback_password == 'mySecretPassword1!' + assert instance.tag == 'My Custom Tag' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_update_call_recording.py b/test/unit/models/test_update_call_recording.py similarity index 62% rename from test/unit/test_update_call_recording.py rename to test/unit/models/test_update_call_recording.py index a853acac..6f57afde 100644 --- a/test/unit/test_update_call_recording.py +++ b/test/unit/models/test_update_call_recording.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.update_call_recording import UpdateCallRecording # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.update_call_recording import UpdateCallRecording class TestUpdateCallRecording(unittest.TestCase): """UpdateCallRecording unit test stubs""" @@ -29,28 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UpdateCallRecording: """Test UpdateCallRecording - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `UpdateCallRecording` - """ - model = bandwidth.models.update_call_recording.UpdateCallRecording() # noqa: E501 - if include_optional : + if include_optional: return UpdateCallRecording( state = 'paused' ) - else : + else: return UpdateCallRecording( state = 'paused', ) - """ def testUpdateCallRecording(self): """Test UpdateCallRecording""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, UpdateCallRecording) + assert instance.state == 'paused' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_update_conference.py b/test/unit/models/test_update_conference.py new file mode 100644 index 00000000..6397f802 --- /dev/null +++ b/test/unit/models/test_update_conference.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.update_conference import UpdateConference + +class TestUpdateConference(unittest.TestCase): + """UpdateConference unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateConference: + """Test UpdateConference + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + if include_optional: + return UpdateConference( + status = 'active', + redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_method = 'POST', + username = 'mySecretUsername', + password = 'mySecretPassword1!', + redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect', + redirect_fallback_method = 'POST', + fallback_username = 'mySecretUsername', + fallback_password = 'mySecretPassword1!' + ) + else: + return UpdateConference( + ) + + def testUpdateConference(self): + """Test UpdateConference""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, UpdateConference) + assert instance.status == 'active' + assert instance.redirect_url == 'https://myServer.example/bandwidth/webhooks/conferenceRedirect' + assert instance.redirect_method == 'POST' + assert instance.username == 'mySecretUsername' + assert instance.password == 'mySecretPassword1!' + assert instance.redirect_fallback_url == 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect' + assert instance.redirect_fallback_method == 'POST' + assert instance.fallback_username == 'mySecretUsername' + assert instance.fallback_password == 'mySecretPassword1!' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_update_conference_member.py b/test/unit/models/test_update_conference_member.py similarity index 60% rename from test/unit/test_update_conference_member.py rename to test/unit/models/test_update_conference_member.py index 0f153ff4..e45c38be 100644 --- a/test/unit/test_update_conference_member.py +++ b/test/unit/models/test_update_conference_member.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.update_conference_member import UpdateConferenceMember # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.update_conference_member import UpdateConferenceMember class TestUpdateConferenceMember(unittest.TestCase): """UpdateConferenceMember unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UpdateConferenceMember: """Test UpdateConferenceMember - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `UpdateConferenceMember` - """ - model = bandwidth.models.update_conference_member.UpdateConferenceMember() # noqa: E501 - if include_optional : + if include_optional: return UpdateConferenceMember( - mute = False, - hold = False, + mute = False, + hold = False, call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] ) - else : + else: return UpdateConferenceMember( ) - """ def testUpdateConferenceMember(self): """Test UpdateConferenceMember""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, UpdateConferenceMember) + assert instance.mute == False + assert instance.hold == False + assert instance.call_ids_to_coach == ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"] if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_verify_code_request.py b/test/unit/models/test_verify_code_request.py similarity index 60% rename from test/unit/test_verify_code_request.py rename to test/unit/models/test_verify_code_request.py index 5cefb99a..4bfc92fe 100644 --- a/test/unit/test_verify_code_request.py +++ b/test/unit/models/test_verify_code_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.verify_code_request import VerifyCodeRequest # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.verify_code_request import VerifyCodeRequest class TestVerifyCodeRequest(unittest.TestCase): """VerifyCodeRequest unit test stubs""" @@ -29,33 +26,34 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> VerifyCodeRequest: """Test VerifyCodeRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `VerifyCodeRequest` - """ - model = bandwidth.models.verify_code_request.VerifyCodeRequest() # noqa: E501 - if include_optional : + if include_optional: return VerifyCodeRequest( - to = '+19195551234', - scope = '2FA', - expiration_time_in_minutes = 3, + to = '+19195551234', + scope = '2FA', + expiration_time_in_minutes = 3, code = '123456' ) - else : + else: return VerifyCodeRequest( to = '+19195551234', expiration_time_in_minutes = 3, code = '123456', ) - """ def testVerifyCodeRequest(self): """Test VerifyCodeRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, VerifyCodeRequest) + assert instance.to == '+19195551234' + assert instance.scope == '2FA' + assert instance.expiration_time_in_minutes == 3 + assert instance.code == '123456' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_verify_code_response.py b/test/unit/models/test_verify_code_response.py similarity index 61% rename from test/unit/test_verify_code_response.py rename to test/unit/models/test_verify_code_response.py index e335d611..f2cd59fb 100644 --- a/test/unit/test_verify_code_response.py +++ b/test/unit/models/test_verify_code_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.verify_code_response import VerifyCodeResponse # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.verify_code_response import VerifyCodeResponse class TestVerifyCodeResponse(unittest.TestCase): """VerifyCodeResponse unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> VerifyCodeResponse: """Test VerifyCodeResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `VerifyCodeResponse` - """ - model = bandwidth.models.verify_code_response.VerifyCodeResponse() # noqa: E501 - if include_optional : + if include_optional: return VerifyCodeResponse( valid = True ) - else : + else: return VerifyCodeResponse( ) - """ def testVerifyCodeResponse(self): """Test VerifyCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, VerifyCodeResponse) + assert instance.valid == True if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_voice_api_error.py b/test/unit/models/test_voice_api_error.py similarity index 54% rename from test/unit/test_voice_api_error.py rename to test/unit/models/test_voice_api_error.py index 837b75c6..394a8e8d 100644 --- a/test/unit/test_voice_api_error.py +++ b/test/unit/models/test_voice_api_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.voice_api_error import VoiceApiError # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.voice_api_error import VoiceApiError class TestVoiceApiError(unittest.TestCase): """VoiceApiError unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> VoiceApiError: """Test VoiceApiError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `VoiceApiError` - """ - model = bandwidth.models.voice_api_error.VoiceApiError() # noqa: E501 - if include_optional : + if include_optional: return VoiceApiError( - type = '', - description = '', + type = '', + description = '', id = '' ) - else : + else: return VoiceApiError( ) - """ def testVoiceApiError(self): """Test VoiceApiError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, VoiceApiError) + assert instance.type == '' + assert instance.description == '' + assert instance.id == '' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_voice_code_response.py b/test/unit/models/test_voice_code_response.py similarity index 62% rename from test/unit/test_voice_code_response.py rename to test/unit/models/test_voice_code_response.py index 71950960..323d247f 100644 --- a/test/unit/test_voice_code_response.py +++ b/test/unit/models/test_voice_code_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import bandwidth -from bandwidth.models.voice_code_response import VoiceCodeResponse # noqa: E501 -from bandwidth.rest import ApiException +from bandwidth.models.voice_code_response import VoiceCodeResponse class TestVoiceCodeResponse(unittest.TestCase): """VoiceCodeResponse unit test stubs""" @@ -29,27 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> VoiceCodeResponse: """Test VoiceCodeResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `VoiceCodeResponse` - """ - model = bandwidth.models.voice_code_response.VoiceCodeResponse() # noqa: E501 - if include_optional : + if include_optional: return VoiceCodeResponse( call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' ) - else : + else: return VoiceCodeResponse( ) - """ def testVoiceCodeResponse(self): """Test VoiceCodeResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, VoiceCodeResponse) + assert instance.call_id == 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' if __name__ == '__main__': unittest.main() diff --git a/test/unit/test_answer_callback.py b/test/unit/test_answer_callback.py deleted file mode 100644 index 94cb3d04..00000000 --- a/test/unit/test_answer_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.answer_callback import AnswerCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestAnswerCallback(unittest.TestCase): - """AnswerCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test AnswerCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AnswerCallback` - """ - model = bandwidth.models.answer_callback.AnswerCallback() # noqa: E501 - if include_optional : - return AnswerCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( - value = 'answering-machine', - duration = 'PT4.9891287S', ) - ) - else : - return AnswerCallback( - ) - """ - - def testAnswerCallback(self): - """Test AnswerCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_bridge_complete_callback.py b/test/unit/test_bridge_complete_callback.py deleted file mode 100644 index 38ca08a1..00000000 --- a/test/unit/test_bridge_complete_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestBridgeCompleteCallback(unittest.TestCase): - """BridgeCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test BridgeCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BridgeCompleteCallback` - """ - model = bandwidth.models.bridge_complete_callback.BridgeCompleteCallback() # noqa: E501 - if include_optional : - return BridgeCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return BridgeCompleteCallback( - ) - """ - - def testBridgeCompleteCallback(self): - """Test BridgeCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_bridge_target_complete_callback.py b/test/unit/test_bridge_target_complete_callback.py deleted file mode 100644 index 7de38d19..00000000 --- a/test/unit/test_bridge_target_complete_callback.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestBridgeTargetCompleteCallback(unittest.TestCase): - """BridgeTargetCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test BridgeTargetCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BridgeTargetCompleteCallback` - """ - model = bandwidth.models.bridge_target_complete_callback.BridgeTargetCompleteCallback() # noqa: E501 - if include_optional : - return BridgeTargetCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag' - ) - else : - return BridgeTargetCompleteCallback( - ) - """ - - def testBridgeTargetCompleteCallback(self): - """Test BridgeTargetCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_call_recording_metadata.py b/test/unit/test_call_recording_metadata.py deleted file mode 100644 index 6b3e8d9a..00000000 --- a/test/unit/test_call_recording_metadata.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_recording_metadata import CallRecordingMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallRecordingMetadata(unittest.TestCase): - """CallRecordingMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CallRecordingMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CallRecordingMetadata` - """ - model = bandwidth.models.call_recording_metadata.CallRecordingMetadata() # noqa: E501 - if include_optional : - return CallRecordingMetadata( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '920012', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - to = '+15555555555', - var_from = '+15555555555', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - duration = 'PT13.67S', - direction = 'inbound', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - file_format = 'wav', - status = 'completed', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - transcription = bandwidth.models.transcription_metadata.transcriptionMetadata( - id = 't-387bd648-18f3-4823-9d16-746bca0003c9', - status = 'completed', - completed_time = '2022-06-13T18:46:29.715Z', - url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', ) - ) - else : - return CallRecordingMetadata( - ) - """ - - def testCallRecordingMetadata(self): - """Test CallRecordingMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_call_state.py b/test/unit/test_call_state.py deleted file mode 100644 index a0bb02d5..00000000 --- a/test/unit/test_call_state.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.call_state import CallState # noqa: E501 -from bandwidth.rest import ApiException - -class TestCallState(unittest.TestCase): - """CallState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CallState - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CallState` - """ - model = bandwidth.models.call_state.CallState() # noqa: E501 - if include_optional : - return CallState( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '19195554321', - direction = 'inbound', - state = 'disconnected', - stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"}, - identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken', - enqueued_time = '2022-06-16T13:15:07.160Z', - start_time = '2022-06-16T13:15:07.160Z', - answer_time = '2022-06-16T13:15:18.126Z', - end_time = '2022-06-16T13:15:18.314Z', - disconnect_cause = '', - error_message = '', - error_id = '', - last_update = '2022-06-16T13:15:18.314Z' - ) - else : - return CallState( - ) - """ - - def testCallState(self): - """Test CallState""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference.py b/test/unit/test_conference.py deleted file mode 100644 index 2e83f298..00000000 --- a/test/unit/test_conference.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference import Conference # noqa: E501 -from bandwidth.rest import ApiException - -class TestConference(unittest.TestCase): - """Conference unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Conference - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Conference` - """ - model = bandwidth.models.conference.Conference() # noqa: E501 - if include_optional : - return Conference( - id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - created_time = '2022-06-17T22:19:40.375Z', - completed_time = '2022-06-17T22:20Z', - conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent', - conference_event_method = 'POST', - tag = 'my custom tag', - active_members = [ - bandwidth.models.conference_member.conferenceMember( - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - mute = False, - hold = False, - call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], ) - ] - ) - else : - return Conference( - ) - """ - - def testConference(self): - """Test Conference""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference_member_exit_callback.py b/test/unit/test_conference_member_exit_callback.py deleted file mode 100644 index 879b1f4e..00000000 --- a/test/unit/test_conference_member_exit_callback.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceMemberExitCallback(unittest.TestCase): - """ConferenceMemberExitCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceMemberExitCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceMemberExitCallback` - """ - model = bandwidth.models.conference_member_exit_callback.ConferenceMemberExitCallback() # noqa: E501 - if include_optional : - return ConferenceMemberExitCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - tag = 'exampleTag' - ) - else : - return ConferenceMemberExitCallback( - ) - """ - - def testConferenceMemberExitCallback(self): - """Test ConferenceMemberExitCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference_member_join_callback.py b/test/unit/test_conference_member_join_callback.py deleted file mode 100644 index be466717..00000000 --- a/test/unit/test_conference_member_join_callback.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceMemberJoinCallback(unittest.TestCase): - """ConferenceMemberJoinCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceMemberJoinCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceMemberJoinCallback` - """ - model = bandwidth.models.conference_member_join_callback.ConferenceMemberJoinCallback() # noqa: E501 - if include_optional : - return ConferenceMemberJoinCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - tag = 'exampleTag' - ) - else : - return ConferenceMemberJoinCallback( - ) - """ - - def testConferenceMemberJoinCallback(self): - """Test ConferenceMemberJoinCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference_recording_available_callback.py b/test/unit/test_conference_recording_available_callback.py deleted file mode 100644 index 91de9b94..00000000 --- a/test/unit/test_conference_recording_available_callback.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceRecordingAvailableCallback(unittest.TestCase): - """ConferenceRecordingAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceRecordingAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceRecordingAvailableCallback` - """ - model = bandwidth.models.conference_recording_available_callback.ConferenceRecordingAvailableCallback() # noqa: E501 - if include_optional : - return ConferenceRecordingAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - account_id = '920012', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - tag = 'exampleTag', - status = 'completed' - ) - else : - return ConferenceRecordingAvailableCallback( - ) - """ - - def testConferenceRecordingAvailableCallback(self): - """Test ConferenceRecordingAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_conference_recording_metadata.py b/test/unit/test_conference_recording_metadata.py deleted file mode 100644 index 0538c7d2..00000000 --- a/test/unit/test_conference_recording_metadata.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestConferenceRecordingMetadata(unittest.TestCase): - """ConferenceRecordingMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ConferenceRecordingMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ConferenceRecordingMetadata` - """ - model = bandwidth.models.conference_recording_metadata.ConferenceRecordingMetadata() # noqa: E501 - if include_optional : - return ConferenceRecordingMetadata( - account_id = '920012', - conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9', - name = 'my-conference-name', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - duration = 'PT13.67S', - channels = 1, - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - file_format = 'wav', - status = 'completed', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media' - ) - else : - return ConferenceRecordingMetadata( - ) - """ - - def testConferenceRecordingMetadata(self): - """Test ConferenceRecordingMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_create_call.py b/test/unit/test_create_call.py deleted file mode 100644 index 2aa1ef1b..00000000 --- a/test/unit/test_create_call.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_call import CreateCall # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateCall(unittest.TestCase): - """CreateCall unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateCall - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateCall` - """ - model = bandwidth.models.create_call.CreateCall() # noqa: E501 - if include_optional : - return CreateCall( - to = '+19195551234', - var_from = '+19195554321', - display_name = 'John Doe', - uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64', - application_id = '1234-qwer-5679-tyui', - answer_url = 'https://www.myCallbackServer.example/webhooks/answer', - answer_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer', - answer_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect', - disconnect_method = 'POST', - call_timeout = 30, - callback_timeout = 15, - machine_detection = bandwidth.models.machine_detection_configuration.machineDetectionConfiguration( - mode = 'async', - detection_timeout = 15, - silence_timeout = 10, - speech_threshold = 10, - speech_end_threshold = 5, - machine_speech_end_threshold = 5, - delay_result = False, - callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', - fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', ), - priority = 5, - tag = 'arbitrary text here' - ) - else : - return CreateCall( - to = '+19195551234', - var_from = '+19195554321', - application_id = '1234-qwer-5679-tyui', - answer_url = 'https://www.myCallbackServer.example/webhooks/answer', - ) - """ - - def testCreateCall(self): - """Test CreateCall""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_create_call_response.py b/test/unit/test_create_call_response.py deleted file mode 100644 index deeb0bd2..00000000 --- a/test/unit/test_create_call_response.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.create_call_response import CreateCallResponse # noqa: E501 -from bandwidth.rest import ApiException - -class TestCreateCallResponse(unittest.TestCase): - """CreateCallResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test CreateCallResponse - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateCallResponse` - """ - model = bandwidth.models.create_call_response.CreateCallResponse() # noqa: E501 - if include_optional : - return CreateCallResponse( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '+19195554321', - enqueued_time = '2022-06-16T13:15:07.160Z', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_timeout = 30, - callback_timeout = 15, - tag = 'My custom tag value', - answer_method = 'POST', - answer_url = 'https://myServer.example/bandwidth/webhooks/answer', - answer_fallback_method = 'POST', - answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer', - disconnect_method = 'POST', - disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - priority = 5 - ) - else : - return CreateCallResponse( - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - account_id = '9900000', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - to = '+19195551234', - var_from = '+19195554321', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - answer_method = 'POST', - answer_url = 'https://myServer.example/bandwidth/webhooks/answer', - disconnect_method = 'POST', - ) - """ - - def testCreateCallResponse(self): - """Test CreateCallResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_disconnect_callback.py b/test/unit/test_disconnect_callback.py deleted file mode 100644 index 7efc4c10..00000000 --- a/test/unit/test_disconnect_callback.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.disconnect_callback import DisconnectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestDisconnectCallback(unittest.TestCase): - """DisconnectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DisconnectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DisconnectCallback` - """ - model = bandwidth.models.disconnect_callback.DisconnectCallback() # noqa: E501 - if include_optional : - return DisconnectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - direction = 'inbound', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765', - tag = 'exampleTag' - ) - else : - return DisconnectCallback( - ) - """ - - def testDisconnectCallback(self): - """Test DisconnectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_diversion.py b/test/unit/test_diversion.py deleted file mode 100644 index 6109e693..00000000 --- a/test/unit/test_diversion.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.diversion import Diversion # noqa: E501 -from bandwidth.rest import ApiException - -class TestDiversion(unittest.TestCase): - """Diversion unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Diversion - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Diversion` - """ - model = bandwidth.models.diversion.Diversion() # noqa: E501 - if include_optional : - return Diversion( - reason = 'unavailable', - privacy = 'off', - screen = 'no', - counter = '2', - limit = '3', - unknown = 'unknownValue', - orig_to = '+15558884444' - ) - else : - return Diversion( - ) - """ - - def testDiversion(self): - """Test Diversion""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_dtmf_callback.py b/test/unit/test_dtmf_callback.py deleted file mode 100644 index 10091a99..00000000 --- a/test/unit/test_dtmf_callback.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.dtmf_callback import DtmfCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestDtmfCallback(unittest.TestCase): - """DtmfCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test DtmfCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DtmfCallback` - """ - model = bandwidth.models.dtmf_callback.DtmfCallback() # noqa: E501 - if include_optional : - return DtmfCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - direction = 'inbound', - digit = '2', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - tag = 'exampleTag' - ) - else : - return DtmfCallback( - ) - """ - - def testDtmfCallback(self): - """Test DtmfCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_gather_callback.py b/test/unit/test_gather_callback.py deleted file mode 100644 index dae61d55..00000000 --- a/test/unit/test_gather_callback.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.gather_callback import GatherCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestGatherCallback(unittest.TestCase): - """GatherCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test GatherCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `GatherCallback` - """ - model = bandwidth.models.gather_callback.GatherCallback() # noqa: E501 - if include_optional : - return GatherCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - digits = '123', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - terminating_digit = '#', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - tag = 'exampleTag' - ) - else : - return GatherCallback( - ) - """ - - def testGatherCallback(self): - """Test GatherCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_initiate_callback.py b/test/unit/test_initiate_callback.py deleted file mode 100644 index 49014cae..00000000 --- a/test/unit/test_initiate_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.initiate_callback import InitiateCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestInitiateCallback(unittest.TestCase): - """InitiateCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test InitiateCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `InitiateCallback` - """ - model = bandwidth.models.initiate_callback.InitiateCallback() # noqa: E501 - if include_optional : - return InitiateCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - start_time = '2022-06-17T22:19:40.375Z', - diversion = bandwidth.models.diversion.diversion( - reason = 'unavailable', - privacy = 'off', - screen = 'no', - counter = '2', - limit = '3', - unknown = 'unknownValue', - orig_to = '+15558884444', ), - stir_shaken = bandwidth.models.stir_shaken.stirShaken( - verstat = 'Tn-Verification-Passed', - attestation_indicator = 'A', - originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', ) - ) - else : - return InitiateCallback( - ) - """ - - def testInitiateCallback(self): - """Test InitiateCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_list_message_item.py b/test/unit/test_list_message_item.py deleted file mode 100644 index 9b549595..00000000 --- a/test/unit/test_list_message_item.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.list_message_item import ListMessageItem # noqa: E501 -from bandwidth.rest import ApiException - -class TestListMessageItem(unittest.TestCase): - """ListMessageItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ListMessageItem - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ListMessageItem` - """ - model = bandwidth.models.list_message_item.ListMessageItem() # noqa: E501 - if include_optional : - return ListMessageItem( - message_id = '1589228074636lm4k2je7j7jklbn2', - account_id = '9900000', - source_tn = '+15554443333', - destination_tn = '+15554442222', - message_status = 'RECEIVED', - message_direction = 'INBOUND', - message_type = 'sms', - segment_count = 1, - error_code = 9902, - receive_time = '2020-04-07T14:03:07Z', - carrier_name = 'other', - message_size = 27, - message_length = 18, - attachment_count = 1, - recipient_count = 1, - campaign_class = 'T', - campaign_id = 'CJEUMDK' - ) - else : - return ListMessageItem( - ) - """ - - def testListMessageItem(self): - """Test ListMessageItem""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_lookup_result.py b/test/unit/test_lookup_result.py deleted file mode 100644 index 38fd0a33..00000000 --- a/test/unit/test_lookup_result.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_result import LookupResult # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupResult(unittest.TestCase): - """LookupResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test LookupResult - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `LookupResult` - """ - model = bandwidth.models.lookup_result.LookupResult() # noqa: E501 - if include_optional : - return LookupResult( - response_code = 0, - message = 'NOERROR', - e_164_format = '+19195551234', - formatted = '(919) 555-1234', - country = 'US', - line_type = 'Mobile', - line_provider = 'Verizon Wireless', - mobile_country_code = '310', - mobile_network_code = '010' - ) - else : - return LookupResult( - ) - """ - - def testLookupResult(self): - """Test LookupResult""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_lookup_status.py b/test/unit/test_lookup_status.py deleted file mode 100644 index 8be65daf..00000000 --- a/test/unit/test_lookup_status.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.lookup_status import LookupStatus # noqa: E501 -from bandwidth.rest import ApiException - -class TestLookupStatus(unittest.TestCase): - """LookupStatus unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test LookupStatus - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `LookupStatus` - """ - model = bandwidth.models.lookup_status.LookupStatus() # noqa: E501 - if include_optional : - return LookupStatus( - request_id = '004223a0-8b17-41b1-bf81-20732adf5590', - status = 'COMPLETE', - result = [ - bandwidth.models.lookup_result.lookupResult( - response_code = 0, - message = 'NOERROR', - e/164_format = '+19195551234', - formatted = '(919) 555-1234', - country = 'US', - line_type = 'Mobile', - line_provider = 'Verizon Wireless', - mobile_country_code = '310', - mobile_network_code = '010', ) - ], - failed_telephone_numbers = ["+191955512345"] - ) - else : - return LookupStatus( - ) - """ - - def testLookupStatus(self): - """Test LookupStatus""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_machine_detection_complete_callback.py b/test/unit/test_machine_detection_complete_callback.py deleted file mode 100644 index f39febb4..00000000 --- a/test/unit/test_machine_detection_complete_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionCompleteCallback(unittest.TestCase): - """MachineDetectionCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MachineDetectionCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MachineDetectionCompleteCallback` - """ - model = bandwidth.models.machine_detection_complete_callback.MachineDetectionCompleteCallback() # noqa: E501 - if include_optional : - return MachineDetectionCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult( - value = 'answering-machine', - duration = 'PT4.9891287S', ) - ) - else : - return MachineDetectionCompleteCallback( - ) - """ - - def testMachineDetectionCompleteCallback(self): - """Test MachineDetectionCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_machine_detection_configuration.py b/test/unit/test_machine_detection_configuration.py deleted file mode 100644 index 2bb49ef7..00000000 --- a/test/unit/test_machine_detection_configuration.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration # noqa: E501 -from bandwidth.rest import ApiException - -class TestMachineDetectionConfiguration(unittest.TestCase): - """MachineDetectionConfiguration unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MachineDetectionConfiguration - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MachineDetectionConfiguration` - """ - model = bandwidth.models.machine_detection_configuration.MachineDetectionConfiguration() # noqa: E501 - if include_optional : - return MachineDetectionConfiguration( - mode = 'async', - detection_timeout = 15, - silence_timeout = 10, - speech_threshold = 10, - speech_end_threshold = 5, - machine_speech_end_threshold = 5, - delay_result = False, - callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete', - callback_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete', - fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!' - ) - else : - return MachineDetectionConfiguration( - ) - """ - - def testMachineDetectionConfiguration(self): - """Test MachineDetectionConfiguration""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_message.py b/test/unit/test_message.py deleted file mode 100644 index b441fda4..00000000 --- a/test/unit/test_message.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message import Message # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessage(unittest.TestCase): - """Message unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Message - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Message` - """ - model = bandwidth.models.message.Message() # noqa: E501 - if include_optional : - return Message( - id = '1589228074636lm4k2je7j7jklbn2', - owner = '+15554443333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2022-09-14T18:20:16Z', - segment_count = 2, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"], - text = 'Hello world', - tag = 'custom tag', - priority = 'default', - expiration = '2021-02-01T11:29:18-05:00' - ) - else : - return Message( - ) - """ - - def testMessage(self): - """Test Message""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_message_status_enum.py b/test/unit/test_message_status_enum.py deleted file mode 100644 index 91d85764..00000000 --- a/test/unit/test_message_status_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.message_status_enum import MessageStatusEnum # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessageStatusEnum(unittest.TestCase): - """MessageStatusEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessageStatusEnum(self): - """Test MessageStatusEnum""" - # inst = MessageStatusEnum() - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_messages_list.py b/test/unit/test_messages_list.py deleted file mode 100644 index f2a556db..00000000 --- a/test/unit/test_messages_list.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.messages_list import MessagesList # noqa: E501 -from bandwidth.rest import ApiException - -class TestMessagesList(unittest.TestCase): - """MessagesList unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test MessagesList - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MessagesList` - """ - model = bandwidth.models.messages_list.MessagesList() # noqa: E501 - if include_optional : - return MessagesList( - total_count = 100, - page_info = bandwidth.models.page_info.PageInfo( - prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902', - next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C', - prev_page_token = 'DLAPE902', - next_page_token = 'GL83PD3C', ), - messages = [ - bandwidth.models.list_message_item.listMessageItem( - message_id = '1589228074636lm4k2je7j7jklbn2', - account_id = '9900000', - source_tn = '+15554443333', - destination_tn = '+15554442222', - message_status = 'RECEIVED', - message_direction = 'INBOUND', - message_type = 'sms', - segment_count = 1, - error_code = 9902, - receive_time = '2020-04-07T14:03:07Z', - carrier_name = 'other', - message_size = 27, - message_length = 18, - attachment_count = 1, - recipient_count = 1, - campaign_class = 'T', - campaign_id = 'CJEUMDK', ) - ] - ) - else : - return MessagesList( - ) - """ - - def testMessagesList(self): - """Test MessagesList""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_recording_available_callback.py b/test/unit/test_recording_available_callback.py deleted file mode 100644 index 09bc1902..00000000 --- a/test/unit/test_recording_available_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.recording_available_callback import RecordingAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRecordingAvailableCallback(unittest.TestCase): - """RecordingAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RecordingAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RecordingAvailableCallback` - """ - model = bandwidth.models.recording_available_callback.RecordingAvailableCallback() # noqa: E501 - if include_optional : - return RecordingAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - channels = 'completed', - tag = 'exampleTag', - status = 'completed', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RecordingAvailableCallback( - ) - """ - - def testRecordingAvailableCallback(self): - """Test RecordingAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_recording_complete_callback.py b/test/unit/test_recording_complete_callback.py deleted file mode 100644 index c8a4c403..00000000 --- a/test/unit/test_recording_complete_callback.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.recording_complete_callback import RecordingCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRecordingCompleteCallback(unittest.TestCase): - """RecordingCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RecordingCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RecordingCompleteCallback` - """ - model = bandwidth.models.recording_complete_callback.RecordingCompleteCallback() # noqa: E501 - if include_optional : - return RecordingCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - channels = 1, - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RecordingCompleteCallback( - ) - """ - - def testRecordingCompleteCallback(self): - """Test RecordingCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_redirect_callback.py b/test/unit/test_redirect_callback.py deleted file mode 100644 index 83df0c06..00000000 --- a/test/unit/test_redirect_callback.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.redirect_callback import RedirectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestRedirectCallback(unittest.TestCase): - """RedirectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test RedirectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `RedirectCallback` - """ - model = bandwidth.models.redirect_callback.RedirectCallback() # noqa: E501 - if include_optional : - return RedirectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return RedirectCallback( - ) - """ - - def testRedirectCallback(self): - """Test RedirectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_statistics_api.py b/test/unit/test_statistics_api.py deleted file mode 100644 index 103f3da2..00000000 --- a/test/unit/test_statistics_api.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -import bandwidth -from bandwidth.api.statistics_api import StatisticsApi # noqa: E501 -from bandwidth.rest import ApiException - - -class TestStatisticsApi(unittest.TestCase): - """StatisticsApi unit test stubs""" - - def setUp(self): - self.api = bandwidth.api.statistics_api.StatisticsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_get_statistics(self): - """Test case for get_statistics - - Get Account Statistics # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transcription_available_callback.py b/test/unit/test_transcription_available_callback.py deleted file mode 100644 index 2cd8ea3e..00000000 --- a/test/unit/test_transcription_available_callback.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionAvailableCallback(unittest.TestCase): - """TranscriptionAvailableCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionAvailableCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionAvailableCallback` - """ - model = bandwidth.models.transcription_available_callback.TranscriptionAvailableCallback() # noqa: E501 - if include_optional : - return TranscriptionAvailableCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - end_time = '2022-06-17T22:20Z', - duration = 'PT13.67S', - file_format = 'wav', - tag = 'exampleTag', - transcription = bandwidth.models.transcription.transcription( - text = 'Nice talking to you, friend!', - confidence = 0.9, ), - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return TranscriptionAvailableCallback( - ) - """ - - def testTranscriptionAvailableCallback(self): - """Test TranscriptionAvailableCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transcription_list.py b/test/unit/test_transcription_list.py deleted file mode 100644 index cba18c12..00000000 --- a/test/unit/test_transcription_list.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_list import TranscriptionList # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionList(unittest.TestCase): - """TranscriptionList unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionList - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionList` - """ - model = bandwidth.models.transcription_list.TranscriptionList() # noqa: E501 - if include_optional : - return TranscriptionList( - transcripts = [ - bandwidth.models.transcription.transcription( - text = 'Nice talking to you, friend!', - confidence = 0.9, ) - ] - ) - else : - return TranscriptionList( - ) - """ - - def testTranscriptionList(self): - """Test TranscriptionList""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transcription_metadata.py b/test/unit/test_transcription_metadata.py deleted file mode 100644 index 721ecb71..00000000 --- a/test/unit/test_transcription_metadata.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transcription_metadata import TranscriptionMetadata # noqa: E501 -from bandwidth.rest import ApiException - -class TestTranscriptionMetadata(unittest.TestCase): - """TranscriptionMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TranscriptionMetadata - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TranscriptionMetadata` - """ - model = bandwidth.models.transcription_metadata.TranscriptionMetadata() # noqa: E501 - if include_optional : - return TranscriptionMetadata( - id = 't-387bd648-18f3-4823-9d16-746bca0003c9', - status = 'completed', - completed_time = '2022-06-13T18:46:29.715Z', - url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription' - ) - else : - return TranscriptionMetadata( - ) - """ - - def testTranscriptionMetadata(self): - """Test TranscriptionMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transfer_answer_callback.py b/test/unit/test_transfer_answer_callback.py deleted file mode 100644 index b010211f..00000000 --- a/test/unit/test_transfer_answer_callback.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_answer_callback import TransferAnswerCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferAnswerCallback(unittest.TestCase): - """TransferAnswerCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferAnswerCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferAnswerCallback` - """ - model = bandwidth.models.transfer_answer_callback.TransferAnswerCallback() # noqa: E501 - if include_optional : - return TransferAnswerCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)' - ) - else : - return TransferAnswerCallback( - ) - """ - - def testTransferAnswerCallback(self): - """Test TransferAnswerCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transfer_complete_callback.py b/test/unit/test_transfer_complete_callback.py deleted file mode 100644 index 70dab471..00000000 --- a/test/unit/test_transfer_complete_callback.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_complete_callback import TransferCompleteCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferCompleteCallback(unittest.TestCase): - """TransferCompleteCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferCompleteCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferCompleteCallback` - """ - model = bandwidth.models.transfer_complete_callback.TransferCompleteCallback() # noqa: E501 - if include_optional : - return TransferCompleteCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return TransferCompleteCallback( - ) - """ - - def testTransferCompleteCallback(self): - """Test TransferCompleteCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_transfer_disconnect_callback.py b/test/unit/test_transfer_disconnect_callback.py deleted file mode 100644 index 5fcf35d6..00000000 --- a/test/unit/test_transfer_disconnect_callback.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback # noqa: E501 -from bandwidth.rest import ApiException - -class TestTransferDisconnectCallback(unittest.TestCase): - """TransferDisconnectCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TransferDisconnectCallback - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TransferDisconnectCallback` - """ - model = bandwidth.models.transfer_disconnect_callback.TransferDisconnectCallback() # noqa: E501 - if include_optional : - return TransferDisconnectCallback( - event_type = 'bridgeComplete', - event_time = '2022-06-17T22:19:40.375Z', - account_id = '920012', - application_id = '04e88489-df02-4e34-a0ee-27a91849555f', - var_from = '+15555555555', - to = '+15555555555', - direction = 'inbound', - call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d', - enqueued_time = '2022-06-17T22:20Z', - start_time = '2022-06-17T22:19:40.375Z', - answer_time = '2022-06-17T22:20Z', - end_time = '2022-06-17T22:20Z', - tag = 'exampleTag', - transfer_caller_id = '+15555555555', - transfer_to = '+15555555555)', - cause = 'busy', - error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call', - error_id = '4642074b-7b58-478b-96e4-3a60955c6765' - ) - else : - return TransferDisconnectCallback( - ) - """ - - def testTransferDisconnectCallback(self): - """Test TransferDisconnectCallback""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_update_call.py b/test/unit/test_update_call.py deleted file mode 100644 index a9ed57bd..00000000 --- a/test/unit/test_update_call.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_call import UpdateCall # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateCall(unittest.TestCase): - """UpdateCall unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateCall - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateCall` - """ - model = bandwidth.models.update_call.UpdateCall() # noqa: E501 - if include_optional : - return UpdateCall( - state = 'active', - redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect', - redirect_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect', - redirect_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!', - tag = 'My Custom Tag' - ) - else : - return UpdateCall( - ) - """ - - def testUpdateCall(self): - """Test UpdateCall""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/test_update_conference.py b/test/unit/test_update_conference.py deleted file mode 100644 index ddf8509e..00000000 --- a/test/unit/test_update_conference.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest -import datetime - -import bandwidth -from bandwidth.models.update_conference import UpdateConference # noqa: E501 -from bandwidth.rest import ApiException - -class TestUpdateConference(unittest.TestCase): - """UpdateConference unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UpdateConference - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `UpdateConference` - """ - model = bandwidth.models.update_conference.UpdateConference() # noqa: E501 - if include_optional : - return UpdateConference( - status = 'active', - redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect', - redirect_method = 'POST', - username = 'mySecretUsername', - password = 'mySecretPassword1!', - redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect', - redirect_fallback_method = 'POST', - fallback_username = 'mySecretUsername', - fallback_password = 'mySecretPassword1!' - ) - else : - return UpdateConference( - ) - """ - - def testUpdateConference(self): - """Test UpdateConference""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/utils/call_cleanup.py b/test/utils/call_cleanup.py index 46f3a92e..fb8802da 100644 --- a/test/utils/call_cleanup.py +++ b/test/utils/call_cleanup.py @@ -8,17 +8,17 @@ TEST_SLEEP = 3 MAX_RETRIES = 10 -def callCleanup(self): +def callCleanup(self): """ Whenever we create an actual call, we'll add the call_id to the callIdArray. Then when the integration test is done, as part of tearDown we'll: Do a get to check is the call status is still active If so, update to completed to end the call If not, pop that callID off the array - Once we go through the whole array, we clear the array so it's empty for the next integration test. + Once we go through the whole array, we clear the array so it's empty for the next integration test. if the status is active, send UpdateCall to change to completed - """ - - if len(self.callIdArray) > 0: + """ + + if len(self.callIdArray) > 0: for callId in self.callIdArray: retries = 1 repeat = True @@ -31,13 +31,13 @@ def callCleanup(self): self.calls_api_instance.update_call(BW_ACCOUNT_ID, callId, body) elif get_call_response.state == 'complete': self.callIdArray.remove(callId) - + # We succeeded, break the loop repeat = False except NotFoundException: retries += 1 print(f"Call ID was not registered, trying again attempt {retries}") time.sleep(TEST_SLEEP) - + self.callIdArray.clear() - pass + pass diff --git a/test/utils/env_variables.py b/test/utils/env_variables.py index efff46fb..d9a89c73 100644 --- a/test/utils/env_variables.py +++ b/test/utils/env_variables.py @@ -1,5 +1,5 @@ import os - + try: BW_USERNAME = os.environ['BW_USERNAME'] BW_PASSWORD = os.environ['BW_PASSWORD'] @@ -7,7 +7,6 @@ BW_MESSAGING_APPLICATION_ID = os.environ['BW_MESSAGING_APPLICATION_ID'] BW_VOICE_APPLICATION_ID = os.environ['BW_VOICE_APPLICATION_ID'] BASE_CALLBACK_URL = os.environ['BASE_CALLBACK_URL'] - BW_NUMBER_PROVIDER = os.environ['BW_NUMBER_PROVIDER'] BW_NUMBER = os.environ['BW_NUMBER'] VZW_NUMBER = os.environ['VZW_NUMBER'] ATT_NUMBER = os.environ['ATT_NUMBER'] @@ -25,4 +24,4 @@ RUNNER_OS = os.environ['RUNNER_OS'] except KeyError as e: - raise Exception('Environmental variables not found') \ No newline at end of file + raise Exception('Environmental variables not found')